Enum ggrs::PlayerType
source · pub enum PlayerType<A>where
A: Clone + PartialEq + Eq + Hash,{
Local,
Remote(A),
Spectator(A),
}
Expand description
Defines the three types of players that GGRS considers:
- local players, who play on the local device,
- remote players, who play on other devices and
- spectators, who are remote players that do not contribute to the game input.
Both
PlayerType::Remote
andPlayerType::Spectator
have a socket address associated with them.
Variants§
Local
This player plays on the local device.
Remote(A)
This player plays on a remote device identified by the socket address.
Spectator(A)
This player spectates on a remote device identified by the socket address. They do not contribute to the game input.
Trait Implementations§
source§impl<A> Clone for PlayerType<A>where
A: Clone + PartialEq + Eq + Hash + Clone,
impl<A> Clone for PlayerType<A>where A: Clone + PartialEq + Eq + Hash + Clone,
source§fn clone(&self) -> PlayerType<A>
fn clone(&self) -> PlayerType<A>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<A> PartialEq<PlayerType<A>> for PlayerType<A>where
A: Clone + PartialEq + Eq + Hash + PartialEq,
impl<A> PartialEq<PlayerType<A>> for PlayerType<A>where A: Clone + PartialEq + Eq + Hash + PartialEq,
source§fn eq(&self, other: &PlayerType<A>) -> bool
fn eq(&self, other: &PlayerType<A>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.