pub enum Position {
Show 17 variants
N {
condition: ItemCondition,
targets: usize,
random: bool,
exact_n_targets: bool,
},
Any(ItemCondition),
All(ItemCondition),
OnSelf,
TriggerAffected(Option<Box<Position>>),
TriggerAfflicting(Option<Box<Position>>),
First,
Last,
Opposite,
Ahead,
Range(RangeInclusive<isize>),
Relative(isize),
Nearest(isize),
Multiple(Vec<Position>),
Adjacent,
FrontToBack(FrontToBackCondition),
None,
}Expand description
Positions to select pets by.
Variants§
N
Some number of Pets based on a given ItemCondition.
Note: These positions are non-overlapping.
Fields
§
condition: ItemConditionItemConditions to select pets by.
Any(ItemCondition)
Any Pet that matches a given ItemCondition.
All(ItemCondition)
All Pets that match a given ItemCondition.
OnSelf
Position of self.
TriggerAffected(Option<Box<Position>>)
Pet affected in Outcome trigger.
- Optional position relative to pet.
Same pet.
let curr_pet = saptest::Position::TriggerAffected(None);Two pets ahead of the trigger pet that are nearest.
let curr_pet = saptest::Position::TriggerAfflicting(Some(Box::new(saptest::Position::Nearest(2))));TriggerAfflicting(Option<Box<Position>>)
Pet causing in Outcome trigger.
- Optional position relative to pet.
Same pet.
let curr_pet = saptest::Position::TriggerAfflicting(None);Pet behind trigger pet.
let curr_pet = saptest::Position::TriggerAfflicting(Some(Box::new(saptest::Position::Relative(-1))));First
First pet on Team.
Last
Last pet on Team.
Opposite
Opposite team’s pet at the current pet index.
Ahead
All Pets ahead of current pet.
Range(RangeInclusive<isize>)
A specified range on a Team.
Relative(isize)
Nearest(isize)
Nearest pet(s) ahead or behind from current Pet.
- Negative values check pets behind.
- Positive values check pets ahead.
Multiple(Vec<Position>)
Multiple Positions.
Adjacent
All Pet’s adjacent to current index.
FrontToBack(FrontToBackCondition)
Select pets front-to-back based on a given condition.
None
No position.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Position
impl<'de> Deserialize<'de> for Position
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnsafeUnpin for Position
impl UnwindSafe for Position
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more