Class CombatLedger

Namespace
SurvivorsMaker.Presentation
Assembly
SurvivorsMaker.Presentation.dll

Everything the run summary and the DPS meter show, collected while a run plays. Fed by CombatTap (exact weapon attribution) and by the tick's events (Observe(in SimEvent, IReadOnlyList<string>, Func<int, string>)). Without a tap, damage comes from events alone: weapon hits by slot, everything else unsourced.

public sealed class CombatLedger
Inheritance
CombatLedger
Inherited Members

Constructors

CombatLedger(float)

public CombatLedger(float dpsWindowSeconds = 5)

Parameters

dpsWindowSeconds float

Fields

UnsourcedSlot

Slot used for damage no weapon caused (triggers, unattributed effects).

public const int UnsourcedSlot = -1

Field Value

int

Properties

Attributed

True while a CombatTap reports damage; damage events are then not counted twice.

public bool Attributed { get; set; }

Property Value

bool

Gains

public IReadOnlyList<GainMark> Gains { get; }

Property Value

IReadOnlyList<GainMark>

Levels

public IReadOnlyList<LevelMark> Levels { get; }

Property Value

IReadOnlyList<LevelMark>

Meter

Damage per second over the last few seconds of the current wave.

public DpsMeterModel Meter { get; }

Property Value

DpsMeterModel

Seconds

public float Seconds { get; }

Property Value

float

Taken

public IReadOnlyList<DamageTakenTotals> Taken { get; }

Property Value

IReadOnlyList<DamageTakenTotals>

TickSeconds

public float TickSeconds { get; }

Property Value

float

Ticks

Ticks played in waves over the run.

public int Ticks { get; }

Property Value

int

TotalDealt

public long TotalDealt { get; }

Property Value

long

TotalTaken

public long TotalTaken { get; }

Property Value

long

UnsourcedDamage

public long UnsourcedDamage { get; }

Property Value

long

UnsourcedKills

public int UnsourcedKills { get; }

Property Value

int

Wave

1-based wave being played (or last played).

public int Wave { get; }

Property Value

int

Weapons

public IReadOnlyList<WeaponDamageTotals> Weapons { get; }

Property Value

IReadOnlyList<WeaponDamageTotals>

Methods

BeginWave(int, float, int)

public void BeginWave(int wave, float tickSeconds, int startTick)

Parameters

wave int
tickSeconds float
startTick int

Clear()

public void Clear()

Dealt(int, int, string, DamageChannel, long, bool, bool, bool)

Damage dealt to an enemy. Empty weaponId = unsourced.

public void Dealt(int tick, int slot, string weaponId, DamageChannel channel, long amount, bool crit = false, bool killed = false, bool hit = true)

Parameters

tick int
slot int
weaponId string
channel DamageChannel
amount long
crit bool
killed bool
hit bool

Equipped(string)

One played tick with this weapon equipped (call once per equipped copy).

public void Equipped(string weaponId)

Parameters

weaponId string

Gained(int, string, bool, GainSource)

public void Gained(int wave, string id, bool weapon, GainSource source)

Parameters

wave int
id string
weapon bool
source GainSource

LevelReached(int, int, int)

public void LevelReached(int wave, int level, int tick)

Parameters

wave int
level int
tick int

Observe(in SimEvent, IReadOnlyList<string>, Func<int, string>)

One event of the tick. Level-ups always; damage only when no tap reports it (Attributed false). slotWeaponIds: item id per weapon slot (optional); enemyIdOf: entity id → enemy id.

public void Observe(in SimEvent e, IReadOnlyList<string> slotWeaponIds, Func<int, string> enemyIdOf)

Parameters

e SimEvent
slotWeaponIds IReadOnlyList<string>
enemyIdOf Func<int, string>

RecordTaken(string, TakenChannel, long)

public void RecordTaken(string sourceId, TakenChannel channel, long amount)

Parameters

sourceId string
channel TakenChannel
amount long

TickPlayed(int)

public void TickPlayed(int tick)

Parameters

tick int