rust/lib-hwengine-future/src/ai/action.rs
branchtransitional_engine
changeset 16040 6c5b3c576fc6
equal deleted inserted replaced
16039:a236360669cc 16040:6c5b3c576fc6
       
     1 #[derive(Clone)]
       
     2 pub enum Direction {
       
     3     Left,
       
     4     Right
       
     5 }
       
     6 #[derive(Clone)]
       
     7 pub enum Action {
       
     8     Walk(Direction),
       
     9     LongJump,
       
    10     HighJump(usize)
       
    11 }
       
    12 
       
    13 pub struct Actions {
       
    14     actions: Vec<Action>
       
    15 }
       
    16 
       
    17 impl Actions {
       
    18     pub fn new() -> Self {
       
    19         Self {
       
    20             actions: vec![],
       
    21         }
       
    22     }
       
    23 
       
    24     pub fn push(&mut self, action: Action) {
       
    25         self.actions.push(action)
       
    26     }
       
    27 
       
    28     pub fn pop(&mut self) -> Option<Action> {
       
    29         self.actions.pop()
       
    30     }
       
    31 }