-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschemas.d.ts
171 lines (157 loc) · 3.41 KB
/
schemas.d.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/**
* Schemas of the firebase realtime database
*/
/**
* User's unique id, generated by the auth service
*/
type UID = string
/**
* Id generated by the db service
*/
type ID = string
/**
* Date and time, formatted as ISO 8601
*/
type DateTime = string
type int = number
type float = number
/**
* Overall schema of the entire database
*
* @path /
*/
type DB = {
config: Config
users: Record<UID, User>
stats: Record<UID, UserStats>
keys: Record<UID, UserKeys>
}
/**
* Global configurations
*
* @path /config
*/
type Config = {
/**
* Game modes
*/
modes: Record<ID, GameMode>
}
/**
* @path /config/modes/{id}
*/
type GameMode = {
name: string
config: GameConfig
}
/**
* @path /users/{uid}
*/
type User = {
username: string
email: string
avatar: string
joined_on: DateTime
last_online: DateTime
owner: string | null
bots: string[]
}
/**
* Collection of statistics for all game modes
* where the user played in
*
* @path /stats/{uid}
*/
type UserStats = {
/**
* Current user MMR
* ID: Config.modes.ID
*/
mmrs: Record<ID, int>
/**
* History of the games per game mode
* ID: Config.modes.ID
*/
history: Record<ID, GameHistory>
}
/**
* Collection of all played games statistics
* indexed by datetime (for one game mode)
*
* @path /stats/{uid}/history/{id}
*/
type GameHistory = Record<DateTime, GameStats>
/**
* Statistics for one game
*
* @path /stats/{uid}/history/{id}/{datetime}
*/
type GameStats = {
/**
* MMR of the user AFTER the game
*/
mmr: int
/**
* List of UIDs of the player in the game (including self)
* sorted by resulting position, i.e. best (index 0) to worst
*/
ranking: UID[]
}
/**
* Contains informations of keys for a user
*
* @path /keys/{uid}
*/
type UserKeys = {
/**
* Key used to connect as a bot
*/
bot_key: string
}
/**
* Global configuration of the game
*
* @path /config/modes/{id}/config
*/
type GameConfig = {
initial_money: number
initial_n_probes: number
base_income: number
building_occupation_min: number
factory_price: number
factory_max_probe: number
factory_build_probe_delay: number
max_occupation: number
probe_speed: number
probe_hp: number
probe_price: number
probe_claim_delay: number
probe_claim_intensity: number
probe_explosion_intensity: number
probe_maintenance_costs: number
turret_price: number
turret_damage: number
turret_fire_delay: number
turret_scope: number
turret_maintenance_costs: number
income_rate: number
deprecate_rate: number
tech_probe_explosion_intensity_increase: number
tech_probe_explosion_intensity_price: number
tech_probe_claim_intensity_increase: number
tech_probe_claim_intensity_price: number
tech_probe_hp_increase: number
tech_probe_hp_price: number
tech_factory_build_delay_decrease: number
tech_factory_build_delay_price: number
tech_factory_probe_price_decrease: number
tech_factory_probe_price_price: number
tech_factory_max_probe_increase: int
tech_factory_max_probe_price: number
tech_turret_scope_increase: number
tech_turret_scope_price: number
tech_turret_fire_delay_decrease: number
tech_turret_fire_delay_price: number
tech_turret_maintenance_costs_decrease: number
tech_turret_maintenance_costs_price: number
}