pub struct City {
pub name: CityName,
pub boundary: Polygon,
pub areas: Vec<(AreaType, Polygon)>,
pub districts: Vec<(MapName, Polygon)>,
}
Expand description
A single city (like Seattle) can be broken down into multiple boundary polygons (udistrict, ballard, downtown, etc). The load map screen uses this struct to display the entire city.
Fields§
§name: CityName
§boundary: Polygon
§areas: Vec<(AreaType, Polygon)>
§districts: Vec<(MapName, Polygon)>
The individual maps
Implementations§
source§impl City
impl City
sourcepub fn from_huge_map(huge_map: &Map) -> City
pub fn from_huge_map(huge_map: &Map) -> City
If there’s a single map covering all the smaller maps, use this.
sourcepub fn from_individual_maps(city_name: &CityName, timer: &mut Timer<'_>) -> City
pub fn from_individual_maps(city_name: &CityName, timer: &mut Timer<'_>) -> City
Generate a city from a bunch of smaller, individual maps. The boundaries of those maps may overlap and may have gaps between them.
Trait Implementations§
source§impl<'de> Deserialize<'de> for City
impl<'de> Deserialize<'de> for City
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 Freeze for City
impl RefUnwindSafe for City
impl Send for City
impl Sync for City
impl Unpin for City
impl UnwindSafe for City
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