pub struct CardDamageMap { /* private fields */ }Implementations§
Source§impl CardDamageMap
impl CardDamageMap
Sourcepub fn put(&mut self, source: CardId, target: DamageTarget, amount: i32) -> i32
pub fn put(&mut self, source: CardId, target: DamageTarget, amount: i32) -> i32
Java parity: sum damage when the same source-target pair is inserted repeatedly.
pub fn total_amount(&self) -> i32
pub fn entries(&self) -> Vec<(CardId, DamageTarget, i32)>
Sourcepub fn filtered_map(
&self,
game: &GameState,
valid_source: Option<&str>,
valid_target: Option<&str>,
host: CardId,
) -> CardDamageMap
pub fn filtered_map( &self, game: &GameState, valid_source: Option<&str>, valid_target: Option<&str>, host: CardId, ) -> CardDamageMap
Java parity subset of filteredMap.
pub fn trigger_prevent_damage( &self, trigger_handler: &mut TriggerHandler, is_combat: bool, )
pub fn trigger_damage_done_once( &self, game: &GameState, trigger_handler: &mut TriggerHandler, is_combat: bool, )
Sourcepub fn trigger_excess_damage(
&self,
game: &GameState,
trigger_handler: &mut TriggerHandler,
is_combat: bool,
lethal_damage: &HashMap<CardId, i32>,
_cause: Option<&mut SpellAbility>,
)
pub fn trigger_excess_damage( &self, game: &GameState, trigger_handler: &mut TriggerHandler, is_combat: bool, lethal_damage: &HashMap<CardId, i32>, _cause: Option<&mut SpellAbility>, )
Java parity subset of excess-damage trigger aggregation.
Trait Implementations§
Source§impl Clone for CardDamageMap
impl Clone for CardDamageMap
Source§fn clone(&self) -> CardDamageMap
fn clone(&self) -> CardDamageMap
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CardDamageMap
impl Debug for CardDamageMap
Source§impl Default for CardDamageMap
impl Default for CardDamageMap
Source§fn default() -> CardDamageMap
fn default() -> CardDamageMap
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CardDamageMap
impl<'de> Deserialize<'de> for CardDamageMap
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
Source§impl From<CardDamageMap> for AbilityValue
impl From<CardDamageMap> for AbilityValue
Source§fn from(value: CardDamageMap) -> Self
fn from(value: CardDamageMap) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CardDamageMap
impl RefUnwindSafe for CardDamageMap
impl Send for CardDamageMap
impl Sync for CardDamageMap
impl Unpin for CardDamageMap
impl UnsafeUnpin for CardDamageMap
impl UnwindSafe for CardDamageMap
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.