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