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
sourceimpl 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
sourceimpl<'de> Deserialize<'de> for City
impl<'de> Deserialize<'de> for City
sourcefn 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 City
impl Send for City
impl Sync for City
impl Unpin for City
impl UnwindSafe for City
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self