rust/lib-hwengine-future/src/ai/action.rs
author alfadur
Sat, 22 Feb 2025 19:39:31 +0300
changeset 16120 5febd2bc5372
parent 16078 db18f1a30b0c
permissions -rw-r--r--
Add server reconnection tokens and anteroom local list of used nicks

#[derive(Clone)]
pub enum Direction {
    Left,
    Right,
}
#[derive(Clone)]
pub enum Action {
    Walk(Direction),
    LongJump,
    HighJump(usize),
}

pub struct Actions {
    actions: Vec<Action>,
}

impl Actions {
    pub fn new() -> Self {
        Self { actions: vec![] }
    }

    pub fn push(&mut self, action: Action) {
        self.actions.push(action)
    }

    pub fn pop(&mut self) -> Option<Action> {
        self.actions.pop()
    }
}