pub enum BattleAction<P: BattleProvider + ?Sized> {
Fight {
move_: P::Move,
},
Switch {
to_slot: usize,
},
UseItem {
item: P::Item,
},
Run,
Nothing,
}Expand description
The action a battler has chosen to take this turn.
Generic over the provider so the concrete move/item identifiers stay
game-defined. Catch/Run resolution is game-specific: a game models them as
UseItem/Run and decides the BattleEnd outcome
inside its hooks.
Variants§
Fight
Use a move against the implied target (the opposing lead in 1v1).
Switch
Switch the active battler to another party slot on the same side.
UseItem
Use an item (potions, status cures, capture devices, …).
Run
Attempt to flee the battle.
Nothing
Do nothing this turn (e.g. recharging, forced inaction handled upstream).
Trait Implementations§
Source§impl<P: BattleProvider + ?Sized> Clone for BattleAction<P>
impl<P: BattleProvider + ?Sized> Clone for BattleAction<P>
Auto Trait Implementations§
impl<P> Freeze for BattleAction<P>
impl<P> RefUnwindSafe for BattleAction<P>where
<P as BattleProvider>::Move: RefUnwindSafe,
<P as BattleProvider>::Item: RefUnwindSafe,
P: ?Sized,
impl<P> Send for BattleAction<P>
impl<P> Sync for BattleAction<P>
impl<P> Unpin for BattleAction<P>
impl<P> UnsafeUnpin for BattleAction<P>where
<P as BattleProvider>::Move: UnsafeUnpin,
<P as BattleProvider>::Item: UnsafeUnpin,
P: ?Sized,
impl<P> UnwindSafe for BattleAction<P>
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