pub struct WorldSnapshot {
pub people: Vec<Person>,
pub governments: Vec<Government>,
pub territories: Vec<Territory>,
pub routes: Vec<Route>,
pub armies: Vec<Army>,
pub letters: Vec<LetterCargo>,
}Fields§
§people: Vec<Person>§governments: Vec<Government>§territories: Vec<Territory>§routes: Vec<Route>§armies: Vec<Army>§letters: Vec<LetterCargo>Implementations§
Source§impl WorldSnapshot
impl WorldSnapshot
pub fn entities(&self) -> Vec<EntityRef>
pub fn person(&self, id: PersonId) -> Option<&Person>
pub fn government(&self, id: GovernmentId) -> Option<&Government>
pub fn territory(&self, id: TerritoryId) -> Option<&Territory>
pub fn route(&self, id: RouteId) -> Option<&Route>
pub fn army(&self, id: ArmyId) -> Option<&Army>
pub fn letter(&self, id: LetterId) -> Option<&LetterCargo>
pub fn route_between( &self, from: TerritoryId, to: TerritoryId, ) -> Option<&Route>
pub fn adjacent_territories( &self, territory: TerritoryId, ) -> impl Iterator<Item = TerritoryId> + '_
pub fn travel_duration( &self, from: TerritoryId, to: TerritoryId, ) -> Option<SimDuration>
pub fn distance(&self, from: TerritoryId, to: TerritoryId) -> Option<f32>
pub fn territories_within( &self, center: TerritoryId, radius: f32, ) -> impl Iterator<Item = &Territory>
Trait Implementations§
Source§impl Clone for WorldSnapshot
impl Clone for WorldSnapshot
Source§impl Debug for WorldSnapshot
impl Debug for WorldSnapshot
Source§impl Default for WorldSnapshot
impl Default for WorldSnapshot
Source§impl<'de> Deserialize<'de> for WorldSnapshot
impl<'de> Deserialize<'de> for WorldSnapshot
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
Source§impl PartialEq for WorldSnapshot
impl PartialEq for WorldSnapshot
Source§impl Serialize for WorldSnapshot
impl Serialize for WorldSnapshot
impl StructuralPartialEq for WorldSnapshot
Auto Trait Implementations§
impl Freeze for WorldSnapshot
impl RefUnwindSafe for WorldSnapshot
impl Send for WorldSnapshot
impl Sync for WorldSnapshot
impl Unpin for WorldSnapshot
impl UnsafeUnpin for WorldSnapshot
impl UnwindSafe for WorldSnapshot
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