/// Performs grid movement according to the current program state.
Performs grid movement according to the current program state.
Performs grid movement according to the current program state .
fn movement(&mut self, direction: Direction) {
        if self.game.is_player_placing_ship() && self.game.move_ship(direction).is_err() {
            // TODO: more specific error checking.
        }
        if self.game.is_player_selecting_space()
            && self.turn_active
            && self.game.move_grid_cursor(direction).is_err()
        {
            // TODO: might be good to have some visual effect.
        }
    }
fn movement ( & mut self , direction : Direction ) { if self . game . is_player_placing_ship ( ) && self . game . move_ship ( direction ) . is_err ( ) { // TODO: more specific error checking. } if self . game . is_player_selecting_space ( ) && self . turn_active && self . game . move_grid_cursor ( direction ) . is_err ( ) { // TODO: might be good to have some visual effect. } }
Performs grid movement according to the current program state.
Performs grid movement according to the current program state .
&mut self
direction
Direction