xray16 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/package.json +12 -6
  2. package/xray16.d.ts +30847 -0
  3. package/types/index.d.ts +0 -55
  4. package/types/internal.d.ts +0 -6
  5. package/types/xr_ai/xr_action.d.ts +0 -1803
  6. package/types/xr_ai/xr_alife.d.ts +0 -1872
  7. package/types/xr_ai/xr_enemy_evaluation.d.ts +0 -134
  8. package/types/xr_ai/xr_goap.d.ts +0 -1118
  9. package/types/xr_ai/xr_graph.d.ts +0 -135
  10. package/types/xr_ai/xr_memory.d.ts +0 -384
  11. package/types/xr_lib/xr_animation.d.ts +0 -252
  12. package/types/xr_lib/xr_bitwise.d.ts +0 -44
  13. package/types/xr_lib/xr_color.d.ts +0 -142
  14. package/types/xr_lib/xr_debug.d.ts +0 -183
  15. package/types/xr_lib/xr_dialog.d.ts +0 -132
  16. package/types/xr_lib/xr_flags.d.ts +0 -592
  17. package/types/xr_lib/xr_fs.d.ts +0 -617
  18. package/types/xr_lib/xr_game.d.ts +0 -362
  19. package/types/xr_lib/xr_hit.d.ts +0 -127
  20. package/types/xr_lib/xr_ini.d.ts +0 -475
  21. package/types/xr_lib/xr_level.d.ts +0 -797
  22. package/types/xr_lib/xr_luabind.d.ts +0 -90
  23. package/types/xr_lib/xr_map.d.ts +0 -194
  24. package/types/xr_lib/xr_math.d.ts +0 -871
  25. package/types/xr_lib/xr_multiplayer.d.ts +0 -1081
  26. package/types/xr_lib/xr_profile.d.ts +0 -272
  27. package/types/xr_lib/xr_properties.d.ts +0 -612
  28. package/types/xr_lib/xr_relation.d.ts +0 -231
  29. package/types/xr_lib/xr_render.d.ts +0 -167
  30. package/types/xr_lib/xr_save.d.ts +0 -835
  31. package/types/xr_lib/xr_sound.d.ts +0 -517
  32. package/types/xr_lib/xr_stats.ts +0 -51
  33. package/types/xr_lib/xr_task.d.ts +0 -390
  34. package/types/xr_lib/xr_time.d.ts +0 -177
  35. package/types/xr_lib/xr_type.d.ts +0 -70
  36. package/types/xr_object/client/xr_anomaly.d.ts +0 -70
  37. package/types/xr_object/client/xr_artefact.d.ts +0 -153
  38. package/types/xr_object/client/xr_client_object.d.ts +0 -207
  39. package/types/xr_object/client/xr_creature.d.ts +0 -243
  40. package/types/xr_object/client/xr_item.d.ts +0 -370
  41. package/types/xr_object/client/xr_level.d.ts +0 -755
  42. package/types/xr_object/client/xr_physic.d.ts +0 -644
  43. package/types/xr_object/client/xr_zone.d.ts +0 -85
  44. package/types/xr_object/script/xr_script_interface.d.ts +0 -1142
  45. package/types/xr_object/script/xr_script_object.d.ts +0 -5702
  46. package/types/xr_object/script/xr_script_trade.d.ts +0 -51
  47. package/types/xr_object/server/xr_server_object.d.ts +0 -1488
  48. package/types/xr_ui/xr_ui_asset.d.ts +0 -364
  49. package/types/xr_ui/xr_ui_core.d.ts +0 -426
  50. package/types/xr_ui/xr_ui_event.d.ts +0 -1449
  51. package/types/xr_ui/xr_ui_interface.d.ts +0 -2449
  52. package/types/xr_ui/xr_ui_menu.d.ts +0 -401
  53. package/types/xrf_plugin.d.ts +0 -111
@@ -1,835 +0,0 @@
1
- import type { Nillable } from "../internal";
2
-
3
- declare module "xray16" {
4
- /**
5
- * Network client identifier.
6
- *
7
- * @source C++ class ClientID
8
- * @customConstructor ClientID
9
- * @group xr_save
10
- *
11
- * @remarks
12
- * `0xffffffff` is used by the engine as broadcast client id in network code.
13
- */
14
- export class ClientID extends EngineBinding {
15
- /**
16
- * Create an empty client id.
17
- */
18
- public constructor();
19
-
20
- /**
21
- * Get raw client id value.
22
- *
23
- * @returns Client id value.
24
- */
25
- public value(): u32;
26
-
27
- /**
28
- * Set raw client id value.
29
- *
30
- * @param value - Client id value.
31
- */
32
- public set(value: u32): void;
33
- }
34
-
35
- /**
36
- * Read/write network packet used by server entities and events.
37
- *
38
- * Reading methods advance the read cursor. Writing methods append to the packet unless the method name says
39
- * otherwise.
40
- *
41
- * @source C++ class net_packet
42
- * @customConstructor net_packet
43
- * @group xr_save
44
- *
45
- * @remarks
46
- * Packet reads are positional. Use `r_tell`, `r_seek`, `r_elapsed`, and `r_eof` when reading mixed payloads.
47
- * Native packets are capped at 16 KB and assert on read/write overruns.
48
- */
49
- export class net_packet {
50
- /**
51
- * Create an empty packet.
52
- */
53
- public constructor();
54
-
55
- /**
56
- * Advance the read cursor.
57
- *
58
- * @remarks
59
- * Does not read skipped bytes. Native code verifies that the new cursor stays inside the packet.
60
- *
61
- * @param size - Number of bytes to skip.
62
- */
63
- public r_advance(size: u32): void;
64
-
65
- /**
66
- * Read a 16-bit compressed angle into a placeholder.
67
- *
68
- * @remarks
69
- * Angles use the same `0..2 * PI` range as {@link w_angle16}.
70
- *
71
- * @param value - Output placeholder.
72
- */
73
- public r_angle16(value: f32): void;
74
-
75
- /**
76
- * Read an 8-bit compressed angle into a placeholder.
77
- *
78
- * @remarks
79
- * Angles use the same `0..2 * PI` range as {@link w_angle8}.
80
- *
81
- * @param value - Output placeholder.
82
- */
83
- public r_angle8(value: f32): void;
84
-
85
- /**
86
- * Read packet message header.
87
- *
88
- * @remarks
89
- * Resets the read cursor to the packet start before reading the message type.
90
- *
91
- * @param type - Output placeholder for message type.
92
- * @returns Packet receive time.
93
- */
94
- public r_begin(type: u16): u32;
95
-
96
- /**
97
- * Read boolean value.
98
- *
99
- * @remarks
100
- * Booleans are serialized as one byte.
101
- *
102
- * @returns Boolean value.
103
- */
104
- public r_bool(): boolean;
105
-
106
- /**
107
- * Read client id.
108
- *
109
- * @returns Client id.
110
- */
111
- public r_clientID(): ClientID;
112
-
113
- /**
114
- * Read a compressed direction vector.
115
- *
116
- * @param vector - Vector to fill.
117
- */
118
- public r_dir(vector: vector): void;
119
-
120
- /**
121
- * Get unread byte count.
122
- *
123
- * @returns Remaining bytes.
124
- */
125
- public r_elapsed(): u32;
126
-
127
- /**
128
- * Check whether the read cursor reached the end.
129
- *
130
- * @returns Whether packet is fully read.
131
- */
132
- public r_eof(): boolean;
133
-
134
- /**
135
- * Read float value.
136
- *
137
- * @returns Float value.
138
- */
139
- public r_float(): f32;
140
-
141
- /**
142
- * Read float value through a Lua-style placeholder overload.
143
- *
144
- * @param value - Placeholder value.
145
- * @returns Float value.
146
- */
147
- public r_float(value: f32): f32;
148
-
149
- /**
150
- * Read a 16-bit quantized float.
151
- *
152
- * @remarks
153
- * Use the same `min` and `max` that were used when writing the value.
154
- *
155
- * @param min - Minimum decoded value.
156
- * @param max - Maximum decoded value.
157
- * @param value - Placeholder value.
158
- * @returns Decoded float.
159
- */
160
- public r_float_q16(min: f32, max: f32, value: f32): f32;
161
-
162
- /**
163
- * Read an 8-bit quantized float.
164
- *
165
- * @remarks
166
- * Use the same `min` and `max` that were used when writing the value.
167
- *
168
- * @param min - Minimum decoded value.
169
- * @param max - Maximum decoded value.
170
- * @param value - Placeholder value.
171
- * @returns Decoded float.
172
- */
173
- public r_float_q8(min: f32, max: f32, value: f32): f32;
174
-
175
- /**
176
- * Read matrix data.
177
- *
178
- * @param matrix - Matrix to fill.
179
- * @returns Filled matrix.
180
- */
181
- public r_matrix(matrix: matrix): matrix;
182
-
183
- /**
184
- * Read signed 16-bit integer.
185
- *
186
- * @returns Signed 16-bit integer.
187
- */
188
- public r_s16(): i16;
189
-
190
- /**
191
- * Read signed 16-bit integer through a placeholder overload.
192
- *
193
- * @param value - Placeholder value.
194
- * @returns Signed 16-bit integer.
195
- */
196
- public r_s16(value: u16): u16;
197
-
198
- /**
199
- * Read signed 32-bit integer.
200
- *
201
- * @returns Signed 32-bit integer.
202
- */
203
- public r_s32(): i32;
204
-
205
- /**
206
- * Read signed 32-bit integer through a placeholder overload.
207
- *
208
- * @param value - Placeholder value.
209
- * @returns Signed 32-bit integer.
210
- */
211
- public r_s32(value: i32): i32;
212
-
213
- /**
214
- * Read signed 64-bit integer.
215
- *
216
- * @returns Signed 64-bit integer.
217
- */
218
- public r_s64(): i64;
219
-
220
- /**
221
- * Read signed 64-bit integer through a placeholder overload.
222
- *
223
- * @param value - Placeholder value.
224
- * @returns Signed 64-bit integer.
225
- */
226
- public r_s64(value: i64): i64;
227
-
228
- /**
229
- * Read signed 8-bit integer.
230
- *
231
- * @returns Signed 8-bit integer.
232
- */
233
- public r_s8(): i8;
234
-
235
- /**
236
- * Read signed 8-bit integer through a placeholder overload.
237
- *
238
- * @param value - Placeholder value.
239
- * @returns Signed 8-bit integer.
240
- */
241
- public r_s8(value: i8): i8;
242
-
243
- /**
244
- * Read a signed compressed direction vector.
245
- *
246
- * @param vector - Vector to fill.
247
- */
248
- public r_sdir(vector: vector): void;
249
-
250
- /**
251
- * Move read cursor to an absolute byte offset.
252
- *
253
- * @remarks
254
- * The engine allows seeking to the packet end. Offsets beyond the written byte count fail native verification.
255
- *
256
- * @param offset - Byte offset.
257
- */
258
- public r_seek(offset: u32): void;
259
-
260
- /**
261
- * Read zero-terminated string.
262
- *
263
- * @remarks
264
- * Advances past the trailing zero byte.
265
- *
266
- * @returns String value.
267
- */
268
- public r_stringZ<T extends string = string>(): T;
269
-
270
- /**
271
- * Get current read cursor offset.
272
- *
273
- * @returns Byte offset.
274
- */
275
- public r_tell(): u32;
276
-
277
- /**
278
- * Read unsigned 16-bit integer.
279
- *
280
- * @returns Unsigned 16-bit integer.
281
- */
282
- public r_u16(): u16;
283
-
284
- /**
285
- * Read unsigned 16-bit integer through a placeholder overload.
286
- *
287
- * @param value - Placeholder value.
288
- * @returns Unsigned 16-bit integer.
289
- */
290
- public r_u16(value: u16): u16;
291
-
292
- /**
293
- * Read unsigned 32-bit integer.
294
- *
295
- * @returns Unsigned 32-bit integer.
296
- */
297
- public r_u32(): u32;
298
-
299
- /**
300
- * Read unsigned 32-bit integer through a placeholder overload.
301
- *
302
- * @param value - Placeholder value.
303
- * @returns Unsigned 32-bit integer.
304
- */
305
- public r_u32(value: u32): u32;
306
-
307
- /**
308
- * Read unsigned 64-bit integer.
309
- *
310
- * @returns Unsigned 64-bit integer.
311
- */
312
- public r_u64(): u64;
313
-
314
- /**
315
- * Read unsigned 64-bit integer through a placeholder overload.
316
- *
317
- * @param value - Placeholder value.
318
- * @returns Unsigned 64-bit integer.
319
- */
320
- public r_u64(value: u64): u64;
321
-
322
- /**
323
- * Read unsigned 8-bit integer.
324
- *
325
- * @returns Unsigned 8-bit integer.
326
- */
327
- public r_u8(): u8;
328
-
329
- /**
330
- * Read unsigned 8-bit integer through a placeholder overload.
331
- *
332
- * @param value - Placeholder value.
333
- * @returns Unsigned 8-bit integer.
334
- */
335
- public r_u8(value: u8): u8;
336
-
337
- /**
338
- * Read 3D vector.
339
- *
340
- * @param vector - Vector to fill.
341
- */
342
- public r_vec3(vector: vector): void;
343
-
344
- /**
345
- * Write a 16-bit compressed angle.
346
- *
347
- * @remarks
348
- * The engine normalizes the angle and stores it as a 16-bit quantized value over `0..2 * PI`.
349
- *
350
- * @param value - Angle in radians.
351
- */
352
- public w_angle16(value: f32): void;
353
-
354
- /**
355
- * Write an 8-bit compressed angle.
356
- *
357
- * @remarks
358
- * The engine normalizes the angle and stores it as an 8-bit quantized value over `0..2 * PI`.
359
- *
360
- * @param value - Angle in radians.
361
- */
362
- public w_angle8(value: f32): void;
363
-
364
- /**
365
- * Start packet with message type.
366
- *
367
- * @remarks
368
- * Clears existing packet contents before writing the message type.
369
- *
370
- * @param type - Message type.
371
- */
372
- public w_begin(type: u16): void;
373
-
374
- /**
375
- * Write boolean value.
376
- *
377
- * @remarks
378
- * Booleans are serialized as one byte.
379
- *
380
- * @param value - Boolean value.
381
- */
382
- public w_bool(value: boolean): void;
383
-
384
- /**
385
- * Close a 16-bit size-prefixed chunk.
386
- *
387
- * @remarks
388
- * The chunk payload must fit into `65535` bytes.
389
- *
390
- * @param marker - Chunk marker returned by `w_chunk_open16`.
391
- */
392
- public w_chunk_close16(marker: u32): void;
393
-
394
- /**
395
- * Close an 8-bit size-prefixed chunk.
396
- *
397
- * @remarks
398
- * The chunk payload must fit into `255` bytes.
399
- *
400
- * @param marker - Chunk marker returned by `w_chunk_open8`.
401
- */
402
- public w_chunk_close8(marker: u32): void;
403
-
404
- /**
405
- * Open a 16-bit size-prefixed chunk.
406
- *
407
- * @remarks
408
- * Writes a placeholder size at the current write cursor. Pass the returned marker to `w_chunk_close16`.
409
- *
410
- * @param marker - Output placeholder for chunk marker.
411
- */
412
- public w_chunk_open16(marker: u32): void;
413
-
414
- /**
415
- * Open an 8-bit size-prefixed chunk.
416
- *
417
- * @remarks
418
- * Writes a placeholder size at the current write cursor. Pass the returned marker to `w_chunk_close8`.
419
- *
420
- * @param marker - Output placeholder for chunk marker.
421
- */
422
- public w_chunk_open8(marker: u32): void;
423
-
424
- /**
425
- * Write client id.
426
- *
427
- * @param client_id - Client id.
428
- */
429
- public w_clientID(client_id: ClientID): void;
430
-
431
- /**
432
- * Write compressed direction vector.
433
- *
434
- * @param vector - Direction vector.
435
- */
436
- public w_dir(vector: vector): void;
437
-
438
- /**
439
- * Write float value.
440
- *
441
- * @param value - Float value.
442
- */
443
- public w_float(value: f32): void;
444
-
445
- /**
446
- * Write a 16-bit quantized float.
447
- *
448
- * @remarks
449
- * Native code verifies that `value` is inside `[min, max]`.
450
- *
451
- * @param value - Value to write.
452
- * @param min - Minimum encoded value.
453
- * @param max - Maximum encoded value.
454
- */
455
- public w_float_q16(value: f32, min: f32, max: f32): void;
456
-
457
- /**
458
- * Write an 8-bit quantized float.
459
- *
460
- * @remarks
461
- * Native code verifies that `value` is inside `[min, max]`.
462
- *
463
- * @param value - Value to write.
464
- * @param min - Minimum encoded value.
465
- * @param max - Maximum encoded value.
466
- */
467
- public w_float_q8(value: f32, min: f32, max: f32): void;
468
-
469
- /**
470
- * Write matrix data.
471
- *
472
- * @param matrix - Matrix to write.
473
- */
474
- public w_matrix(matrix: matrix): void;
475
-
476
- /**
477
- * Write signed 16-bit integer.
478
- *
479
- * @param value - Signed 16-bit integer.
480
- */
481
- public w_s16(value: i16): void;
482
-
483
- /**
484
- * Write signed 32-bit integer.
485
- *
486
- * @param value - Signed 32-bit integer.
487
- */
488
- public w_s32(value: i32): void;
489
-
490
- /**
491
- * Write signed 64-bit integer.
492
- *
493
- * @param value - Signed 64-bit integer.
494
- */
495
- public w_s64(value: i64): void;
496
-
497
- /**
498
- * Write signed compressed direction vector.
499
- *
500
- * @param vector - Direction vector.
501
- */
502
- public w_sdir(vector: vector): void;
503
-
504
- /**
505
- * Write zero-terminated string.
506
- *
507
- * @remarks
508
- * The binding writes the string bytes followed by `\0`.
509
- *
510
- * @param value - String value.
511
- */
512
- public w_stringZ(value: Nillable<string>): void;
513
-
514
- /**
515
- * Get current write cursor offset.
516
- *
517
- * @returns Byte offset.
518
- */
519
- public w_tell(): u32;
520
-
521
- /**
522
- * Write unsigned 16-bit integer.
523
- *
524
- * @param value - Unsigned 16-bit integer.
525
- */
526
- public w_u16(value: u16): void;
527
-
528
- /**
529
- * Write unsigned 32-bit integer.
530
- *
531
- * @param value - Unsigned 32-bit integer.
532
- */
533
- public w_u32(value: u32): void;
534
-
535
- /**
536
- * Write unsigned 64-bit integer.
537
- *
538
- * @param value - Unsigned 64-bit integer.
539
- */
540
- public w_u64(value: u64): void;
541
-
542
- /**
543
- * Write unsigned 8-bit integer.
544
- *
545
- * @param value - Unsigned 8-bit integer.
546
- */
547
- public w_u8(value: u8): void;
548
-
549
- /**
550
- * Write 3D vector.
551
- *
552
- * @param vector - Vector to write.
553
- */
554
- public w_vec3(vector: vector): void;
555
- }
556
-
557
- /**
558
- * Binary reader used for save data and chunk payloads.
559
- *
560
- * @source C++ class reader
561
- * @customConstructor reader
562
- * @group xr_save
563
- *
564
- * @remarks
565
- * Reader methods advance a cursor over existing binary data. They do not own or mutate the source buffer. Reader
566
- * values usually come from engine-owned chunks; scripts do not create them directly.
567
- */
568
- export class reader {
569
- /**
570
- * Advance the read cursor.
571
- *
572
- * @remarks
573
- * Native code verifies that the new cursor stays inside the reader buffer.
574
- *
575
- * @param size - Number of bytes to skip.
576
- */
577
- public r_advance(size: u64): void;
578
-
579
- /**
580
- * Get unread byte count.
581
- *
582
- * @returns Remaining bytes.
583
- */
584
- public r_elapsed(): i64;
585
-
586
- /**
587
- * Check whether the reader cursor reached the end.
588
- *
589
- * @returns Whether reader is fully consumed.
590
- */
591
- public r_eof(): boolean;
592
-
593
- /**
594
- * Read signed compressed direction vector.
595
- *
596
- * @param vector - Vector to fill.
597
- */
598
- public r_sdir(vector: vector): void;
599
-
600
- /**
601
- * Move read cursor to an absolute byte offset.
602
- *
603
- * @remarks
604
- * Offsets beyond the reader buffer fail native verification.
605
- *
606
- * @param offset - Byte offset.
607
- */
608
- public r_seek(offset: u64): void;
609
-
610
- /**
611
- * Get current read cursor offset.
612
- *
613
- * @returns Byte offset.
614
- */
615
- public r_tell(): u64;
616
-
617
- /**
618
- * Read compressed direction vector.
619
- *
620
- * @param vector - Vector to fill.
621
- */
622
- public r_dir(vector: vector): void;
623
-
624
- /**
625
- * Read 3D vector.
626
- *
627
- * @param vector - Vector to fill.
628
- */
629
- public r_vec3(vector: vector): void;
630
-
631
- /**
632
- * Read a 16-bit compressed angle.
633
- *
634
- * @returns Angle in radians.
635
- */
636
- public r_angle16(): f32;
637
-
638
- /**
639
- * Read an 8-bit compressed angle.
640
- *
641
- * @returns Angle in radians.
642
- */
643
- public r_angle8(): f32;
644
-
645
- /**
646
- * Read boolean value.
647
- *
648
- * @returns Boolean value.
649
- */
650
- public r_bool(): boolean;
651
-
652
- /**
653
- * Read zero-terminated string.
654
- *
655
- * @remarks
656
- * Advances past the trailing zero byte.
657
- *
658
- * @returns String value.
659
- */
660
- public r_stringZ<T extends string = string>(): T;
661
-
662
- /**
663
- * Read float value.
664
- *
665
- * @param value - Optional placeholder value.
666
- * @returns Float value.
667
- */
668
- public r_float<T extends f32>(value?: T): T;
669
-
670
- /**
671
- * Read a 16-bit quantized float.
672
- *
673
- * @param min - Minimum decoded value.
674
- * @param max - Maximum decoded value.
675
- * @returns Decoded float.
676
- */
677
- public r_float_q16<T extends f32>(min: T, max: T): T;
678
-
679
- /**
680
- * Read an 8-bit quantized float.
681
- *
682
- * @param min - Minimum decoded value.
683
- * @param max - Maximum decoded value.
684
- * @returns Decoded float.
685
- */
686
- public r_float_q8<T extends f32>(min: T, max: T): T;
687
-
688
- /**
689
- * Read signed 16-bit integer.
690
- *
691
- * @param value - Optional placeholder value.
692
- * @returns Signed 16-bit integer.
693
- */
694
- public r_s16<T extends i16 = i16>(value?: T): T;
695
-
696
- /**
697
- * Read signed 32-bit integer.
698
- *
699
- * @param value - Optional placeholder value.
700
- * @returns Signed 32-bit integer.
701
- */
702
- public r_s32<T extends i32 = i32>(value?: T): T;
703
-
704
- /**
705
- * Read signed 64-bit integer.
706
- *
707
- * @param value - Optional placeholder value.
708
- * @returns Signed 64-bit integer.
709
- */
710
- public r_s64<T extends i64 = i64>(value?: T): T;
711
-
712
- /**
713
- * Read signed 8-bit integer.
714
- *
715
- * @param value - Optional placeholder value.
716
- * @returns Signed 8-bit integer.
717
- */
718
- public r_s8<T extends i8 = i8>(value?: T): T;
719
-
720
- /**
721
- * Read unsigned 16-bit integer.
722
- *
723
- * @param value - Optional placeholder value.
724
- * @returns Unsigned 16-bit integer.
725
- */
726
- public r_u16<T extends u16 = u16>(value?: T): T;
727
-
728
- /**
729
- * Read unsigned 32-bit integer.
730
- *
731
- * @param value - Optional placeholder value.
732
- * @returns Unsigned 32-bit integer.
733
- */
734
- public r_u32<T extends u32 = u32>(value?: T): T;
735
-
736
- /**
737
- * Read unsigned 64-bit integer.
738
- *
739
- * @param value - Optional placeholder value.
740
- * @returns Unsigned 64-bit integer.
741
- */
742
- public r_u64<T extends u64 = u64>(value?: T): T;
743
-
744
- /**
745
- * Read unsigned 8-bit integer.
746
- *
747
- * @param value - Optional placeholder value.
748
- * @returns Unsigned 8-bit integer.
749
- */
750
- public r_u8<T extends u8 = u8>(value?: T): T;
751
- }
752
-
753
- /**
754
- * Any engine binary input accepted by save/network serializers.
755
- *
756
- * @group xr_save
757
- */
758
- export type TXR_net_processor = reader | net_packet;
759
-
760
- /**
761
- * Lightweight view over save-game metadata.
762
- *
763
- * @source C++ class CSavedGameWrapper
764
- * @customConstructor CSavedGameWrapper
765
- * @group xr_save
766
- *
767
- * @remarks
768
- * Looks for both current and legacy save extensions under `$game_saves$`. A missing file asserts; an existing file
769
- * with an incompatible header returns fallback metadata instead.
770
- */
771
- export class CSavedGameWrapper extends EngineBinding {
772
- /**
773
- * Open save-game metadata by save name.
774
- *
775
- * @throws If the save file does not exist.
776
- *
777
- * @param name - Save name without extension.
778
- */
779
- public constructor(name: string);
780
-
781
- /**
782
- * Get active level name stored in the save.
783
- *
784
- * @remarks
785
- * Returns an empty string when level metadata cannot be resolved. Returns the translated error string when the
786
- * game graph has no matching level id.
787
- *
788
- * @returns Level name, or an empty/error value when metadata cannot be resolved.
789
- */
790
- public level_name(): string;
791
-
792
- /**
793
- * Get active level id stored in the save.
794
- *
795
- * @remarks
796
- * Returns `255` when level metadata cannot be resolved.
797
- *
798
- * @returns Level id.
799
- */
800
- public level_id(): u8;
801
-
802
- /**
803
- * Get in-game time stored in the save.
804
- *
805
- * @remarks
806
- * Invalid save headers return the default ALife time instead of throwing.
807
- *
808
- * @returns Game time.
809
- */
810
- public game_time(): CTime;
811
-
812
- /**
813
- * Get actor health stored in the save.
814
- *
815
- * @remarks
816
- * Invalid save headers return `1`.
817
- *
818
- * @returns Actor health.
819
- */
820
- public actor_health(): f32;
821
- }
822
-
823
- /**
824
- * Check whether a save exists and has a compatible header.
825
- *
826
- * @group xr_save
827
- *
828
- * @remarks
829
- * Accepts save names without extension and checks both current and legacy save extensions.
830
- *
831
- * @param filename - Save name without extension.
832
- * @returns Whether the save can be loaded by this engine.
833
- */
834
- export function valid_saved_game(this: void, filename: string): boolean;
835
- }