[][src]Struct cellwars::WorldState

pub struct WorldState { /* fields omitted */ }

The state of the game's world.

Implementations

impl WorldState[src]

pub fn width(&self) -> u32[src]

The width of the world, in number of squares.

pub fn height(&self) -> u32[src]

The height of the world, in number of squares.

pub fn my_team_id(&self) -> u32[src]

The identifier of your bot's team. Use this to differentiate between your cells and your enemy's.

pub fn my_starting_column(&self) -> u32[src]

The index of the column in which your cells spawn. This will typically be either 0 or width - 1.

pub fn enemy_starting_column(&self) -> u32[src]

The index of the column in which your enemy's cells spawn. This will typically be either 0 or width - 1.

pub fn my_cells(&self) -> Vec<&Cell>[src]

Gets all of the cells you currently control

pub fn enemy_cells(&self) -> Vec<&Cell>[src]

Gets all of the cells the enemy currently controls

Trait Implementations

impl Default for WorldState[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.