Construct an initial research state.
()
| 66 | impl ResearchInfo { |
| 67 | /// Construct an initial research state. |
| 68 | pub fn new() -> ResearchInfo { |
| 69 | let mut level = FnvHashMap::default(); |
| 70 | for unit in Branch::all() { |
| 71 | level.insert(unit.clone(), 0); |
| 72 | } |
| 73 | |
| 74 | ResearchInfo { |
| 75 | level: level.clone(), |
| 76 | maybe_level: level, |
| 77 | queue: vec![], |
| 78 | rounds_left: None, |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | /// Returns the current level of the research branch. |
| 83 | pub fn get_level(&self, branch: &Branch) -> Level { |