Struct MonsGame

Source
pub struct MonsGame {
    pub board: Board,
    pub white_score: i32,
    pub black_score: i32,
    pub active_color: Color,
    pub actions_used_count: i32,
    pub mana_moves_count: i32,
    pub mons_moves_count: i32,
    pub white_potions_count: i32,
    pub black_potions_count: i32,
    pub turn_number: i32,
}

Fields§

§board: Board§white_score: i32§black_score: i32§active_color: Color§actions_used_count: i32§mana_moves_count: i32§mons_moves_count: i32§white_potions_count: i32§black_potions_count: i32§turn_number: i32

Implementations§

Source§

impl MonsGame

Source

pub fn from_fen(fen: &str) -> Option<Self>

Source§

impl MonsGame

Source

pub fn new() -> Self

Source

pub fn with_params( board: Board, white_score: i32, black_score: i32, active_color: Color, actions_used_count: i32, mana_moves_count: i32, mons_moves_count: i32, white_potions_count: i32, black_potions_count: i32, turn_number: i32, ) -> Self

Source

pub fn update_with(&mut self, other_game: &MonsGame)

Source

pub fn process_input( &mut self, input: Vec<Input>, do_not_apply_events: bool, one_option_enough: bool, ) -> Output

Source

pub fn apply_and_add_resulting_events( &mut self, events: Vec<Event>, ) -> Vec<Event>

Source

pub fn next_inputs<F>( &self, locations: Vec<Location>, kind: NextInputKind, only_one: bool, specific: Option<Location>, filter: F, ) -> Vec<NextInput>
where F: Fn(Location) -> bool,

Source

pub fn available_move_kinds(&self) -> HashMap<AvailableMoveKind, i32>

Source

pub fn winner_color(&self) -> Option<Color>

Source

pub fn is_later_than(&self, game: &MonsGame) -> bool

Source

pub fn is_first_turn(&self) -> bool

Source

pub fn player_potions_count(&self) -> i32

Source

pub fn player_can_move_mon(&self) -> bool

Source

pub fn player_can_move_mana(&self) -> bool

Source

pub fn player_can_use_action(&self) -> bool

Source

pub fn protected_by_opponents_angel(&self) -> HashSet<Location>

Trait Implementations§

Source§

impl Clone for MonsGame

Source§

fn clone(&self) -> MonsGame

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MonsGame

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FenRepresentable for MonsGame

Source§

fn fen(&self) -> String

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.