summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin Worthe <justin.worthe@gmail.com>2017-05-14 17:10:26 +0200
committerJustin Worthe <justin.worthe@gmail.com>2017-05-14 17:10:26 +0200
commit25a551316e27f4cc52c160d099db9cc3673b3421 (patch)
treeac36584ec047dfefe54fcc56bb189a05c02b98f5 /src
parent05ccf5572b39fe254c7b0464cc78a1b623f732c7 (diff)
Added documentation of json state types
Diffstat (limited to 'src')
-rw-r--r--src/files.rs3
-rw-r--r--src/lib.rs2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/files.rs b/src/files.rs
index 99dca8c..7f3daed 100644
--- a/src/files.rs
+++ b/src/files.rs
@@ -5,9 +5,10 @@ use std::path::PathBuf;
use actions::*;
+const STATE_FILE: &'static str = "state.json";
+
const COMMAND_FILE: &'static str = "command.txt";
const PLACE_FILE: &'static str = "place.txt";
-const STATE_FILE: &'static str = "state.json";
pub fn read_file(working_dir: &PathBuf) -> Result<json::JsonValue, String> {
let state_path = working_dir.join(STATE_FILE);
diff --git a/src/lib.rs b/src/lib.rs
index fab9e36..5dda02f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -21,7 +21,7 @@ use std::path::PathBuf;
pub fn write_move(working_dir: PathBuf) -> Result<(), String> {
let state_json = read_file(&working_dir)?;
- println!("{}", state_json);
+ println!("\n\n{}\n\n", state_json.pretty(2));
let is_place_phase = state_json["Phase"] == 1;
let map_size = State::map_size_from_json(&state_json)?;