2021-12-05 17:54:36 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Entity.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Extended Entity for player data and behavior.
|
|
|
|
*
|
|
|
|
* Contains properties only a player entity would require, like associated SystemAddress and User.
|
|
|
|
*
|
|
|
|
* Keeps track of which entities are observed by this user for ghosting.
|
|
|
|
*/
|
|
|
|
class Player final : public Entity
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit Player(const LWOOBJID& objectID, EntityInfo info, User* user, Entity* parentEntity = nullptr);
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
/**
|
|
|
|
* Getters
|
|
|
|
*/
|
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
User* GetParentUser() const override { return m_ParentUser; };
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
const SystemAddress& GetSystemAddress() const override { return m_SystemAddress; };
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
const NiPoint3& GetRespawnPosition() const override { return m_respawnPos; };
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
const NiQuaternion& GetRespawnRotation() const override { return m_respawnRot; };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
const NiPoint3& GetGhostReferencePoint() const { return m_GhostOverride ? m_GhostOverridePoint : m_GhostReferencePoint; };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
const NiPoint3& GetOriginGhostReferencePoint() const { return m_GhostReferencePoint; };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
const NiPoint3& GetGhostOverridePoint() const { return m_GhostOverridePoint; };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
bool GetGhostOverride() const { return m_GhostOverride; };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
std::map<LWOOBJID, Loot::Info>& GetDroppedLoot() { return m_DroppedLoot; };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
uint64_t GetDroppedCoins() const { return m_DroppedCoins; };
|
2021-12-11 13:21:00 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
/**
|
|
|
|
* Setters
|
|
|
|
*/
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
void SetGhostOverride(bool value) { m_GhostOverride = value; };
|
|
|
|
|
|
|
|
void SetDroppedCoins(const uint64_t value) { m_DroppedCoins = value; };
|
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
void SetSystemAddress(const SystemAddress& value) override;
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
void SetRespawnPos(const NiPoint3& position) override;
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
void SetRespawnRot(const NiQuaternion& rotation) override;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
void SetGhostReferencePoint(const NiPoint3& value);
|
|
|
|
|
|
|
|
void SetGhostOverridePoint(const NiPoint3& value);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Ghosting
|
|
|
|
*/
|
|
|
|
|
|
|
|
void AddLimboConstruction(LWOOBJID objectId);
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
void RemoveLimboConstruction(LWOOBJID objectId);
|
|
|
|
|
|
|
|
void ConstructLimboEntities();
|
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
void ObserveEntity(const int32_t id);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
bool IsObserved(const int32_t id);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
void GhostEntity(const int32_t id);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
~Player() override;
|
|
|
|
private:
|
|
|
|
SystemAddress m_SystemAddress;
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
NiPoint3 m_respawnPos;
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
NiQuaternion m_respawnRot;
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
User* m_ParentUser;
|
|
|
|
|
|
|
|
NiPoint3 m_GhostReferencePoint;
|
|
|
|
|
|
|
|
NiPoint3 m_GhostOverridePoint;
|
|
|
|
|
|
|
|
bool m_GhostOverride;
|
|
|
|
|
|
|
|
std::vector<int32_t> m_ObservedEntities;
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
std::vector<LWOOBJID> m_LimboConstructions;
|
|
|
|
|
|
|
|
std::map<LWOOBJID, Loot::Info> m_DroppedLoot;
|
|
|
|
|
2021-12-11 13:21:00 +00:00
|
|
|
uint64_t m_DroppedCoins;
|
2021-12-05 17:54:36 +00:00
|
|
|
};
|