Struct map_model::edits::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<TransitRouteID>,
    pub proposal_description: Vec<String>,
    pub proposal_link: Option<String>,
}
Expand description

Represents changes to a map. Note this isn’t serializable – that’s what PermanentMapEdits does.

Fields

edits_name: Stringcommands: 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<TransitRouteID>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

Encode the edits in a permanent format, referring to more-stable OSM IDs.

Load map edits from a JSON file. Strip out any commands that’re broken because they don’t match the current map. If the resulting edits are totally empty, consider that a failure – the edits likely don’t cover this map at all.

Load map edits from the given JSON bytes. Strip out any commands that’re broken because they don’t match the current map. If the resulting edits are totally empty, consider that a failure – the edits likely don’t cover this map at all.

Assumes update_derived has been called.

Pick apart changed_roads and figure out if an entire road was edited, or just a few lanes. Doesn’t return deleted lanes.

Produces an md5sum of the contents of the edits.

Get the human-friendly of these edits. If they have a descrption, the first line is the title. Otherwise we use the filename.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.