1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use crate::constants::*;
use crate::state::*;
pub struct LinearGame {
states: Vec<State>,
state_ptr: usize,
}
impl LinearGame {
pub fn new() -> LinearGame {
LinearGame {
states: vec![State::new(); MAX_STATES],
state_ptr: 0,
}
}
pub fn current(&self) -> &State {
&self.states[self.state_ptr]
}
pub fn pretty_print_string(&self) -> String {
self.current().pretty_print_string()
}
pub fn print(&self) {
println!("{}", self.pretty_print_string())
}
}