equal
deleted
inserted
replaced
16 fn save(&self, file: String) -> io::Result<()> { |
16 fn save(&self, file: String) -> io::Result<()> { |
17 Ok(unimplemented!()) |
17 Ok(unimplemented!()) |
18 } |
18 } |
19 |
19 |
20 fn load(file: String) -> io::Result<Self> { |
20 fn load(file: String) -> io::Result<Self> { |
|
21 let value = super::haskell::parse(&[]); |
21 Ok(unimplemented!()) |
22 Ok(unimplemented!()) |
22 } |
23 } |
23 |
24 |
24 fn load_hwd(file: String) -> io::Result<Self> { |
25 fn load_hwd(file: String) -> io::Result<Self> { |
25 let datum = fs::File::open(file)?; |
26 let datum = fs::File::open(file)?; |
58 fn get_script_name(arg: &str) -> io::Result<String> { |
59 fn get_script_name(arg: &str) -> io::Result<String> { |
59 const PREFIX: &str = "Scripts/Multiplayer/"; |
60 const PREFIX: &str = "Scripts/Multiplayer/"; |
60 const SUFFIX: &str = ".lua"; |
61 const SUFFIX: &str = ".lua"; |
61 if arg.starts_with(PREFIX) && arg.ends_with(SUFFIX) { |
62 if arg.starts_with(PREFIX) && arg.ends_with(SUFFIX) { |
62 let script = arg[PREFIX.len()..arg.len() - SUFFIX.len()].to_string(); |
63 let script = arg[PREFIX.len()..arg.len() - SUFFIX.len()].to_string(); |
63 script.replace('_', " "); |
64 Ok(script.replace('_', " ")) |
64 Ok(script) |
|
65 } else { |
65 } else { |
66 error("Script is not multiplayer") |
66 error("Script is not multiplayer") |
67 } |
67 } |
68 } |
68 } |
69 |
69 |