pub struct Battle<ID: Debug + Display + Clone + Ord + Hash + 'static, T: Clone> { /* private fields */ }Expand description
A battle host.
Implementations§
Source§impl<ID: Debug + Display + Clone + Ord + Hash + 'static, T: Clone> Battle<ID, T>
impl<ID: Debug + Display + Clone + Ord + Hash + 'static, T: Clone> Battle<ID, T>
pub fn new<R: Rng>( data: BattleData, random: &mut R, active: usize, pokedex: &Dex<Pokemon>, movedex: &Dex<Move>, itemdex: &Dex<Item>, players: impl Iterator<Item = PlayerData<ID, T>>, ) -> Self
pub fn begin(&mut self)
pub fn end(&mut self, winner: Option<ID>)
pub fn update<R: Rng + Clone + 'static, E: BattleEngine>( &mut self, random: &mut R, engine: &E, movedex: &Dex<Move>, itemdex: &Dex<Item>, )
pub fn remove(&mut self, id: &ID, reason: EndMessage)
pub fn faint(&mut self, pokemon: PokemonIdentifier<ID>)
pub fn finished(&self) -> bool
pub fn data(&self) -> &BattleData
pub fn winner(&self) -> Option<&ID>
Auto Trait Implementations§
impl<ID, T> Freeze for Battle<ID, T>where
ID: Freeze,
impl<ID, T> !RefUnwindSafe for Battle<ID, T>
impl<ID, T> !Send for Battle<ID, T>
impl<ID, T> !Sync for Battle<ID, T>
impl<ID, T> Unpin for Battle<ID, T>
impl<ID, T> !UnwindSafe for Battle<ID, T>
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