pub struct BreakdownAccumulator { /* private fields */ }Expand description
Per-fight totals, keyed by the fight INSTANCE so a delayed event that outlives its fight cannot land in the next one.
Implementations§
Source§impl BreakdownAccumulator
impl BreakdownAccumulator
pub fn new(fight_instance_id: Uuid, fight_id: FightTemplateId) -> Self
pub fn fight_instance_id(&self) -> Uuid
Sourcepub fn record(
&mut self,
actor: BreakdownActor,
source: CombatSource,
damage: u64,
heal: u64,
crit: bool,
)
pub fn record( &mut self, actor: BreakdownActor, source: CombatSource, damage: u64, heal: u64, crit: bool, )
Add one applied amount. damage and heal are what the HP actually
moved by, so a fully absorbed hit or a fully wasted overheal records
nothing at all.
Sourcepub fn finish(&self, is_win: bool, duration_ticks: u64) -> FightBreakdown
pub fn finish(&self, is_win: bool, duration_ticks: u64) -> FightBreakdown
The retrievable summary. Takes the two facts only the fight boundary knows.
Trait Implementations§
Source§impl Clone for BreakdownAccumulator
impl Clone for BreakdownAccumulator
Source§fn clone(&self) -> BreakdownAccumulator
fn clone(&self) -> BreakdownAccumulator
Returns a copy of the value. Read more
1.0.0 · 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 BreakdownAccumulator
impl Debug for BreakdownAccumulator
Source§impl PartialEq for BreakdownAccumulator
impl PartialEq for BreakdownAccumulator
impl Eq for BreakdownAccumulator
impl StructuralPartialEq for BreakdownAccumulator
Auto Trait Implementations§
impl Freeze for BreakdownAccumulator
impl RefUnwindSafe for BreakdownAccumulator
impl Send for BreakdownAccumulator
impl Sync for BreakdownAccumulator
impl Unpin for BreakdownAccumulator
impl UnwindSafe for BreakdownAccumulator
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more