Struct map_model::MapEdits [−][src]
pub struct MapEdits { pub edits_name: String, pub commands: Vec<EditCmd>, pub merge_zones: bool, pub changed_roads: BTreeSet<RoadID>, pub original_intersections: BTreeMap<IntersectionID, EditIntersection>, pub changed_routes: BTreeSet<BusRouteID>, pub proposal_description: Vec<String>, pub proposal_link: Option<String>, }
Represents changes to a map. Note this isn’t serializable – that’s what PermanentMapEdits
does.
Fields
edits_name: String
commands: Vec<EditCmd>
A stack, oldest edit is first. The same intersection may be edited multiple times in this stack, until compress() happens.
merge_zones: bool
If false, adjacent roads with the same AccessRestrictions will not be merged into the same Zone; every Road will be its own Zone. This is used to experiment with a per-road cap. Note this is a map-wide setting.
changed_roads: BTreeSet<RoadID>
Derived from commands, kept up to date by update_derived
original_intersections: BTreeMap<IntersectionID, EditIntersection>
changed_routes: BTreeSet<BusRouteID>
proposal_description: Vec<String>
Some edits are included in the game by default, in data/system/proposals, as “community proposals.” They require a description and may have a link to a write-up.
proposal_link: Option<String>
Implementations
impl MapEdits
[src]
impl MapEdits
[src]pub fn to_permanent(&self, map: &Map) -> PermanentMapEdits
[src]
Encode the edits in a permanent format, referring to more-stable OSM IDs.
impl MapEdits
[src]
impl MapEdits
[src]pub(crate) fn new() -> MapEdits
[src]
pub fn load(map: &Map, path: String, timer: &mut Timer<'_>) -> Result<MapEdits>
[src]
fn save(&self, map: &Map)
[src]
fn update_derived(&mut self, map: &Map)
[src]
pub fn compress(&mut self, map: &Map)
[src]
Assumes update_derived has been called.
pub fn changed_lanes(&self, map: &Map) -> (BTreeSet<LaneID>, BTreeSet<RoadID>)
[src]
Pick apart changed_roads and figure out if an entire road was edited, or just a few lanes. Doesn’t return deleted lanes.
Trait Implementations
impl StructuralPartialEq for MapEdits
[src]
Auto Trait Implementations
impl RefUnwindSafe for MapEdits
impl Send for MapEdits
impl Sync for MapEdits
impl Unpin for MapEdits
impl UnwindSafe for MapEdits
Blanket Implementations
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,