pub struct GameState {
pub character: CharacterState,
pub tavern: Tavern,
pub arena: Arena,
pub last_fight: Option<Fight>,
pub weapon_shop: Option<Shop>,
pub mage_shop: Option<Shop>,
pub special: Special,
pub unlocks: Unlockables,
pub other_players: OtherPlayers,
/* private fields */
}
Fields§
§character: CharacterState
§tavern: Tavern
Information about quests and work
arena: Arena
§last_fight: Option<Fight>
The last fight, that this player was involved in
weapon_shop: Option<Shop>
§mage_shop: Option<Shop>
§special: Special
Everything, that is time sensitive, like events, calendar, etc.
unlocks: Unlockables
Everything, that the player needs
other_players: OtherPlayers
Implementations§
source§impl GameState
impl GameState
pub fn new(response: Response) -> Result<Self, SFError>
sourcepub fn update(&mut self, response: Response) -> Result<(), SFError>
pub fn update(&mut self, response: Response) -> Result<(), SFError>
Updates the players information with the new data received from the server. Any error that is encounters terminates the update process
sourcepub fn server_time(&self) -> ServerTime
pub fn server_time(&self) -> ServerTime
Returns the time of the server. This is just an 8 byte copy behind the scenes, so feel free to NOT cache/optimize calling this in any way
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
Auto Trait Implementations§
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