pub struct GameGrid {
pub game_options: GameOptions,
}Expand description
A representation of the game board.
The GameGrid struct is a representation of the game board. It encapsulates
the various values that are used to represent the game board, including the
Players Aleph and Beth, the four possible ways the two players can make
their choices, and the corresponding scores.
The GameGrid struct also contains the GameOptions struct, which contains
the various options that can be used to configure the game.
§Examples
use dilemma_tactix_lib::{
Choice,
GameGrid,
GameOptions,
};
let game_options = GameOptions::builder("customized").build();
let game_grid = GameGrid::new(game_options);
game_grid.show_grid();Fields§
§game_options: GameOptionsImplementations§
Source§impl GameGrid
impl GameGrid
Sourcepub const fn new(game_options: GameOptions) -> Self
pub const fn new(game_options: GameOptions) -> Self
Sourcepub fn show_grid(&self)
pub fn show_grid(&self)
Sourcepub const fn return_score(
&self,
aleph_choice: Choice,
beth_choice: Choice,
) -> NumberPair
pub const fn return_score( &self, aleph_choice: Choice, beth_choice: Choice, ) -> NumberPair
Return the score for the given choices.
§Arguments
aleph_choice- The choice made by Player 1.beth_choice- The choice made by Player 2.
§Examples
use dilemma_tactix_lib::{
Choice,
GameGrid,
GameOptions,
};
let game_options = GameOptions::builder("customized").build();
let game_grid = GameGrid::new(game_options);
let result = game_grid.return_score(Choice::Atlantis, Choice::Atlantis);§Returns
A NumberPair containing the scores for the given choices.
§See Also
Trait Implementations§
impl Copy for GameGrid
impl Eq for GameGrid
impl StructuralPartialEq for GameGrid
Auto Trait Implementations§
impl Freeze for GameGrid
impl RefUnwindSafe for GameGrid
impl Send for GameGrid
impl Sync for GameGrid
impl Unpin for GameGrid
impl UnwindSafe for GameGrid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more