mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-01 02:33:54 +03:00
oops, nonsense option to start moving cars
This commit is contained in:
parent
ebebce179a
commit
41817d3e91
@ -2,7 +2,7 @@ use abstutil::elapsed_seconds;
|
||||
use ezgui::{Canvas, EventLoopMode, GfxCtx, Text, UserInput, TOP_RIGHT};
|
||||
use objects::{ID, SIM};
|
||||
use piston::input::Key;
|
||||
use sim::{Benchmark, ScoreSummary, TIMESTEP};
|
||||
use sim::{Benchmark, CarState, ScoreSummary, TIMESTEP};
|
||||
use std::mem;
|
||||
use std::time::{Duration, Instant};
|
||||
use ui::PerMapUI;
|
||||
@ -105,7 +105,9 @@ impl SimController {
|
||||
}
|
||||
match primary.current_selection {
|
||||
Some(ID::Car(id)) => {
|
||||
if input.key_pressed(Key::A, "start this parked car") {
|
||||
if primary.sim.get_car_state(id) == CarState::Parked
|
||||
&& input.key_pressed(Key::A, "start this parked car")
|
||||
{
|
||||
primary.sim.start_parked_car(&primary.map, id);
|
||||
}
|
||||
}
|
||||
|
@ -253,6 +253,7 @@ fn time_parsing() {
|
||||
assert_eq!(Tick::parse("01:02:03.5"), Some(Tick(35 + 1200 + 36000)));
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq)]
|
||||
pub enum CarState {
|
||||
Moving,
|
||||
Stuck,
|
||||
|
Loading…
Reference in New Issue
Block a user