Side

Struct Side 

Source
pub struct Side {
Show 23 fields pub active_index: PokemonIndex, pub baton_passing: bool, pub shed_tailing: bool, pub pokemon: SidePokemon, pub side_conditions: SideConditions, pub volatile_status_durations: VolatileStatusDurations, pub wish: (i8, i16), pub future_sight: (i8, PokemonIndex), pub force_switch: bool, pub force_trapped: bool, pub slow_uturn_move: bool, pub volatile_statuses: HashSet<PokemonVolatileStatus>, pub substitute_health: i16, pub attack_boost: i8, pub defense_boost: i8, pub special_attack_boost: i8, pub special_defense_boost: i8, pub speed_boost: i8, pub accuracy_boost: i8, pub evasion_boost: i8, pub last_used_move: LastUsedMove, pub damage_dealt: DamageDealt, pub switch_out_move_second_saved_move: Choices,
}

Fields§

§active_index: PokemonIndex§baton_passing: bool§shed_tailing: bool§pokemon: SidePokemon§side_conditions: SideConditions§volatile_status_durations: VolatileStatusDurations§wish: (i8, i16)§future_sight: (i8, PokemonIndex)§force_switch: bool§force_trapped: bool§slow_uturn_move: bool§volatile_statuses: HashSet<PokemonVolatileStatus>§substitute_health: i16§attack_boost: i8§defense_boost: i8§special_attack_boost: i8§special_defense_boost: i8§speed_boost: i8§accuracy_boost: i8§evasion_boost: i8§last_used_move: LastUsedMove§damage_dealt: DamageDealt§switch_out_move_second_saved_move: Choices

Implementations§

Source§

impl Side

Source

pub fn reset_negative_boosts( &mut self, side_ref: SideReference, instructions: &mut StateInstructions, ) -> bool

Source

pub fn active_is_charging_move(&self) -> Option<PokemonMoveIndex>

Source

pub fn calculate_highest_stat(&self) -> PokemonBoostableStat

Source

pub fn get_boost_from_boost_enum(&self, boost_enum: &PokemonBoostableStat) -> i8

Source

pub fn calculate_boosted_stat(&self, stat: PokemonBoostableStat) -> i16

Source

pub fn has_alive_non_rested_sleeping_pkmn(&self) -> bool

Source

pub fn can_use_tera(&self) -> bool

Source

pub fn add_switches(&self, vec: &mut Vec<MoveChoice>)

Source

pub fn trapped(&self, opponent_active: &Pokemon) -> bool

Source

pub fn num_fainted_pkmn(&self) -> i8

Source§

impl Side

Source

pub fn pprint(&self, available_choices: Vec<String>) -> String

Source

pub fn serialize(&self) -> String

Source

pub fn deserialize(serialized: &str) -> Side

Source§

impl Side

Source

pub fn visible_alive_pkmn(&self) -> i8

Source

pub fn get_active(&mut self) -> &mut Pokemon

Source

pub fn get_active_immutable(&self) -> &Pokemon

Source

pub fn get_side_condition(&self, side_condition: PokemonSideCondition) -> i8

Source

pub fn update_side_condition( &mut self, side_condition: PokemonSideCondition, amount: i8, )

Source

pub fn get_alive_pkmn_indices(&self) -> Vec<PokemonIndex>

Trait Implementations§

Source§

impl Clone for Side

Source§

fn clone(&self) -> Side

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 Side

Source§

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

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

impl Default for Side

Source§

fn default() -> Side

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Side

§

impl RefUnwindSafe for Side

§

impl Send for Side

§

impl Sync for Side

§

impl Unpin for Side

§

impl UnwindSafe for Side

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V