chore: Simplify and move Player functionality to relevant component (#1408)

* Moving and organizing Player code

- Move code to CharacterComponent
- Remove extraneous interfaces
- Simplify some code greatly
- Change some types to return and take in const ref (only structs larger than 8 bytes benefit from this change.)
- Update code to use CharacterComponent for sending to zone instead of Player*.

* Moving and organizing Player code

- Move code to CharacterComponent
- Remove extraneous interfaces
- Simplify some code greatly
- Change some types to return and take in const ref (only structs larger than 8 bytes benefit from this change.)
- Update code to use CharacterComponent for sending to zone instead of Player*.
- Remove static storage container (static containers can be destroyed before exit/terminate handler executes)

* remove player cast

* Remove extra includes
This commit is contained in:
David Markowitz
2024-01-12 09:39:51 -08:00
committed by GitHub
parent 66cc582a9a
commit 929d029f12
15 changed files with 200 additions and 305 deletions

View File

@@ -106,7 +106,7 @@ public:
virtual User* GetParentUser() const;
virtual SystemAddress GetSystemAddress() const { return UNASSIGNED_SYSTEM_ADDRESS; };
virtual const SystemAddress& GetSystemAddress() const { return UNASSIGNED_SYSTEM_ADDRESS; };
/**
* Setters
@@ -124,13 +124,13 @@ public:
void SetNetworkId(uint16_t id);
void SetPosition(NiPoint3 position);
void SetPosition(const NiPoint3& position);
void SetRotation(NiQuaternion rotation);
void SetRotation(const NiQuaternion& rotation);
virtual void SetRespawnPos(NiPoint3 position) {}
virtual void SetRespawnPos(const NiPoint3& position) {}
virtual void SetRespawnRot(NiQuaternion rotation) {}
virtual void SetRespawnRot(const NiQuaternion& rotation) {}
virtual void SetSystemAddress(const SystemAddress& value) {};
@@ -229,8 +229,8 @@ public:
void TriggerEvent(eTriggerEventType event, Entity* optionalTarget = nullptr);
void ScheduleDestructionAfterUpdate() { m_ShouldDestroyAfterUpdate = true; }
virtual NiPoint3 GetRespawnPosition() const { return NiPoint3::ZERO; }
virtual NiQuaternion GetRespawnRotation() const { return NiQuaternion::IDENTITY; }
virtual const NiPoint3& GetRespawnPosition() const { return NiPoint3::ZERO; }
virtual const NiQuaternion& GetRespawnRotation() const { return NiQuaternion::IDENTITY; }
void Sleep();
void Wake();