-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathGameLifecycleContracts.cs
More file actions
292 lines (274 loc) · 10.1 KB
/
GameLifecycleContracts.cs
File metadata and controls
292 lines (274 loc) · 10.1 KB
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
using MegaCrit.Sts2.Core.Nodes;
using MegaCrit.Sts2.Core.Runs;
using MegaCrit.Sts2.Core.Saves;
namespace STS2RitsuLib
{
/// <summary>
/// Raised before essential (blocking) initialization work begins.
/// 在必要(阻塞)初始化工作开始前触发。
/// </summary>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct EssentialInitializationStartingEvent(
DateTimeOffset OccurredAtUtc
) : IFrameworkLifecycleEvent;
/// <summary>
/// Raised after essential initialization completed; replayed to new subscribers.
/// 在必要初始化完成后触发;会向新订阅者重放。
/// </summary>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct EssentialInitializationCompletedEvent(
DateTimeOffset OccurredAtUtc
) : IReplayableFrameworkLifecycleEvent;
/// <summary>
/// Raised before deferred initialization starts.
/// 在延迟初始化开始前触发。
/// </summary>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct DeferredInitializationStartingEvent(
DateTimeOffset OccurredAtUtc
) : IFrameworkLifecycleEvent;
/// <summary>
/// Raised after deferred initialization finished; replayed to new subscribers.
/// 在延迟初始化完成后触发;会向新订阅者重放。
/// </summary>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct DeferredInitializationCompletedEvent(
DateTimeOffset OccurredAtUtc
) : IReplayableFrameworkLifecycleEvent;
/// <summary>
/// Content registration phase has closed (no further registrations expected).
/// 内容注册阶段已关闭(预期不会再有后续注册)。
/// </summary>
/// <param name="Reason">
/// Human-readable or diagnostic reason token.
/// 人类可读或用于诊断的原因标记。
/// </param>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct ContentRegistrationClosedEvent(
string Reason,
DateTimeOffset OccurredAtUtc
) : IReplayableFrameworkLifecycleEvent;
/// <summary>
/// Model registry is about to be populated.
/// 模型注册表即将开始填充。
/// </summary>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct ModelRegistryInitializingEvent(
DateTimeOffset OccurredAtUtc
) : IFrameworkLifecycleEvent;
/// <summary>
/// Model registry finished registering types; includes count for diagnostics.
/// 模型注册表已完成类型注册;包含用于诊断的数量。
/// </summary>
/// <param name="RegisteredModelTypeCount">
/// Number of model types registered.
/// 已注册的模型类型数量。
/// </param>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct ModelRegistryInitializedEvent(
int RegisteredModelTypeCount,
DateTimeOffset OccurredAtUtc
) : IReplayableFrameworkLifecycleEvent;
/// <summary>
/// Model id assignment phase starting.
/// 模型 ID 分配阶段开始。
/// </summary>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct ModelIdsInitializingEvent(
DateTimeOffset OccurredAtUtc
) : IFrameworkLifecycleEvent;
/// <summary>
/// Model ids have been assigned; replayed to new subscribers.
/// 模型 ID 已分配;会向新订阅者重放。
/// </summary>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct ModelIdsInitializedEvent(
DateTimeOffset OccurredAtUtc
) : IReplayableFrameworkLifecycleEvent;
/// <summary>
/// Heavy model preloading is starting.
/// 重型模型预加载即将开始。
/// </summary>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct ModelPreloadingStartingEvent(
DateTimeOffset OccurredAtUtc
) : IFrameworkLifecycleEvent;
/// <summary>
/// Model preloading finished; replayed to new subscribers.
/// 模型预加载已完成;会向新订阅者重放。
/// </summary>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct ModelPreloadingCompletedEvent(
DateTimeOffset OccurredAtUtc
) : IReplayableFrameworkLifecycleEvent;
/// <summary>
/// Game node entered the scene tree.
/// 游戏节点已进入场景树。
/// </summary>
/// <param name="Game">
/// Root game node instance.
/// 根游戏节点实例。
/// </param>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct GameTreeEnteredEvent(
NGame Game,
DateTimeOffset OccurredAtUtc
) : IReplayableFrameworkLifecycleEvent;
/// <summary>
/// Game is ready for play logic; replayed to new subscribers.
/// 游戏已准备好运行玩法逻辑;会向新订阅者重放。
/// </summary>
/// <param name="Game">
/// Root game node instance.
/// 根游戏节点实例。
/// </param>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct GameReadyEvent(
NGame Game,
DateTimeOffset OccurredAtUtc
) : IReplayableFrameworkLifecycleEvent;
/// <summary>
/// Main menu node finished its ready callback; replayed to new subscribers.
/// 主菜单节点已完成 ready 回调;会向新订阅者重放。
/// </summary>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct MainMenuReadyEvent(
DateTimeOffset OccurredAtUtc
) : IReplayableFrameworkLifecycleEvent;
/// <summary>
/// Startup telemetry facts have been sampled once and are ready to replay after consent.
/// 启动 telemetry 事实已完成一次性采样,可在授权后回放。
/// </summary>
/// <param name="SnapshotAtUtc">
/// When the persistent startup snapshot was captured.
/// 常驻启动快照的采样时间。
/// </param>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct TelemetryStartupSnapshotReadyEvent(
DateTimeOffset SnapshotAtUtc,
DateTimeOffset OccurredAtUtc
) : IReplayableFrameworkLifecycleEvent;
/// <summary>
/// A new run has started.
/// 新跑局已开始。
/// </summary>
/// <param name="RunState">
/// Active run state.
/// 当前活动跑局状态。
/// </param>
/// <param name="IsMultiplayer">
/// Whether the run is multiplayer.
/// 跑局是否为多人模式。
/// </param>
/// <param name="IsDaily">
/// Whether the run is a daily challenge.
/// 跑局是否为每日挑战。
/// </param>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct RunStartedEvent(
RunState RunState,
bool IsMultiplayer,
bool IsDaily,
DateTimeOffset OccurredAtUtc
) : IFrameworkLifecycleEvent;
/// <summary>
/// An existing run was loaded from save.
/// 已从存档加载既有跑局。
/// </summary>
/// <param name="RunState">
/// Active run state after load.
/// 加载后的当前活动跑局状态。
/// </param>
/// <param name="IsMultiplayer">
/// Whether the run is multiplayer.
/// 跑局是否为多人模式。
/// </param>
/// <param name="IsDaily">
/// Whether the run is a daily challenge.
/// 跑局是否为每日挑战。
/// </param>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct RunLoadedEvent(
RunState RunState,
bool IsMultiplayer,
bool IsDaily,
DateTimeOffset OccurredAtUtc
) : IFrameworkLifecycleEvent;
/// <summary>
/// Run finished (victory, defeat, or abandon).
/// 跑局已结束(胜利、失败或放弃)。
/// </summary>
/// <param name="Run">
/// Serializable snapshot of the ended run.
/// 已结束跑局的可序列化快照。
/// </param>
/// <param name="IsVictory">
/// True if the player won.
/// 如果玩家获胜则为 true。
/// </param>
/// <param name="IsAbandoned">
/// True if the run was abandoned.
/// 如果跑局被放弃则为 true。
/// </param>
/// <param name="OccurredAtUtc">
/// When the event was raised.
/// 事件触发的时间。
/// </param>
public readonly record struct RunEndedEvent(
SerializableRun Run,
bool IsVictory,
bool IsAbandoned,
DateTimeOffset OccurredAtUtc
) : IFrameworkLifecycleEvent;
}