Skip to content

Commit 0058f99

Browse files
committed
Mechanical rename of TripEndpoint::Bldg to ::Building, mostly to kick off a [rebuild] [release]
1 parent 3d33d27 commit 0058f99

26 files changed

Lines changed: 67 additions & 66 deletions

File tree

cli/src/augment_scenario.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ fn add_lunch_trips(scenario: &mut Scenario, map: &Map, rng: &mut XorShiftRng, ti
8080
}
8181

8282
let work = match person.trips[num_trips - 2].destination {
83-
TripEndpoint::Bldg(b) => b,
83+
TripEndpoint::Building(b) => b,
8484
_ => continue,
8585
};
8686
let has_bike = person.trips[num_trips - 2].mode == TripMode::Bike;
@@ -99,15 +99,15 @@ fn add_lunch_trips(scenario: &mut Scenario, map: &Map, rng: &mut XorShiftRng, ti
9999
person.trips.push(IndividTrip::new(
100100
depart,
101101
TripPurpose::Meal,
102-
TripEndpoint::Bldg(work),
103-
TripEndpoint::Bldg(restaurant),
102+
TripEndpoint::Building(work),
103+
TripEndpoint::Building(restaurant),
104104
mode,
105105
));
106106
person.trips.push(IndividTrip::new(
107107
depart + Duration::minutes(30),
108108
TripPurpose::Work,
109-
TripEndpoint::Bldg(restaurant),
110-
TripEndpoint::Bldg(work),
109+
TripEndpoint::Building(restaurant),
110+
TripEndpoint::Building(work),
111111
mode,
112112
));
113113
person.trips.push(return_home);

game/src/debug/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ impl ContextualActions for Actions {
844844
))
845845
}
846846
(ID::Building(b), "route from here") => Transition::Push(
847-
routes::RouteExplorer::new_state(ctx, app, TripEndpoint::Bldg(b)),
847+
routes::RouteExplorer::new_state(ctx, app, TripEndpoint::Building(b)),
848848
),
849849
_ => unreachable!(),
850850
}

game/src/debug/routes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl State<App> for RouteExplorer {
130130
}
131131
if let Some(hovering) = match app.primary.current_selection {
132132
Some(ID::Intersection(i)) => Some(TripEndpoint::Border(i)),
133-
Some(ID::Building(b)) => Some(TripEndpoint::Bldg(b)),
133+
Some(ID::Building(b)) => Some(TripEndpoint::Building(b)),
134134
None => None,
135135
_ => unreachable!(),
136136
} {
@@ -169,7 +169,7 @@ impl State<App> for RouteExplorer {
169169
Color::BLUE.alpha(0.8),
170170
match self.start {
171171
TripEndpoint::Border(i) => app.primary.map.get_i(i).polygon.clone(),
172-
TripEndpoint::Bldg(b) => app.primary.map.get_b(b).polygon.clone(),
172+
TripEndpoint::Building(b) => app.primary.map.get_b(b).polygon.clone(),
173173
TripEndpoint::SuddenlyAppear(_) => unreachable!(),
174174
},
175175
);
@@ -178,7 +178,7 @@ impl State<App> for RouteExplorer {
178178
Color::GREEN.alpha(0.8),
179179
match endpt {
180180
TripEndpoint::Border(i) => app.primary.map.get_i(*i).polygon.clone(),
181-
TripEndpoint::Bldg(b) => app.primary.map.get_b(*b).polygon.clone(),
181+
TripEndpoint::Building(b) => app.primary.map.get_b(*b).polygon.clone(),
182182
TripEndpoint::SuddenlyAppear(_) => unreachable!(),
183183
},
184184
);

game/src/devtools/destinations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl PopularDestinations {
2121
let mut per_bldg = Counter::new();
2222
for p in &scenario.people {
2323
for trip in &p.trips {
24-
if let TripEndpoint::Bldg(b) = trip.destination {
24+
if let TripEndpoint::Building(b) = trip.destination {
2525
per_bldg.inc(b);
2626
}
2727
}

game/src/info/person.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ fn schedule_body(ctx: &mut EventCtx, app: &App, id: PersonID) -> Widget {
408408
for t in &person.trips {
409409
let trip = app.primary.sim.trip_info(*t);
410410
let at = match trip.start {
411-
TripEndpoint::Bldg(b) => {
411+
TripEndpoint::Building(b) => {
412412
let b = app.primary.map.get_b(b);
413413
if b.amenities.is_empty() {
414414
b.address.clone()
@@ -433,7 +433,7 @@ fn schedule_body(ctx: &mut EventCtx, app: &App, id: PersonID) -> Widget {
433433
// Where do they spend the night?
434434
let last_trip = app.primary.sim.trip_info(*person.trips.last().unwrap());
435435
let at = match last_trip.end {
436-
TripEndpoint::Bldg(b) => {
436+
TripEndpoint::Building(b) => {
437437
let b = app.primary.map.get_b(b);
438438
if b.amenities.is_empty() {
439439
b.address.clone()

game/src/info/trip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ fn make_elevation(
933933
// (ID, center, name)
934934
fn endpoint(endpt: &TripEndpoint, app: &App) -> (ID, Pt2D, String) {
935935
match endpt {
936-
TripEndpoint::Bldg(b) => {
936+
TripEndpoint::Building(b) => {
937937
let bldg = app.primary.map.get_b(*b);
938938
(ID::Building(*b), bldg.label_center, bldg.address.clone())
939939
}

game/src/sandbox/dashboards/commuter.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ impl CommuterPatterns {
8383
let mut trips_to_block: Vec<Vec<TripInfo>> = trips_from_block.clone();
8484
for (_, trip) in app.primary.sim.all_trip_info() {
8585
let block1 = match trip.start {
86-
TripEndpoint::Bldg(b) => bldg_to_block[&b],
86+
TripEndpoint::Building(b) => bldg_to_block[&b],
8787
TripEndpoint::Border(i) => border_to_block[&i],
8888
TripEndpoint::SuddenlyAppear(_) => continue,
8989
};
9090
let block2 = match trip.end {
91-
TripEndpoint::Bldg(b) => bldg_to_block[&b],
91+
TripEndpoint::Building(b) => bldg_to_block[&b],
9292
TripEndpoint::Border(i) => border_to_block[&i],
9393
TripEndpoint::SuddenlyAppear(_) => continue,
9494
};
@@ -147,7 +147,7 @@ impl CommuterPatterns {
147147
}
148148
if self.filter.from_block {
149149
match trip.end {
150-
TripEndpoint::Bldg(b) => {
150+
TripEndpoint::Building(b) => {
151151
count.inc(self.bldg_to_block[&b]);
152152
}
153153
TripEndpoint::Border(i) => {
@@ -159,7 +159,7 @@ impl CommuterPatterns {
159159
}
160160
} else {
161161
match trip.start {
162-
TripEndpoint::Bldg(b) => {
162+
TripEndpoint::Building(b) => {
163163
count.inc(self.bldg_to_block[&b]);
164164
}
165165
TripEndpoint::Border(i) => {

game/src/sandbox/dashboards/generic_trip_table.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ fn preview_route(g: &mut GfxCtx, app: &App, id: TripID, batch: &mut GeomBatch) {
8989
batch.append(map_gui::tools::start_marker(
9090
g,
9191
match trip.start {
92-
TripEndpoint::Bldg(b) => app.primary.map.get_b(b).label_center,
92+
TripEndpoint::Building(b) => app.primary.map.get_b(b).label_center,
9393
TripEndpoint::Border(i) => app.primary.map.get_i(i).polygon.center(),
9494
TripEndpoint::SuddenlyAppear(pos) => pos.pt(&app.primary.map),
9595
},
@@ -98,7 +98,7 @@ fn preview_route(g: &mut GfxCtx, app: &App, id: TripID, batch: &mut GeomBatch) {
9898
batch.append(map_gui::tools::goal_marker(
9999
g,
100100
match trip.end {
101-
TripEndpoint::Bldg(b) => app.primary.map.get_b(b).label_center,
101+
TripEndpoint::Building(b) => app.primary.map.get_b(b).label_center,
102102
TripEndpoint::Border(i) => app.primary.map.get_i(i).polygon.center(),
103103
TripEndpoint::SuddenlyAppear(pos) => pos.pt(&app.primary.map),
104104
},

game/src/sandbox/dashboards/mode_shift.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ fn produce_raw_data(ctx: &mut EventCtx, app: &App) -> Vec<Entry> {
130130
.into_iter()
131131
.filter_map(|(id, info)| {
132132
if info.mode == TripMode::Drive
133-
&& matches!(info.start, TripEndpoint::Bldg(_))
134-
&& matches!(info.end, TripEndpoint::Bldg(_))
133+
&& matches!(info.start, TripEndpoint::Building(_))
134+
&& matches!(info.end, TripEndpoint::Building(_))
135135
{
136136
Some((id, info))
137137
} else {

game/src/sandbox/gameplay/actdev.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ impl GameplayState for Actdev {
6969
.polygon;
7070

7171
for person in app.primary.sim.get_all_people() {
72-
if let TripEndpoint::Bldg(b) = app.primary.sim.trip_info(person.trips[0]).start
72+
if let TripEndpoint::Building(b) =
73+
app.primary.sim.trip_info(person.trips[0]).start
7374
{
7475
if study_area.contains_pt(app.primary.map.get_b(b).polygon.center()) {
7576
highlight.insert(person.id);

0 commit comments

Comments
 (0)