#[non_exhaustive]pub struct GameState {
pub players: Vec<Player>,
pub buildings: BTreeMap<EntityId, Building>,
pub projectiles: BTreeMap<EntityId, Projectile>,
pub collisions: Vec<Collision>,
pub world: Option<World>,
pub kills: Vec<Kill>,
pub tick: DemoTick,
pub server_classes: Vec<ServerClass>,
pub interval_per_tick: f32,
pub outer_map: HashMap<Handle, EntityId>,
pub events: Vec<(DemoTick, GameEvent)>,
pub objectives: BTreeMap<EntityId, Objective>,
}
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.players: Vec<Player>
§buildings: BTreeMap<EntityId, Building>
§projectiles: BTreeMap<EntityId, Projectile>
§collisions: Vec<Collision>
§world: Option<World>
§kills: Vec<Kill>
§tick: DemoTick
§server_classes: Vec<ServerClass>
§interval_per_tick: f32
§outer_map: HashMap<Handle, EntityId>
§events: Vec<(DemoTick, GameEvent)>
§objectives: BTreeMap<EntityId, Objective>
Implementations§
Source§impl GameState
impl GameState
pub fn get_player(&self, id: EntityId) -> Option<&Player>
pub fn get_or_create_player(&mut self, entity_id: EntityId) -> &mut Player
pub fn get_or_create_building( &mut self, entity_id: EntityId, class: BuildingClass, ) -> &mut Building
pub fn check_collision(&self, projectile: &Projectile) -> Option<&Player>
pub fn projectile_destroy(&mut self, id: EntityId)
pub fn remove_building(&mut self, entity_id: EntityId)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GameState
impl<'de> Deserialize<'de> for GameState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for GameState
Auto Trait Implementations§
impl Freeze for GameState
impl RefUnwindSafe for GameState
impl Send for GameState
impl Sync for GameState
impl Unpin for GameState
impl UnwindSafe for GameState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more