-
Notifications
You must be signed in to change notification settings - Fork 5
/
metagame.event.ts
31 lines (26 loc) · 1.01 KB
/
metagame.event.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { WorldEvent } from './base/world.event';
import { PS2Events } from '../../stream';
import { PS2Event } from './base/ps2.event';
export class MetagameEvent extends WorldEvent<PS2Events.MetagameEvent> {
readonly emit = 'metagameEvent';
readonly event_name: 'MetagameEvent';
readonly experience_bonus: string;
readonly faction_nc: number;
readonly faction_tr: number;
readonly faction_vs: number;
readonly metagame_event_id: string;
readonly metagame_event_state: string;
readonly metagame_event_state_name: string;
readonly instance_id: string;
constructor(
...params: ConstructorParameters<typeof PS2Event<PS2Events.MetagameEvent>>
) {
super(...params);
this.faction_nc = Number.parseFloat(params[MetagameEvent.DATA].faction_nc);
this.faction_tr = Number.parseFloat(params[MetagameEvent.DATA].faction_tr);
this.faction_vs = Number.parseFloat(params[MetagameEvent.DATA].faction_vs);
}
toHash(): string {
return `MetagameEvent:${this.world_id}:${this.timestamp}`;
}
}