-
Notifications
You must be signed in to change notification settings - Fork 9
/
EventIndex.ts
121 lines (110 loc) · 2.14 KB
/
EventIndex.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/**
* @akashic/playlog の各 interface に名前を与える const enum 群。
*
* playlog.Tick や playlog.Event は、実態としてはただのヘテロ配列である。
* 各 interface にはインデックスと型名のみがあり、それぞれの値の意味内容は自然言語でしか記述されていない。
* インデックスのハードコーディングを避けるため、ここで const enum で名前を与えることにする。
*
* 本当はこのファイルの内容は playlog に移管すべきだが、
* playlog に存在しない `Local` のフィールドを使うため akashic-engine 側で扱う。
*
*/
export module EventIndex {
export const enum Tick {
Age = 0,
Events = 1,
StorageData = 2
}
export const enum TickList {
From = 0,
To = 1,
TicksWithEvents = 2
}
export const enum General {
Code = 0,
EventFlags = 1,
PlayerId = 2
}
export const enum Join {
Code = 0,
EventFlags = 1,
PlayerId = 2,
PlayerName = 3,
StorageData = 4,
Local = 5
}
export const enum Leave {
Code = 0,
EventFlags = 1,
PlayerId = 2,
Local = 3
}
export const enum Timestamp {
Code = 0,
EventFlags = 1,
PlayerId = 2,
Timestamp = 3,
Local = 4
}
export const enum PlayerInfo {
Code = 0,
EventFlags = 1,
PlayerId = 2,
PlayerName = 3,
UserData = 4,
Local = 5
}
export const enum Message {
Code = 0,
EventFlags = 1,
PlayerId = 2,
Message = 3,
Local = 4
}
export const enum PointDown {
Code = 0,
EventFlags = 1,
PlayerId = 2,
PointerId = 3,
X = 4,
Y = 5,
EntityId = 6,
Local = 7
}
export const enum PointMove {
Code = 0,
EventFlags = 1,
PlayerId = 2,
PointerId = 3,
X = 4,
Y = 5,
StartDeltaX = 6,
StartDeltaY = 7,
PrevDeltaX = 8,
PrevDeltaY = 9,
EntityId = 10,
Local = 11
}
export const enum PointUp {
Code = 0,
EventFlags = 1,
PlayerId = 2,
PointerId = 3,
X = 4,
Y = 5,
StartDeltaX = 6,
StartDeltaY = 7,
PrevDeltaX = 8,
PrevDeltaY = 9,
EntityId = 10,
Local = 11
}
export const enum Operation {
Code = 0,
EventFlags = 1,
PlayerId = 2,
OperationCode = 3,
OperationData = 4,
Local = 5
}
}