some refactoring
This commit is contained in:
parent
522a92f864
commit
88092f1456
1 changed files with 3 additions and 7 deletions
10
src/main.rs
10
src/main.rs
|
@ -92,7 +92,7 @@ fn main() {
|
||||||
Ok(loaded_idkeys) => {
|
Ok(loaded_idkeys) => {
|
||||||
match load_shinystats(executable_path) {
|
match load_shinystats(executable_path) {
|
||||||
Ok(loaded_shinystats) => {
|
Ok(loaded_shinystats) => {
|
||||||
if let Err(e) = cook_0(debug_mode, loaded_config, loaded_idkeys, loaded_shinystats) {
|
if let Err(e) = cook(debug_mode, loaded_config, loaded_idkeys, loaded_shinystats) {
|
||||||
println!("{}", e);
|
println!("{}", e);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -106,11 +106,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 0: Gear
|
fn cook(mut debug_mode: bool, json_config: Jsonconfig, idsmap: HashMap<String, u8>, json_shiny: Vec<Shinystruct>) -> Result<(), Errorfr> {
|
||||||
fn cook_0(mut debug_mode: bool, json_config: Jsonconfig, idsmap: HashMap<String, u8>, json_shiny: Vec<Shinystruct>) -> Result<(), Errorfr> {
|
|
||||||
// load configs
|
|
||||||
// println!("{:?}",idsmap.get("airDamage"));
|
|
||||||
|
|
||||||
// create necessary variables
|
// create necessary variables
|
||||||
let mut out = Vec::new();
|
let mut out = Vec::new();
|
||||||
let ver = TransformVersion::Version1;
|
let ver = TransformVersion::Version1;
|
||||||
|
@ -128,7 +124,7 @@ fn cook_0(mut debug_mode: bool, json_config: Jsonconfig, idsmap: HashMap<String,
|
||||||
.encode(ver, &mut out)
|
.encode(ver, &mut out)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
// json identification data handling
|
// json identification data handling for type GEAR (0)
|
||||||
let mut idvec = Vec::new();
|
let mut idvec = Vec::new();
|
||||||
for eachid in json_config.ids {
|
for eachid in json_config.ids {
|
||||||
let id_id = idsmap.get(eachid.id.trim());
|
let id_id = idsmap.get(eachid.id.trim());
|
||||||
|
|
Loading…
Reference in a new issue