Refactor codebase into submodules
This commit is contained in:
22
src/smush_rules.rs
Normal file
22
src/smush_rules.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
// Rules get parsed from file, converted into matrix format (for the in-memory movement),
|
||||
// then combined (smushed) into a single matrix + vector/rule for each . The list of units can then have the rules applied
|
||||
//
|
||||
// For now just ignore the all from/to stuff, it's kind of a shit thing to do, and can
|
||||
// be worked around by actually inputting every type into the rules
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::MovementRule;
|
||||
|
||||
pub fn smush_rules(rules: Vec<MovementRule>) -> Vec<MovementRule> {
|
||||
let ruleMapping: HashMap<String, usize> = HashMap::new();
|
||||
// First build out the list/map of all departments (store index of each element in the array)
|
||||
// TODO: We could make this more advanced by only smushing per divider, so that only the departments
|
||||
// needed between each pass is actually required
|
||||
for rule in rules {
|
||||
for department in rule.from_departments {
|
||||
// ruleMapping.entry(department).or_insert(ruleMapping.len());
|
||||
}
|
||||
}
|
||||
vec![]
|
||||
}
|
||||
Reference in New Issue
Block a user