-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmode.ts
64 lines (49 loc) · 1.28 KB
/
mode.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { Tree } from './tree';
import { machine, MachineOutputs } from './machine';
import { Log } from './log';
import { Group } from 'aminogfx-gl';
import { assert } from './util';
export enum Modes {
None,
AttractMode,
Game,
Ball,
Player,
MiniPf,
LockLit,
GameMode,
Multiball,
Poker,
Multipler,
Restart,
Mystery,
Skillshot,
NoMode,
Bonus,
PlayerOverrides,
MachineOverrides,
}
export abstract class Mode extends Tree<MachineOutputs> {
override gPriority!: number;
gfx?: Group;
constructor(
type: Modes,
// public gfx: Group|undefined = createGroup(),
) {
super(type);
Log.info(['game', 'console', 'switch'], 'create mode %s', this.constructor.name);
}
override started() {
assert(machine.getChildren().includes(this));
Log.log('game', 'start mode %s', this.constructor.name);
super.started();
// if (this instanceof Mode)
// this.gfx?.add(node.gfx!);
}
override end() {
Log.log('game', 'end mode %s', this.constructor.name);
// if (this.gfx)
// this.gfx.parent?.remove(this.gfx);
return super.end();
}
}