-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtypes.ts
45 lines (39 loc) · 1.04 KB
/
types.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { FrameEntryType, FramesType, GameEndType, GameStartType, MetadataType, StatsType } from "@slippi/slippi-js";
export enum Stat {
OPENINGS_PER_KILL = "opk",
DAMAGE_PER_OPENING = "dpo",
NEUTRAL_WINS = "nw",
KILL_MOVES = "mckm",
NEUTRAL_OPENER_MOVES = "mcno",
INPUTS_PER_MINUTE = "ipm",
AVG_KILL_PERCENT = "akp",
DAMAGE_DONE = "tdd",
EARLY_KILLS = "ek",
LATE_DEATHS = "ld",
SELF_DESTRUCTS = "sd",
HIGH_DAMAGE_PUNISHES = "hdp",
// Custom
FIRST_BLOOD = "fb",
L_CANCEL = "lc",
}
export interface GameDetails {
filePath: string;
settings: GameStartType;
frames: FramesType;
stats: StatsType;
metadata: MetadataType;
latestFrame: FrameEntryType | null;
gameEnd: GameEndType | null;
}
export interface StatCalculationResult {
result: any;
simple: any;
}
export type StatCalculation = (games: GameDetails[], playerIndex: number) => StatCalculationResult;
export interface StatDefinition {
name: string;
type: string;
betterDirection?: string;
recommendedRounding?: number;
calculate: StatCalculation;
}