[−][src]Struct map_model::Map
Fields
roads: Vec<Road>
lanes: Vec<Lane>
intersections: Vec<Intersection>
turns: BTreeMap<TurnID, Turn>
buildings: Vec<Building>
bus_stops: BTreeMap<BusStopID, BusStop>
bus_routes: Vec<BusRoute>
areas: Vec<Area>
parking_lots: Vec<ParkingLot>
boundary_polygon: Polygon
stop_signs: BTreeMap<IntersectionID, ControlStopSign>
traffic_signals: BTreeMap<IntersectionID, ControlTrafficSignal>
gps_bounds: GPSBounds
bounds: Bounds
config: MapConfig
pathfinder: Pathfinder
pathfinder_dirty: bool
routing_params: RoutingParams
zones: Vec<Zone>
name: MapName
edits: MapEdits
Implementations
impl Map
[src]
pub fn new_edits(&self) -> MapEdits
[src]
pub fn get_edits(&self) -> &MapEdits
[src]
pub fn unsaved_edits(&self) -> bool
[src]
pub fn get_r_edit(&self, r: RoadID) -> EditRoad
[src]
pub fn edit_road_cmd<F: Fn(&mut EditRoad)>(&self, r: RoadID, f: F) -> EditCmd
[src]
pub fn get_i_edit(&self, i: IntersectionID) -> EditIntersection
[src]
Panics on borders
pub fn save_edits(&self)
[src]
pub fn must_apply_edits(
&mut self,
new_edits: MapEdits
) -> (BTreeSet<RoadID>, BTreeSet<TurnID>, BTreeSet<TurnID>, BTreeSet<IntersectionID>)
[src]
&mut self,
new_edits: MapEdits
) -> (BTreeSet<RoadID>, BTreeSet<TurnID>, BTreeSet<TurnID>, BTreeSet<IntersectionID>)
pub fn try_apply_edits(&mut self, new_edits: MapEdits)
[src]
fn apply_edits(
&mut self,
new_edits: MapEdits,
enforce_valid: bool
) -> (BTreeSet<RoadID>, BTreeSet<TurnID>, BTreeSet<TurnID>, BTreeSet<IntersectionID>)
[src]
&mut self,
new_edits: MapEdits,
enforce_valid: bool
) -> (BTreeSet<RoadID>, BTreeSet<TurnID>, BTreeSet<TurnID>, BTreeSet<IntersectionID>)
pub fn recalculate_pathfinding_after_edits(&mut self, timer: &mut Timer<'_>)
[src]
This can expensive, so don't constantly do it while editing in the UI. But this must happen before the simulation resumes.
pub fn incremental_edit_traffic_signal(&mut self, signal: ControlTrafficSignal)
[src]
Since the player is in the middle of editing, the signal may not be valid. Don't go through the entire apply_edits flow.
impl Map
[src]
pub fn create_from_raw(
raw: RawMap,
build_ch: bool,
keep_bldg_tags: bool,
timer: &mut Timer<'_>
) -> Map
[src]
raw: RawMap,
build_ch: bool,
keep_bldg_tags: bool,
timer: &mut Timer<'_>
) -> Map
impl Map
[src]
pub fn import_minimal(
name: MapName,
bounds: Bounds,
gps_bounds: GPSBounds,
intersections: Vec<Intersection>,
roads: Vec<Road>,
lanes: Vec<Lane>,
turns: Vec<Turn>
) -> Map
[src]
name: MapName,
bounds: Bounds,
gps_bounds: GPSBounds,
intersections: Vec<Intersection>,
roads: Vec<Road>,
lanes: Vec<Lane>,
turns: Vec<Turn>
) -> Map
Use for creating a map directly from some external format, not from a RawMap.
impl Map
[src]
pub fn load_synchronously(path: String, timer: &mut Timer<'_>) -> Map
[src]
Load a map from a local serialized Map or RawMap. Note this won't work on web. This should only be used by non-UI tools.
pub fn map_loaded_directly(&mut self)
[src]
After deserializing a map directly, call this after.
pub fn blank() -> Map
[src]
Just for temporary std::mem::replace tricks.
pub fn all_roads(&self) -> &Vec<Road>
[src]
pub fn all_lanes(&self) -> &Vec<Lane>
[src]
pub fn all_intersections(&self) -> &Vec<Intersection>
[src]
pub fn all_turns(&self) -> &BTreeMap<TurnID, Turn>
[src]
pub fn all_buildings(&self) -> &Vec<Building>
[src]
pub fn all_areas(&self) -> &Vec<Area>
[src]
pub fn all_parking_lots(&self) -> &Vec<ParkingLot>
[src]
pub fn all_zones(&self) -> &Vec<Zone>
[src]
pub fn maybe_get_r(&self, id: RoadID) -> Option<&Road>
[src]
pub fn maybe_get_l(&self, id: LaneID) -> Option<&Lane>
[src]
pub fn maybe_get_i(&self, id: IntersectionID) -> Option<&Intersection>
[src]
pub fn maybe_get_t(&self, id: TurnID) -> Option<&Turn>
[src]
pub fn maybe_get_b(&self, id: BuildingID) -> Option<&Building>
[src]
pub fn maybe_get_pl(&self, id: ParkingLotID) -> Option<&ParkingLot>
[src]
pub fn maybe_get_a(&self, id: AreaID) -> Option<&Area>
[src]
pub fn maybe_get_bs(&self, id: BusStopID) -> Option<&BusStop>
[src]
pub fn maybe_get_stop_sign(
&self,
id: IntersectionID
) -> Option<&ControlStopSign>
[src]
&self,
id: IntersectionID
) -> Option<&ControlStopSign>
pub fn maybe_get_traffic_signal(
&self,
id: IntersectionID
) -> Option<&ControlTrafficSignal>
[src]
&self,
id: IntersectionID
) -> Option<&ControlTrafficSignal>
pub fn maybe_get_br(&self, route: BusRouteID) -> Option<&BusRoute>
[src]
pub fn get_r(&self, id: RoadID) -> &Road
[src]
pub fn get_l(&self, id: LaneID) -> &Lane
[src]
pub fn get_i(&self, id: IntersectionID) -> &Intersection
[src]
pub fn get_t(&self, id: TurnID) -> &Turn
[src]
pub fn get_b(&self, id: BuildingID) -> &Building
[src]
pub fn get_a(&self, id: AreaID) -> &Area
[src]
pub fn get_pl(&self, id: ParkingLotID) -> &ParkingLot
[src]
pub fn get_stop_sign(&self, id: IntersectionID) -> &ControlStopSign
[src]
pub fn get_traffic_signal(&self, id: IntersectionID) -> &ControlTrafficSignal
[src]
pub fn get_turns_in_intersection(&self, id: IntersectionID) -> Vec<&Turn>
[src]
pub fn get_turns_from_lane(&self, l: LaneID) -> Vec<&Turn>
[src]
The turns may belong to two different intersections!
pub fn get_turns_to_lane(&self, l: LaneID) -> Vec<&Turn>
[src]
pub fn get_turn_between(
&self,
from: LaneID,
to: LaneID,
parent: IntersectionID
) -> Option<TurnID>
[src]
&self,
from: LaneID,
to: LaneID,
parent: IntersectionID
) -> Option<TurnID>
pub fn get_next_turns_and_lanes(
&self,
from: LaneID,
parent: IntersectionID
) -> Vec<(&Turn, &Lane)>
[src]
&self,
from: LaneID,
parent: IntersectionID
) -> Vec<(&Turn, &Lane)>
pub fn get_turns_for(
&self,
from: LaneID,
constraints: PathConstraints
) -> Vec<&Turn>
[src]
&self,
from: LaneID,
constraints: PathConstraints
) -> Vec<&Turn>
pub fn get_next_roads(&self, from: RoadID) -> BTreeSet<RoadID>
[src]
pub fn get_parent(&self, id: LaneID) -> &Road
[src]
pub fn get_gps_bounds(&self) -> &GPSBounds
[src]
pub fn get_bounds(&self) -> &Bounds
[src]
pub fn get_city_name(&self) -> &CityName
[src]
pub fn get_name(&self) -> &MapName
[src]
pub fn all_bus_stops(&self) -> &BTreeMap<BusStopID, BusStop>
[src]
pub fn get_bs(&self, stop: BusStopID) -> &BusStop
[src]
pub fn get_br(&self, route: BusRouteID) -> &BusRoute
[src]
pub fn all_bus_routes(&self) -> &Vec<BusRoute>
[src]
pub fn get_bus_route(&self, name: &str) -> Option<&BusRoute>
[src]
pub fn get_routes_serving_stop(&self, stop: BusStopID) -> Vec<&BusRoute>
[src]
pub fn building_to_road(&self, id: BuildingID) -> &Road
[src]
pub fn all_incoming_borders(&self) -> Vec<&Intersection>
[src]
This and all_outgoing_borders are expensive to constantly repeat
pub fn all_outgoing_borders(&self) -> Vec<&Intersection>
[src]
pub fn save(&self)
[src]
pub fn find_driving_lane_near_building(&self, b: BuildingID) -> LaneID
[src]
Cars trying to park near this building should head for the driving lane returned here, then start their search. Some parking lanes are connected to driving lanes that're "parking blackholes" -- if there are no free spots on that lane, then the roads force cars to a border.
pub fn get_boundary_polygon(&self) -> &Polygon
[src]
pub fn pathfind(&self, req: PathRequest) -> Result<Path>
[src]
pub fn pathfind_avoiding_lanes(
&self,
req: PathRequest,
avoid: BTreeSet<LaneID>
) -> Option<Path>
[src]
&self,
req: PathRequest,
avoid: BTreeSet<LaneID>
) -> Option<Path>
pub fn pathfind_with_params(
&self,
req: PathRequest,
params: &RoutingParams
) -> Result<Path>
[src]
&self,
req: PathRequest,
params: &RoutingParams
) -> Result<Path>
pub fn should_use_transit(
&self,
start: Position,
end: Position
) -> Option<(BusStopID, Option<BusStopID>, BusRouteID)>
[src]
&self,
start: Position,
end: Position
) -> Option<(BusStopID, Option<BusStopID>, BusRouteID)>
pub fn get_movement(&self, t: TurnID) -> Option<MovementID>
[src]
pub fn find_r_by_osm_id(&self, id: OriginalRoad) -> Result<RoadID>
[src]
pub fn find_i_by_osm_id(&self, id: NodeID) -> Result<IntersectionID>
[src]
pub fn find_b_by_osm_id(&self, id: OsmID) -> Option<BuildingID>
[src]
pub fn find_br(&self, id: RelationID) -> Option<BusRouteID>
[src]
pub fn hack_override_offstreet_spots(&mut self, spots_per_bldg: usize)
[src]
pub fn hack_override_offstreet_spots_individ(
&mut self,
b: BuildingID,
spots: usize
)
[src]
&mut self,
b: BuildingID,
spots: usize
)
pub fn hack_override_bldg_type(
&mut self,
b: BuildingID,
bldg_type: BuildingType
)
[src]
&mut self,
b: BuildingID,
bldg_type: BuildingType
)
pub fn hack_override_orig_spawn_times(
&mut self,
br: BusRouteID,
times: Vec<Time>
)
[src]
&mut self,
br: BusRouteID,
times: Vec<Time>
)
pub fn hack_add_area(
&mut self,
area_type: AreaType,
polygon: Polygon,
osm_tags: Tags
)
[src]
&mut self,
area_type: AreaType,
polygon: Polygon,
osm_tags: Tags
)
pub fn hack_override_routing_params(
&mut self,
routing_params: RoutingParams,
timer: &mut Timer<'_>
)
[src]
&mut self,
routing_params: RoutingParams,
timer: &mut Timer<'_>
)
pub fn get_languages(&self) -> BTreeSet<&str>
[src]
pub fn get_config(&self) -> &MapConfig
[src]
pub fn simple_path_btwn(
&self,
i1: IntersectionID,
i2: IntersectionID
) -> Option<Vec<RoadID>>
[src]
&self,
i1: IntersectionID,
i2: IntersectionID
) -> Option<Vec<RoadID>>
Simple search along undirected roads
pub fn routing_params(&self) -> &RoutingParams
[src]
Returns the routing params baked into the map.
Trait Implementations
impl<'de> Deserialize<'de> for Map
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for Map
[src]
Auto Trait Implementations
impl RefUnwindSafe for Map
[src]
impl Send for Map
[src]
impl Sync for Map
[src]
impl Unpin for Map
[src]
impl UnwindSafe for Map
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,