16040
|
1 |
#[derive(Clone)]
|
|
2 |
pub enum Direction {
|
|
3 |
Left,
|
16049
|
4 |
Right,
|
16040
|
5 |
}
|
|
6 |
#[derive(Clone)]
|
|
7 |
pub enum Action {
|
|
8 |
Walk(Direction),
|
|
9 |
LongJump,
|
16049
|
10 |
HighJump(usize),
|
16040
|
11 |
}
|
|
12 |
|
|
13 |
pub struct Actions {
|
16049
|
14 |
actions: Vec<Action>,
|
16040
|
15 |
}
|
|
16 |
|
|
17 |
impl Actions {
|
|
18 |
pub fn new() -> Self {
|
16049
|
19 |
Self { actions: vec![] }
|
16040
|
20 |
}
|
|
21 |
|
|
22 |
pub fn push(&mut self, action: Action) {
|
|
23 |
self.actions.push(action)
|
|
24 |
}
|
|
25 |
|
|
26 |
pub fn pop(&mut self) -> Option<Action> {
|
|
27 |
self.actions.pop()
|
|
28 |
}
|
16049
|
29 |
}
|