-
Notifications
You must be signed in to change notification settings - Fork 10
/
Entities.ixx
1086 lines (797 loc) · 25.7 KB
/
Entities.ixx
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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* SDK module for Trilogy Online modification.
* The author of this file is the lead developer of Trilogy Online.
* Detailed information can be found on the website.
* https://trilogy-online.com/
*/
module;
export module TrilogyOnline.SDK.Entities;
import TrilogyOnline.SDK.Fundamental;
import TrilogyOnline.SDK.Vector;
import TrilogyOnline.SDK.InvalidArgumentException;
import TrilogyOnline.SDK.Placeable;
import TrilogyOnline.SDK.Physical;
export namespace TrilogyOnline
{
namespace API
{
class CVehicle;
class CObject;
class CPlayer : public CPhysical
{
public:
static constexpr auto Maximum = 10000u;
enum class EFacing : UInt8
{
Forward,
Left,
Back,
Right
};
enum class EWeapon : UInt8
{
Unarmed,
BrassKnuckles,
GolfClub,
NightStick,
Knife,
BaseballBat,
Shovel,
PoolCue,
Katana,
Chainsaw,
PurpleDildo,
Dildo,
Vibrator,
SilverVibrator,
Flowers,
Cane,
Grenade,
TearGas,
MolotovCocktail,
Pistol = 22,
PistolSilenced,
DesertEagle,
Shotgun,
SawnoffShotgun,
CombatShotgun,
MicroUzi,
MP5,
AK47,
M4,
TEC9,
CountryRifle,
SniperRifle,
RPG,
HSRocket,
Flamethrower,
Minigun,
SatchelCharge,
Detonator,
SprayCan,
FireExtinguisher,
Camera,
NightVisionGoggles,
ThermalGoggles,
Parachute,
Armor,
Vehicle = 49, // use only as a cause of death
HeliBlades, // use only as a cause of death
Explosion, // use only as a cause of death
Drown = 53, // use only as a cause of death
Collision, // use only as a cause of death
Invalid = 255
};
enum class EWeaponSlot : UInt8
{
Hand,
Melee,
Handgun,
Shotgun,
MachinePistol,
AssaultRifle,
Rifle,
Heavy,
Thrown,
Handheld,
Gift,
Apparel,
Detonator
};
enum class EFightStyle : UInt8
{
Default = 4,
Boxeo,
KungFu,
KickBoxing,
Bat,
Knife,
GolfClub,
Katana,
Chainsaw,
Dildo,
NotCombos,
YesCombos,
Elbows
};
enum class ESeat : UInt8
{
Front,
RearLeft,
RearRight,
Additional1,
Additional2,
Additional3,
Additional4,
Additional5,
Invalid
};
enum class EPlacement : UInt8
{
OnFoot,
InVehicleAsDriver,
InVehicleAsPassenger
};
enum class EHand : UInt8
{
Right = 1,
Left,
Both
};
class CState
{
public:
virtual ~CState() noexcept = default;
virtual void OnDeath(CPlayer& player, const EWeapon weapon) { }
virtual void OnDeath(CPlayer& player, CPlayer& byPlayer, const EWeapon weapon) { }
virtual void OnDeath(CPlayer& player, CVehicle& byVehicle, const EWeapon weapon) { }
virtual void OnGiveDamage(CPlayer& player, CPlayer& damagedPlayer) { }
virtual void OnTakeDamage(CPlayer& player, CPlayer& damagingPlayer) { }
#ifdef TRILOGY_ONLINE_CLIENT
virtual void OnStreamIn(CPlayer& player) { }
virtual void OnStreamOut(CPlayer& player) { }
virtual void OnSyncingUserDataUpdated(CPlayer& player, const UInt64 oldValue, const UInt64 newValue) { }
#endif
#ifdef TRILOGY_ONLINE_SERVER
virtual void OnStreamIn(CPlayer& player, CPlayer& forPlayer) { }
virtual void OnStreamOut(CPlayer& player, CPlayer& forPlayer) { }
virtual void OnPlaceUpdated(CPlayer& player, const CVector3DFloat& newPosition, const CVector3DFloat& newVelocity, const CVector3DFloat& newRotation, const CVector3DFloat& newRotationalVelocity, bool& isOk) { }
virtual void OnFireGun(CPlayer& player, const EWeaponSlot activeWeaponSlot, const EHand hand, bool& isOk) { }
virtual void OnHealthUpdated(CPlayer& player, const float newHealth, bool& isOk) { }
virtual void OnArmorUpdated(CPlayer& player, const float newArmor, bool& isOk) { }
virtual void OnActiveWeaponSlotUpdated(CPlayer& player, const EWeaponSlot newWeaponSlot, bool& isOk) { }
virtual void OnMessageReceived(CPlayer& player, const Byte* const data, const NativeUInt size) { }
#endif
};
[[nodiscard]]
static EWeaponSlot GetWeaponSlotByWeapon(const EWeapon& weapon)
{
switch (weapon)
{
case EWeapon::Unarmed:
return EWeaponSlot::Hand;
case EWeapon::BrassKnuckles:
return EWeaponSlot::Hand;
case EWeapon::GolfClub:
return EWeaponSlot::Melee;
case EWeapon::NightStick:
return EWeaponSlot::Melee;
case EWeapon::Knife:
return EWeaponSlot::Melee;
case EWeapon::BaseballBat:
return EWeaponSlot::Melee;
case EWeapon::Shovel:
return EWeaponSlot::Melee;
case EWeapon::PoolCue:
return EWeaponSlot::Melee;
case EWeapon::Katana:
return EWeaponSlot::Melee;
case EWeapon::Chainsaw:
return EWeaponSlot::Melee;
case EWeapon::PurpleDildo:
return EWeaponSlot::Gift;
case EWeapon::Dildo:
return EWeaponSlot::Gift;
case EWeapon::Vibrator:
return EWeaponSlot::Gift;
case EWeapon::SilverVibrator:
return EWeaponSlot::Gift;
case EWeapon::Flowers:
return EWeaponSlot::Gift;
case EWeapon::Cane:
return EWeaponSlot::Gift;
case EWeapon::Grenade:
return EWeaponSlot::Thrown;
case EWeapon::TearGas:
return EWeaponSlot::Thrown;
case EWeapon::MolotovCocktail:
return EWeaponSlot::Thrown;
case EWeapon::Pistol:
return EWeaponSlot::Handgun;
case EWeapon::PistolSilenced:
return EWeaponSlot::Handgun;
case EWeapon::DesertEagle:
return EWeaponSlot::Handgun;
case EWeapon::Shotgun:
return EWeaponSlot::Shotgun;
case EWeapon::SawnoffShotgun:
return EWeaponSlot::Shotgun;
case EWeapon::CombatShotgun:
return EWeaponSlot::Shotgun;
case EWeapon::MicroUzi:
return EWeaponSlot::MachinePistol;
case EWeapon::MP5:
return EWeaponSlot::MachinePistol;
case EWeapon::AK47:
return EWeaponSlot::AssaultRifle;
case EWeapon::M4:
return EWeaponSlot::AssaultRifle;
case EWeapon::TEC9:
return EWeaponSlot::MachinePistol;
case EWeapon::CountryRifle:
return EWeaponSlot::Rifle;
case EWeapon::SniperRifle:
return EWeaponSlot::Rifle;
case EWeapon::RPG:
return EWeaponSlot::Heavy;
case EWeapon::HSRocket:
return EWeaponSlot::Heavy;
case EWeapon::Flamethrower:
return EWeaponSlot::Heavy;
case EWeapon::Minigun:
return EWeaponSlot::Heavy;
case EWeapon::SatchelCharge:
return EWeaponSlot::Thrown;
case EWeapon::Detonator:
return EWeaponSlot::Detonator;
case EWeapon::SprayCan:
return EWeaponSlot::Handheld;
case EWeapon::FireExtinguisher:
return EWeaponSlot::Handheld;
case EWeapon::Camera:
return EWeaponSlot::Handheld;
case EWeapon::NightVisionGoggles:
return EWeaponSlot::Apparel;
case EWeapon::ThermalGoggles:
return EWeaponSlot::Apparel;
case EWeapon::Parachute:
return EWeaponSlot::Apparel;
}
throw CInvalidArgumentException{ u"The passed weapon does not have a slot." };
}
virtual void SetState(CState* const value) noexcept = 0;
[[nodiscard]]
virtual CState* GetState() const noexcept = 0;
virtual void AttachToVehicle(CVehicle& vehicle, const CVector3DFloat& offset, const EFacing facing, const float angleLimit, const EWeapon weapon) = 0;
virtual void AttachToObject(CObject& object, const CVector3DFloat& offset, const EFacing facing, const float angleLimit, const EWeapon weapon) = 0;
virtual void GiveWeapon(const EWeapon weapon, const UInt32 ammo) = 0;
virtual void RemoveWeapon(const EWeapon weapon) = 0;
virtual void RemoveAllWeapons() = 0;
virtual void SetActiveWeaponSlot(const EWeaponSlot value) = 0;
[[nodiscard]]
virtual EWeaponSlot GetActiveWeaponSlot() const = 0;
virtual void SetAmmo(const EWeaponSlot weaponSlot, const UInt32 ammo) = 0;
[[nodiscard]] virtual UInt32 GetAmmo(const EWeaponSlot weaponSlot) const = 0;
virtual void FireGun(const EHand hand) = 0;
virtual void SetMaxHealth(const float value) = 0;
[[nodiscard]]
virtual float GetMaxHealth() const = 0;
virtual void SetHealth(const float value) = 0;
[[nodiscard]]
virtual float GetHealth() const = 0;
virtual void SetArmor(const float value) = 0;
[[nodiscard]]
virtual float GetArmor() const = 0;
virtual void SetFightStyle(const EFightStyle value) = 0;
[[nodiscard]]
virtual EFightStyle GetFightStyle() const = 0;
virtual void SetModelId(const UInt32 value) = 0;
[[nodiscard]]
virtual UInt32 GetModelId() const = 0;
virtual void ToggleDucking(const bool value) = 0;
[[nodiscard]]
virtual bool IsDucking() const = 0;
virtual void EnterVehicleAsDriver(CVehicle& vehicle) = 0;
virtual void EnterVehicleAsPassenger(CVehicle& vehicle) = 0;
virtual void LeaveVehicle() = 0;
virtual void PutIntoVehicleAsDriver(CVehicle& vehicle) = 0;
virtual void PutIntoVehicleAsPassenger(CVehicle& vehicle, const ESeat seat) = 0;
virtual void RemoveFromVehicleAndPutAt(const CVector3DFloat& position) = 0;
[[nodiscard]]
virtual CVehicle* GetVehicle() const = 0;
[[nodiscard]]
virtual ESeat GetSeat() const = 0;
[[nodiscard]]
virtual EPlacement GetPlacement() const = 0;
virtual void Spawn(const UInt32 skinModelId, const CVector3DFloat& position, const float heading, const float health, const float armor) = 0;
#ifdef TRILOGY_ONLINE_SERVER
virtual void SendUnreliableMessage(const Byte* const data, const NativeUInt size) = 0;
virtual void SendReliableMessage(const Byte* const data, const NativeUInt size) = 0;
#endif
};
class CVehicle : public CPhysical
{
public:
static constexpr auto Maximum = 100000u;
enum class ETire : UInt8
{
FrontLeft,
RearLeft,
FrontRight,
RearRight
};
enum class ETireState : UInt8
{
Ok,
Burst,
Missing
};
enum class EDoor : UInt8
{
Bonnet,
Boot,
FrontLeft,
FrontRight,
RearLeft,
RearRight
};
enum class EDoorState : UInt8
{
Ok,
OkAndSwinging,
Smashed,
SmashedAndSwinging,
Missing
};
enum class EPanel : UInt8
{
WingFrontLeft,
WingFrontRight,
WingRearLeft,
WingRearRight,
Windscreen,
BumperFront,
BumperRear
};
enum class EPanelState : UInt8
{
Ok,
Smashed,
Swinging,
Missing
};
enum class ELight : UInt8
{
FrontLeft,
FrontRight,
RearRight,
RearLeft
};
enum class ELightState : UInt8
{
Ok,
Broken
};
enum class ELightsState : UInt8
{
NoOverride,
ForceOff,
ForceOn
};
enum class EDoorLockState : UInt8
{
NotUsed,
Unlocked,
Locked,
LockoutPlayerOnly,
LockedPlayerInside,
LockedInitially,
ForceShutDoors,
SkipShutDoors
};
class CPainting
{
public:
UInt8 PrimaryColor{ };
UInt8 SecondaryColor{ };
UInt8 TertiaryColor{ };
UInt8 QuaternaryColor{ };
constexpr CPainting() noexcept = default;
constexpr CPainting(const UInt8 primaryColor, const UInt8 secondaryColor, const UInt8 tertiaryColor, const UInt8 quaternaryColor) noexcept :
PrimaryColor{ primaryColor }, SecondaryColor{ secondaryColor }, TertiaryColor{ tertiaryColor }, QuaternaryColor{ quaternaryColor } { }
};
class CHydraulicForces
{
public:
float First{ };
float Second{ };
float Third{ };
float Fourth{ };
constexpr CHydraulicForces() noexcept = default;
constexpr CHydraulicForces(const float first, const float second, const float third, const float fourth) noexcept :
First{ first }, Second{ second }, Third{ third }, Fourth{ fourth } { }
};
class CLandingGearState
{
public:
float CurrentPosition{ };
float TargetPosition{ };
constexpr CLandingGearState() noexcept = default;
constexpr CLandingGearState(const float currentPosition, const float targetPosition) noexcept :
CurrentPosition{ currentPosition }, TargetPosition{ targetPosition } { }
};
class CState
{
public:
virtual ~CState() noexcept = default;
#ifdef TRILOGY_ONLINE_CLIENT
virtual void OnStreamIn(CVehicle& vehicle) { }
virtual void OnStreamOut(CVehicle& vehicle) { }
virtual void OnSyncingUserDataUpdated(CVehicle& vehicle, const UInt64 oldValue, const UInt64 newValue) { }
#endif
#ifdef TRILOGY_ONLINE_SERVER
virtual void OnStreamIn(CVehicle& vehicle, CPlayer& forPlayer) { }
virtual void OnStreamOut(CVehicle& vehicle, CPlayer& forPlayer) { }
virtual void OnPlayerEnters(CVehicle& vehicle, CPlayer& player, bool& isOk) { }
virtual void OnPlayerEntered(CVehicle& vehicle, CPlayer& player, const bool isDriver, const CPlayer::ESeat seat, bool& isOk) { }
virtual void OnPlayerLeaves(CVehicle& vehicle, CPlayer& player, bool& isOk) { }
virtual void OnPlayerLeft(CVehicle& vehicle, CPlayer& player, bool& isOk) { }
virtual void OnLandingGearStateUpdated(CVehicle& vehicle, CPlayer& byPlayer, const CLandingGearState& newLandingGearState, bool& isOk) { }
virtual void OnMovablePartAngleUpdated(CVehicle& vehicle, CPlayer& byPlayer, const float newAngle, bool& isOk) { }
virtual void OnPlaceUpdated(CVehicle& vehicle, CPlayer& byPlayer, const CVector3DFloat& newPosition, const CVector3DFloat& newVelocity, const CVector3DFloat& newRotation, const CVector3DFloat& newRotationalVelocity, bool& isOk) { }
virtual void OnUnoccupiedPlaceUpdated(CVehicle& vehicle, CPlayer& byPlayer, const CVector3DFloat& newPosition, const CVector3DFloat& newVelocity, const CVector3DFloat& newRotation, const CVector3DFloat& newRotationalVelocity, bool& isOk) { }
virtual void OnHealthUpdated(CVehicle& vehicle, CPlayer& byPlayer, const float newHealth, bool& isOk) { }
virtual void OnTiresStateUpdated(CVehicle& vehicle, CPlayer& byPlayer, const ETireState newFrontLeft, const ETireState newRearLeft, const ETireState newFrontRight, const ETireState newRearRight, bool& isOk) { }
virtual void OnDoorsStateUpdated(CVehicle& vehicle, CPlayer& byPlayer, const EDoorState newBonnet, const EDoorState newBoot, const EDoorState newFrontLeft, const EDoorState newFrontRight, const EDoorState newRearLeft, const EDoorState newRearRight, bool& isOk) { }
virtual void OnLightsStateUpdated(CVehicle& vehicle, CPlayer& byPlayer, const ELightState newFrontLeft, const ELightState newFrontRight, const ELightState newRearRight, const ELightState newRearLeft, bool& isOk) { }
virtual void OnPanelsStateUpdated(CVehicle& vehicle, CPlayer& byPlayer, const EPanelState newWingFrontLeft, const EPanelState newWingFrontRight, const EPanelState newWingRearLeft, const EPanelState newWingRearRight, const EPanelState newWindscreen, const EPanelState newBumperFront, const EPanelState newBumperRear, bool& isOk) { }
virtual void OnExploded(CVehicle& vehicle, CPlayer& byPlayer, bool& isOk) { }
virtual void OnEngineBroken(CVehicle& vehicle, CPlayer& byPlayer, bool& isOk) { }
#endif
};
virtual void SetState(CState* const value) noexcept = 0;
[[nodiscard]]
virtual CState* GetState() const noexcept = 0;
virtual void AddMod(const UInt32 modelId) = 0;
virtual void RemoveMod(const UInt32 modelId) = 0;
virtual void AttachToVehicle(CVehicle& vehicle, const CVector3DFloat& offset, const CVector3DFloat& rotation) = 0;
virtual void AttachToObject(CObject& object, const CVector3DFloat& offset, const CVector3DFloat& rotation) = 0;
virtual void SetPainting(const CPainting& value) = 0;
[[nodiscard]]
virtual CPainting GetPainting() const = 0;
virtual void SetPaintjob(const UInt8 value) = 0;
[[nodiscard]]
virtual UInt8 GetPaintjob() const = 0;
virtual void SetHydraulicForces(const CHydraulicForces& value) = 0;
[[nodiscard]]
virtual CHydraulicForces GetHydraulicForces() const = 0;
virtual void ResetHydraulics() = 0;
virtual void SetMovablePartAngle(const float value) = 0;
[[nodiscard]]
virtual float GetMovablePartAngle() const = 0;
virtual void ToggleTireInvulnerability(const bool value) = 0;
[[nodiscard]]
virtual bool IsTireInvulnerable() const = 0;
virtual void SetDoorOpenRatio(const EDoor door, const float openRatio, const bool hasSound) = 0;
[[nodiscard]]
virtual float GetDoorOpenRatio(const EDoor door) const = 0;
virtual void SetTireState(const ETire tire, const ETireState tireState, const bool hasPhysicalEffectForBurstState = true) = 0;
[[nodiscard]]
virtual ETireState GetTireState(const ETire tire) const = 0;
virtual void SetDoorState(const EDoor door, const EDoorState doorState, const bool spawnFlyingComponentForMissingState = false) = 0;
[[nodiscard]]
virtual EDoorState GetDoorState(const EDoor door) const = 0;
virtual void SetPanelState(const EPanel panel, const EPanelState panelState, const bool spawnFlyingComponentForMissingState = false) = 0;
[[nodiscard]]
virtual EPanelState GetPanelState(const EPanel panel) const = 0;
virtual void SetLightState(const ELight light, const ELightState lightState) = 0;
[[nodiscard]]
virtual ELightState GetLightState(const ELight light) const = 0;
virtual void SetLightsState(const ELightsState value) = 0;
[[nodiscard]]
virtual ELightsState GetLightsState() const = 0;
virtual void ToggleTaxiLights(const bool value) = 0;
[[nodiscard]]
virtual bool IsTaxiLightsEnabled() const = 0;
virtual void ToggleSiren(const bool value) = 0;
[[nodiscard]]
virtual bool IsSirenEnabled() const = 0;
virtual void ToggleEngineBroken(const bool value) = 0;
[[nodiscard]]
virtual bool IsEngineBroken() const = 0;
virtual void ToggleEngine(const bool value) = 0;
[[nodiscard]]
virtual bool IsEngineRunning() const = 0;
virtual void SetHealth(const float value) = 0;
[[nodiscard]]
virtual float GetHealth() const = 0;
virtual void ToggleInvulnerability(const bool value) = 0;
[[nodiscard]]
virtual bool IsInvulnerable() const = 0;
virtual void ToggleWatertight(const bool value) = 0;
[[nodiscard]]
virtual bool IsWatertightEnabled() const = 0;
virtual void SetDirtLevel(const float value) = 0;
[[nodiscard]]
virtual float GetDirtLevel() const = 0;
virtual void Fix() = 0;
virtual void Explode() = 0;
[[nodiscard]]
virtual bool IsExploded() const = 0;
virtual void SetLandingGearState(const CLandingGearState& value) = 0;
[[nodiscard]]
virtual CLandingGearState GetLandingGearState() const = 0;
virtual void SetDoorLockState(const EDoorLockState value) = 0;
[[nodiscard]]
virtual EDoorLockState GetDoorLockState() const = 0;
};
class CBlip : public CPlaceable
{
public:
static constexpr auto Maximum = 100000u;
enum class ESprite : UInt8
{
None,
White,
Centre,
MapHere,
North,
Airyard,
AmmuGun,
Barbers,
BigSmoke,
Boatyard,
BurgerShot,
Bulldozer,
CatalinaPink,
CesarViapando,
Chicken,
CJ,
CRASH,
Diner,
EmmetGun,
EnemyAttack,
Fire,
Girlfriend,
Hostpital,
LocoSyndicate,
MaddDogg,
MafiaCasino,
MCStrap,
ModGarage,
OGLoc,
Pizza,
Police,
PropertyGreen,
PropertyRed,
Race,
Ryder,
SaveGame,
School,
QuestionMark,
Sweet,
Tattoo,
TheTruth,
Waypoint,
TorenoRanch,
Triads,
TriadsCasino,
Tshirt,
Woozie,
Zero,
Disco,
Drink,
Food,
Truck,
Cash,
Flag,
GYM,
Impound,
Light,
Runway,
GangBlue,
GangPurple,
GangYellow,
GangN, // N?
GangGreen,
Spray
};
enum class EColor : UInt8
{
Red,
Green,
Blue,
White,
Yellow,
RedCopy,
BlueCopy,
Threat,
Destination
};
class CState
{
public:
virtual ~CState() noexcept = default;
#ifdef TRILOGY_ONLINE_CLIENT
virtual void OnStreamIn(CBlip& blip) { }
virtual void OnStreamOut(CBlip& blip) { }
virtual void OnSyncingUserDataUpdated(CBlip& blip, const UInt64 oldValue, const UInt64 newValue) { }
#endif
#ifdef TRILOGY_ONLINE_SERVER
virtual void OnStreamIn(CBlip& blip, CPlayer& forPlayer) { }
virtual void OnStreamOut(CBlip& blip, CPlayer& forPlayer) { }
#endif
};
virtual void SetState(CState* const value) noexcept = 0;
[[nodiscard]]
virtual CState* GetState() const noexcept = 0;
virtual void SetSprite(const ESprite value) = 0;
[[nodiscard]]
virtual ESprite GetSprite() const = 0;
virtual void SetColor(const EColor value) = 0;
[[nodiscard]]
virtual EColor GetColor() const = 0;
virtual void ToggleShortRange(const bool value) = 0;
[[nodiscard]]
virtual bool IsShortRange() const = 0;
virtual void SetScale(const UInt16 value) = 0;
[[nodiscard]]
virtual UInt16 GetScale() const = 0;
};
class CCheckpoint : public CPlaceable
{
public:
static constexpr auto Maximum = 100000u;
enum class EType : UInt8
{
Normal,
Finish,
Nothing,
AirNormal,
AirFinish,
AirRotatesAndStops,
AirIncreasesAndDecreasesAndDisappears,
AirSwingsDownAndUp1,
AirSwingsDownAndUp2
};
class CState
{
public:
virtual ~CState() noexcept = default;
#ifdef TRILOGY_ONLINE_CLIENT
virtual void OnStreamIn(CCheckpoint& checkpoint) { }
virtual void OnStreamOut(CCheckpoint& checkpoint) { }
virtual void OnPlayerEntered(CCheckpoint& checkpoint) { }
virtual void OnPlayerLeft(CCheckpoint& checkpoint) { }
virtual void OnSyncingUserDataUpdated(CCheckpoint& checkpoint, const UInt64 oldValue, const UInt64 newValue) { }
#endif
#ifdef TRILOGY_ONLINE_SERVER
virtual void OnStreamIn(CCheckpoint& checkpoint, CPlayer& forPlayer) { }
virtual void OnStreamOut(CCheckpoint& checkpoint, CPlayer& forPlayer) { }
virtual void OnPlayerEntered(CCheckpoint& checkpoint, CPlayer& player) { }
virtual void OnPlayerLeft(CCheckpoint& checkpoint, CPlayer& player) { }
#endif
};
virtual void SetState(CState* const value) noexcept = 0;
[[nodiscard]]
virtual CState* GetState() const noexcept = 0;
virtual void SetType(const EType value) = 0;
[[nodiscard]]
virtual EType GetType() const = 0;
virtual void SetNextPosition(const CVector3DFloat& value) = 0;
[[nodiscard]]
virtual CVector3DFloat GetNextPosition() const = 0;
virtual void SetRadius(const float value) = 0;
[[nodiscard]]
virtual float GetRadius() const = 0;
virtual void SetColor(const UInt32 value) = 0;
[[nodiscard]]
virtual UInt32 GetColor() const = 0;
virtual void SetPulsePeriod(const UInt16 value) = 0;
[[nodiscard]]
virtual UInt16 GetPulsePeriod() const = 0;
virtual void SetPulseFraction(const float value) = 0;
[[nodiscard]]
virtual float GetPulseFraction() const = 0;
virtual void SetRotateRate(const UInt16 value) = 0;
[[nodiscard]]
virtual UInt16 GetRotateRate() const = 0;
};
class CObject : public CPhysical
{
public:
static constexpr auto Maximum = 100000u;
class CState
{
public:
virtual ~CState() noexcept = default;
virtual void OnMoved(CObject& object) { }
#ifdef TRILOGY_ONLINE_CLIENT
virtual void OnStreamIn(CObject& object) { }
virtual void OnStreamOut(CObject& object) { }
virtual void OnSyncingUserDataUpdated(CObject& object, const UInt64 oldValue, const UInt64 newValue) { }
#endif
#ifdef TRILOGY_ONLINE_SERVER
virtual void OnStreamIn(CObject& object, CPlayer& forPlayer) { }
virtual void OnStreamOut(CObject& object, CPlayer& forPlayer) { }
#endif
};
virtual void SetState(CState* const value) noexcept = 0;
[[nodiscard]]
virtual CState* GetState() const noexcept = 0;
virtual void AttachToVehicle(CVehicle& vehicle, const CVector3DFloat& offset, const CVector3DFloat& rotation) = 0;
virtual void AttachToPlayer(CPlayer& player, const CVector3DFloat& offset, const CVector3DFloat& rotation) = 0;
virtual void AttachToObject(CObject& object, const CVector3DFloat& offset, const CVector3DFloat& rotation) = 0;
virtual void SetHealth(const float value) = 0;
[[nodiscard]]
virtual float GetHealth() const = 0;
virtual void SetDoorStartAngle(const float value) = 0;
[[nodiscard]]
virtual float GetDoorStartAngle() const = 0;
virtual void SetScale(const float value) = 0;