@@ -80,8 +80,8 @@ pub trait AppVisibilityExt {
8080 type ClientComponent = Self;
8181 type Scope = Entity;
8282
83- fn is_visible(&self, _client: Entity, client_component : Option<&Self::ClientComponent>) -> bool {
84- client_component .is_some_and(|c| self == c)
83+ fn is_visible(&self, _client: Entity, component : Option<&Self::ClientComponent>) -> bool {
84+ component .is_some_and(|c| self == c)
8585 }
8686 }
8787 ```
@@ -226,9 +226,9 @@ pub trait VisibilityFilter: Component<Mutability = Immutable> {
226226 type ClientComponent = Moderator;
227227 type Scope = Entity;
228228
229- fn is_visible(&self, _client: Entity, client_component : Option<&Self::ClientComponent>) -> bool {
229+ fn is_visible(&self, _client: Entity, component : Option<&Self::ClientComponent>) -> bool {
230230 // Only moderators can see entities with sensitive information.
231- client_component .is_some()
231+ component .is_some()
232232 }
233233 }
234234 ```
@@ -246,9 +246,9 @@ pub trait VisibilityFilter: Component<Mutability = Immutable> {
246246 type ClientComponent = Self;
247247 type Scope = Entity;
248248
249- fn is_visible(&self, _client: Entity, client_component : Option<&Self::ClientComponent>) -> bool {
249+ fn is_visible(&self, _client: Entity, component : Option<&Self::ClientComponent>) -> bool {
250250 // Visible only if the client also has `SpectatorOnly`.
251- client_component .is_some()
251+ component .is_some()
252252 }
253253 }
254254 ```
@@ -276,8 +276,8 @@ pub trait VisibilityFilter: Component<Mutability = Immutable> {
276276 /// type ClientComponent = Self;
277277 /// type Scope = Entity;
278278 ///
279- /// fn is_visible(&self, _client: Entity, client_component : Option<&Self::ClientComponent>) -> bool {
280- /// client_component .is_some_and(|c| self == c)
279+ /// fn is_visible(&self, _client: Entity, component : Option<&Self::ClientComponent>) -> bool {
280+ /// component .is_some_and(|c| self == c)
281281 /// }
282282 /// }
283283 /// ```
@@ -295,8 +295,8 @@ pub trait VisibilityFilter: Component<Mutability = Immutable> {
295295 /// type ClientComponent = Self;
296296 /// type Scope = SingleComponent<Health>;
297297 ///
298- /// fn is_visible(&self, _client: Entity, client_component : Option<&Self::ClientComponent>) -> bool {
299- /// client_component .is_some_and(|c| self == c)
298+ /// fn is_visible(&self, _client: Entity, component : Option<&Self::ClientComponent>) -> bool {
299+ /// component .is_some_and(|c| self == c)
300300 /// }
301301 /// }
302302 ///
@@ -317,8 +317,8 @@ pub trait VisibilityFilter: Component<Mutability = Immutable> {
317317 /// type ClientComponent = Self;
318318 /// type Scope = (Health, Stats);
319319 ///
320- /// fn is_visible(&self, _client: Entity, client_component : Option<&Self::ClientComponent>) -> bool {
321- /// client_component .is_some_and(|c| self == c)
320+ /// fn is_visible(&self, _client: Entity, component : Option<&Self::ClientComponent>) -> bool {
321+ /// component .is_some_and(|c| self == c)
322322 /// }
323323 /// }
324324 ///
@@ -352,8 +352,8 @@ pub trait VisibilityFilter: Component<Mutability = Immutable> {
352352 type ClientComponent = Self;
353353 type Scope = Entity;
354354
355- fn is_visible(&self, _client: Entity, client_component : Option<&Self::ClientComponent>) -> bool {
356- client_component .is_some()
355+ fn is_visible(&self, _client: Entity, component : Option<&Self::ClientComponent>) -> bool {
356+ component .is_some()
357357 }
358358 }
359359 ```
@@ -375,9 +375,9 @@ pub trait VisibilityFilter: Component<Mutability = Immutable> {
375375 type ClientComponent = Unit;
376376 type Scope = Entity;
377377
378- fn is_visible(&self, _client: Entity, client_component : Option<&Self::ClientComponent>) -> bool {
378+ fn is_visible(&self, _client: Entity, component : Option<&Self::ClientComponent>) -> bool {
379379 // Blind clients cannot see units.
380- client_component .is_none()
380+ component .is_none()
381381 }
382382 }
383383 ```
@@ -395,9 +395,9 @@ pub trait VisibilityFilter: Component<Mutability = Immutable> {
395395 type ClientComponent = Self;
396396 type Scope = Entity;
397397
398- fn is_visible(&self, _client: Entity, client_component : Option<&Self::ClientComponent>) -> bool {
398+ fn is_visible(&self, _client: Entity, component : Option<&Self::ClientComponent>) -> bool {
399399 // Visible if the client belongs to the same team.
400- client_component .is_some_and(|c| self == c)
400+ component .is_some_and(|c| self == c)
401401 }
402402 }
403403 ```
@@ -424,8 +424,8 @@ pub trait VisibilityFilter: Component<Mutability = Immutable> {
424424 type ClientComponent = Self;
425425 type Scope = Entity;
426426
427- fn is_visible(&self, _client: Entity, client_component : Option<&Self::ClientComponent>) -> bool {
428- client_component .is_some_and(|&c| self.contains(c))
427+ fn is_visible(&self, _client: Entity, component : Option<&Self::ClientComponent>) -> bool {
428+ component .is_some_and(|&c| self.contains(c))
429429 }
430430 }
431431 ```
@@ -443,13 +443,13 @@ pub trait VisibilityFilter: Component<Mutability = Immutable> {
443443 type ClientComponent = AuthorizedClient; // All clients authorized for replication have this component.
444444 type Scope = Entity;
445445
446- fn is_visible(&self, client: Entity, _client_component : Option<&Self::ClientComponent>) -> bool {
446+ fn is_visible(&self, client: Entity, _component : Option<&Self::ClientComponent>) -> bool {
447447 self.0 == client
448448 }
449449 }
450450 ```
451451 */
452- fn is_visible ( & self , client : Entity , client_component : Option < & Self :: ClientComponent > ) -> bool ;
452+ fn is_visible ( & self , client : Entity , component : Option < & Self :: ClientComponent > ) -> bool ;
453453}
454454
455455/// Associates the type with a visibility scope.
@@ -661,12 +661,8 @@ mod tests {
661661 type ClientComponent = Self ;
662662 type Scope = Entity ;
663663
664- fn is_visible (
665- & self ,
666- _client : Entity ,
667- client_component : Option < & Self :: ClientComponent > ,
668- ) -> bool {
669- client_component. is_some ( )
664+ fn is_visible ( & self , _client : Entity , component : Option < & Self :: ClientComponent > ) -> bool {
665+ component. is_some ( )
670666 }
671667 }
672668
@@ -678,12 +674,8 @@ mod tests {
678674 type ClientComponent = ClientFilter ;
679675 type Scope = Entity ;
680676
681- fn is_visible (
682- & self ,
683- _client : Entity ,
684- client_component : Option < & Self :: ClientComponent > ,
685- ) -> bool {
686- client_component. is_some ( )
677+ fn is_visible ( & self , _client : Entity , component : Option < & Self :: ClientComponent > ) -> bool {
678+ component. is_some ( )
687679 }
688680 }
689681
0 commit comments