pub struct PlayerEffectContext<'effect, 'context, 'battle, 'data>where
'data: 'battle,
'battle: 'context,
'context: 'effect,{ /* private fields */ }Expand description
Implementations§
Source§impl<'effect, 'context, 'battle, 'data> PlayerEffectContext<'effect, 'context, 'battle, 'data>
impl<'effect, 'context, 'battle, 'data> PlayerEffectContext<'effect, 'context, 'battle, 'data>
Sourcepub fn as_battle_context<'side_effect>(
&'side_effect self,
) -> &'side_effect Context<'battle, 'data>
pub fn as_battle_context<'side_effect>( &'side_effect self, ) -> &'side_effect Context<'battle, 'data>
Returns a reference to the inner Context.
Sourcepub fn as_battle_context_mut<'side_effect>(
&'side_effect mut self,
) -> &'side_effect mut Context<'battle, 'data>
pub fn as_battle_context_mut<'side_effect>( &'side_effect mut self, ) -> &'side_effect mut Context<'battle, 'data>
Returns a mutable reference to the inner Context.
Sourcepub fn as_effect_context<'side_effect>(
&'side_effect self,
) -> &'side_effect EffectContext<'context, 'battle, 'data>
pub fn as_effect_context<'side_effect>( &'side_effect self, ) -> &'side_effect EffectContext<'context, 'battle, 'data>
Returns a reference to the inner EffectContext.
Sourcepub fn as_effect_context_mut<'side_effect>(
&'side_effect mut self,
) -> &'side_effect mut EffectContext<'context, 'battle, 'data>
pub fn as_effect_context_mut<'side_effect>( &'side_effect mut self, ) -> &'side_effect mut EffectContext<'context, 'battle, 'data>
Returns a mutable reference to the inner EffectContext.
Sourcepub fn source_context<'applying_effect>(
&'applying_effect mut self,
) -> Result<Option<MonContext<'applying_effect, 'applying_effect, 'applying_effect, 'battle, 'data>>>
pub fn source_context<'applying_effect>( &'applying_effect mut self, ) -> Result<Option<MonContext<'applying_effect, 'applying_effect, 'applying_effect, 'battle, 'data>>>
Creates a new MonContext for the effect source, scoped to the lifetime of this context.
Sourcepub fn forward_player_effect_context<'side_effect>(
&'side_effect mut self,
effect_handle: EffectHandle,
) -> Result<PlayerEffectContext<'side_effect, 'side_effect, 'battle, 'data>>
pub fn forward_player_effect_context<'side_effect>( &'side_effect mut self, effect_handle: EffectHandle, ) -> Result<PlayerEffectContext<'side_effect, 'side_effect, 'battle, 'data>>
Creates a new SideEffectContext for the same target side but different effect,
using this effect as its source, scoped to the lifetime of this context.
Sourcepub fn source_side_effect_context<'side_effect>(
&'side_effect mut self,
) -> Result<Option<SideEffectContext<'side_effect, 'side_effect, 'battle, 'data>>>
pub fn source_side_effect_context<'side_effect>( &'side_effect mut self, ) -> Result<Option<SideEffectContext<'side_effect, 'side_effect, 'battle, 'data>>>
Creates a new SideEffectContext for the source effect with the same target side, scoped
to the lifetime of this context.
Sourcepub fn battle(&self) -> &CoreBattle<'data>
pub fn battle(&self) -> &CoreBattle<'data>
Returns a reference to the CoreBattle.
Sourcepub fn battle_mut(&mut self) -> &mut CoreBattle<'data>
pub fn battle_mut(&mut self) -> &mut CoreBattle<'data>
Returns a mutable reference to the CoreBattle.
Sourcepub fn effect_handle(&self) -> &EffectHandle
pub fn effect_handle(&self) -> &EffectHandle
Returns the EffectHandle for the Effect.
Sourcepub fn effect_mut(&mut self) -> &mut Effect<'context>
pub fn effect_mut(&mut self) -> &mut Effect<'context>
Returns a mutable reference to the Effect.
Sourcepub fn source_effect_handle(&self) -> Option<&EffectHandle>
pub fn source_effect_handle(&self) -> Option<&EffectHandle>
Returns a reference to the source EffectHandle, if it exists.
Sourcepub fn player_mut(&mut self) -> &mut Player
pub fn player_mut(&mut self) -> &mut Player
Returns a mutable reference to the target Player.
Sourcepub fn source_handle(&self) -> Option<MonHandle>
pub fn source_handle(&self) -> Option<MonHandle>
Sourcepub fn has_source(&self) -> bool
pub fn has_source(&self) -> bool
Checks if the effect has a source Mon.
Sourcepub fn source_mut(&mut self) -> Option<&mut Mon>
pub fn source_mut(&mut self) -> Option<&mut Mon>
Returns a mutable reference to the source Mon, if one exists.
Auto Trait Implementations§
impl<'effect, 'context, 'battle, 'data> !Freeze for PlayerEffectContext<'effect, 'context, 'battle, 'data>
impl<'effect, 'context, 'battle, 'data> !RefUnwindSafe for PlayerEffectContext<'effect, 'context, 'battle, 'data>
impl<'effect, 'context, 'battle, 'data> !Send for PlayerEffectContext<'effect, 'context, 'battle, 'data>
impl<'effect, 'context, 'battle, 'data> !Sync for PlayerEffectContext<'effect, 'context, 'battle, 'data>
impl<'effect, 'context, 'battle, 'data> Unpin for PlayerEffectContext<'effect, 'context, 'battle, 'data>
impl<'effect, 'context, 'battle, 'data> !UnwindSafe for PlayerEffectContext<'effect, 'context, 'battle, 'data>
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
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>
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>
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