Added reduced time flag
[entelect-challenge-tower-defence.git] / src / main.rs
index 651df35..6434c9d 100644 (file)
@@ -16,7 +16,9 @@ use std::io::prelude::*;
 use std::process;
 
 fn choose_move(settings: &engine::settings::GameSettings, state: &engine::GameState, start_time: &PreciseTime) -> Command {
-    let max_time = Duration::milliseconds(1950);
+    #[cfg(not(feature = "reduced-time"))] let max_time = Duration::milliseconds(1950);
+    #[cfg(feature = "reduced-time")] let max_time = Duration::milliseconds(950);
+    
     strategy::monte_carlo::choose_move(settings, state, start_time, max_time)
 }
 
@@ -32,7 +34,7 @@ fn main() {
     let start_time = PreciseTime::now();
     
     println!("Reading in state.json file");
-    let (settings, state) = match json::read_state_from_file(STATE_PATH) {
+    let (settings, state) = match input::json::read_state_from_file(STATE_PATH) {
         Ok(ok) => ok,
         Err(error) => {
             println!("Error while parsing JSON file: {}", error);