Class LootTally
java.lang.Object
privbot.mechanics.LootTally
Counts kills and loot per NPC name, so a plugin can report what a trip earned.
What it proves: figures are exactly what was recorded, nothing inferred. An NPC never seen reads 0 kills, 0 value and an empty item map, which here truly means "none recorded".
Unreadable looks like: a null NPC or item name is ignored, and a non-positive quantity is ignored.
Thread rule: not thread safe; keep it on one thread (the worker that records the loot).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintvoidRecordsqtyofitem(worthvaluein total) fromnpc.voidrecordKill(String npc) Counts one kill ofnpc.voidreset()Forgets everything.longlong
-
Constructor Details
-
LootTally
public LootTally()
-
-
Method Details
-
recordKill
Counts one kill ofnpc. -
record
-
kills
- Returns:
- kills recorded for
npc
-
value
- Returns:
- total loot value recorded for
npc
-
totalValue
public long totalValue()- Returns:
- total loot value over every NPC
-
items
-
reset
public void reset()Forgets everything.
-