pub struct BoostStatsAccumulator { /* private fields */ }Expand description
Accumulates BoostStats from typed boost transitions.
This replaces the former label-dispatched ledger projection: callers invoke the typed
apply_* methods directly (from the boost calculator) instead of constructing string-labeled
ledger events and re-parsing them here. The per-player and per-team arithmetic is identical;
only the representation changed. labeled_amounts/labeled_counts are still populated so the
exported labeled boost stats stay populated, now built from the clean pickup model.
Implementations§
Source§impl BoostStatsAccumulator
impl BoostStatsAccumulator
pub fn new() -> Self
pub fn player_stats(&self) -> &HashMap<PlayerId, BoostStats>
pub fn player_stats_for(&self, player_id: &PlayerId) -> BoostStats
pub fn team_zero_stats(&self) -> &BoostStats
pub fn team_one_stats(&self) -> &BoostStats
Sourcepub fn apply_pickup(
&mut self,
player_id: &PlayerId,
is_team_0: bool,
pad_size: Option<BoostPadSize>,
activity: BoostPickupActivity,
field_half: BoostPickupFieldHalf,
is_steal: bool,
collected_amount: f32,
overfill_amount: f32,
)
pub fn apply_pickup( &mut self, player_id: &PlayerId, is_team_0: bool, pad_size: Option<BoostPadSize>, activity: BoostPickupActivity, field_half: BoostPickupFieldHalf, is_steal: bool, collected_amount: f32, overfill_amount: f32, )
Record a single boost pickup, folding the former Collected/Stolen/Overfill ledger
transactions into one transition. collected_amount is the full boost gained; the
per-pickup totals here sum identically to the old split ledger entries.
Sourcepub fn apply_respawn(
&mut self,
player_id: &PlayerId,
is_team_0: bool,
amount: f32,
)
pub fn apply_respawn( &mut self, player_id: &PlayerId, is_team_0: bool, amount: f32, )
Record a respawn boost grant (kickoff or demo respawn).
Sourcepub fn apply_used(&mut self, player_id: &PlayerId, is_team_0: bool, amount: f32)
pub fn apply_used(&mut self, player_id: &PlayerId, is_team_0: bool, amount: f32)
Record cumulative boost usage for a frame (total drained).
Trait Implementations§
Source§impl Clone for BoostStatsAccumulator
impl Clone for BoostStatsAccumulator
Source§fn clone(&self) -> BoostStatsAccumulator
fn clone(&self) -> BoostStatsAccumulator
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BoostStatsAccumulator
impl Debug for BoostStatsAccumulator
Source§impl Default for BoostStatsAccumulator
impl Default for BoostStatsAccumulator
Source§fn default() -> BoostStatsAccumulator
fn default() -> BoostStatsAccumulator
Source§impl PartialEq for BoostStatsAccumulator
impl PartialEq for BoostStatsAccumulator
Source§fn eq(&self, other: &BoostStatsAccumulator) -> bool
fn eq(&self, other: &BoostStatsAccumulator) -> bool
self and other values to be equal, and is used by ==.