fix icon mapping in campaign ranking
This commit is contained in:
parent
0bfe27e0d3
commit
d766befd31
5 changed files with 113 additions and 58 deletions
|
|
@ -131,6 +131,24 @@ class TieResolver:
|
|||
groups[-1].append(pid)
|
||||
return groups
|
||||
|
||||
@staticmethod
|
||||
def tokens_spent_map(
|
||||
war: War,
|
||||
context_type: ContextType,
|
||||
context_id: str,
|
||||
participants: List[str],
|
||||
) -> Dict[str, int]:
|
||||
spent = {pid: 0 for pid in participants}
|
||||
for ev in war.events:
|
||||
if (
|
||||
isinstance(ev, InfluenceSpent)
|
||||
and ev.context_type == context_type
|
||||
and ev.context_id == context_id
|
||||
and ev.participant_id in spent
|
||||
):
|
||||
spent[ev.participant_id] += ev.amount
|
||||
return spent
|
||||
|
||||
@staticmethod
|
||||
def get_active_participants(
|
||||
war: War,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue