pub fn send_to_team_visible<I>(&self, pos: Position, team: Team, msg: I)
	where
		I: Into<ServerPacket>,
	{
		let ent = self.entities.entity(0);
		let msg = msg.into();

		self.grid
			.0
			.rough_collide(HitCircle {
				pos: pos,
				rad: self.config.view_radius,
				layer: 0,
				ent: ent,
			})
			.into_iter()
			.filter(|x| self.team.get(*x).map(|&x| x == team).unwrap_or(false))
			.filter_map(|x| self.associated.get(x))
			.for_each(|associated| {
				self.conns.send_to_ref(associated.0, &msg);
			});
	}
/// Send a packet to all player on a team who are
/// within viewing distance of a position.
Send a packet to all player on a team who are
within viewing distance of a position.
Send a packet to all player on a team who are within viewing distance of a position .
pub fn send_to_team_visible<I>(&self, pos: Position, team: Team, msg: I)
	where
		I: Into<ServerPacket>,
	{
		let ent = self.entities.entity(0);
		let msg = msg.into();
		self.grid
			.0
			.rough_collide(HitCircle {
				pos: pos,
				rad: self.config.view_radius,
				layer: 0,
				ent: ent,
			})
			.into_iter()
			.filter(|x| self.team.get(*x).map(|&x| x == team).unwrap_or(false))
			.filter_map(|x| self.associated.get(x))
			.for_each(|associated| {
				self.conns.send_to_ref(associated.0, &msg);
			});
	}
pub fn send_to_team_visible < I > ( & self , pos : Position , team : Team , msg : I ) where I : Into < ServerPacket > , { let ent = self . entities . entity ( 0 ) ; let msg = msg . into ( ) ; self . grid . 0 . rough_collide ( HitCircle { pos : pos , rad : self . config . view_radius , layer : 0 , ent : ent , } ) . into_iter ( ) . filter ( | x | self . team . get ( * x ) . map ( | & x | x == team ) . unwrap_or ( false ) ) . filter_map ( | x | self . associated . get ( x ) ) . for_each ( | associated | { self . conns . send_to_ref ( associated . 0 , & msg ) ; } ) ; }
Send a packet to all player on a team who are
within viewing distance of a position.
Send a packet to all player on a team who are within viewing distance of a position .
&self
pos
Position
team
Team
msg
I
&self
pos
Position
team
Team
msg
I