Trait BattleController

Source
pub trait BattleController<R: BattleRules> {
    // Required methods
    fn battle(&self) -> &Battle<R>;
    fn event_callback(&self) -> &Option<EventCallback<R>>;
    fn set_event_callback(&mut self, callback: Option<EventCallback<R>>);
}
Expand description

A trait for types that have control over a battle.

Required Methods§

Source

fn battle(&self) -> &Battle<R>

Returns a reference to the battle.

Source

fn event_callback(&self) -> &Option<EventCallback<R>>

Returns the current event callback set to the battle.

Source

fn set_event_callback(&mut self, callback: Option<EventCallback<R>>)

Sets a new event callback for the battle. The current callback is discarded.

Implementors§