Struct gomoku::display::Console
[−]
[src]
pub struct Console {
board: GoBoard,
event: Mouse,
player: (Team, Player),
friend: (Team, Player),
layer: u32,
turn: u32,
win: bool,
help: bool,
help_decision: (u32, u32),
info: bool,
debug_map: bool,
}Fields
board | |
event | |
player | |
friend | |
layer | |
turn | |
win | |
help | |
help_decision | |
info | |
debug_map |
Methods
impl Console
fn new(board: GoBoard, layer: u32, (player, friend): (Player, Player), info: bool, debug_map: bool, help: bool) -> Self
The new constructor function returns the interface console.
fn get_size(&self) -> Size
The get_size function returns window size.
fn get_turn_is_ia(&self) -> bool
The get_turn_is_ia function returns a boolean if a IA must play.
fn set(&mut self, event: &Event, team: &mut Team) -> (u32, u32)
The set function updates the turn and set the human coordinate.
fn set_raw(&mut self, (x, y): (usize, usize), team: &mut Team) -> (u32, u32)
The set_raw function updates the turn and set the IA coordinate.
fn is_ia_versus(&self) -> bool
The is_ia_versus function returns a boolean if the player one
and two are typed like IA.
fn play(&mut self, event: &Event) -> Option<Tile>
The play function sets the board with the new tail coordinate.
fn help_optimal_move(&mut self) -> (u32, u32)
The help_optimal_move function returns the recommended coordinate to play.
fn input(&mut self, event: &Event, limit: u32)
The input function listens all mouse event like resize and click.
fn draw(&mut self, gl: &mut GlGraphics, event: &RenderArgs, limit: u32)
The draw function refreshs the window with a new board.
fn start(&mut self)
The start function loops the board.