2023-06-07 07:23:50 +00:00
|
|
|
#ifndef __ENTITY__H__
|
|
|
|
#define __ENTITY__H__
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
#include <memory>
|
2023-06-16 08:01:13 +00:00
|
|
|
#include <functional>
|
2023-01-07 05:17:05 +00:00
|
|
|
#include <unordered_map>
|
2021-12-05 17:54:36 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2023-06-15 09:28:27 +00:00
|
|
|
#include "dCommonVars.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
#include "NiPoint3.h"
|
|
|
|
#include "NiQuaternion.h"
|
2023-05-02 22:39:21 +00:00
|
|
|
#include "eKillType.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-01-07 05:17:05 +00:00
|
|
|
namespace Loot {
|
|
|
|
class Info;
|
|
|
|
};
|
|
|
|
|
|
|
|
namespace tinyxml2 {
|
|
|
|
class XMLDocument;
|
|
|
|
};
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
class Player;
|
2023-01-07 05:17:05 +00:00
|
|
|
class EntityInfo;
|
|
|
|
class User;
|
2021-12-05 17:54:36 +00:00
|
|
|
class Spawner;
|
|
|
|
class ScriptComponent;
|
|
|
|
class dpEntity;
|
2023-01-07 05:17:05 +00:00
|
|
|
class EntityTimer;
|
2021-12-05 17:54:36 +00:00
|
|
|
class Component;
|
2022-12-21 22:33:41 +00:00
|
|
|
class Item;
|
2021-12-05 17:54:36 +00:00
|
|
|
class Character;
|
2023-01-07 05:17:05 +00:00
|
|
|
class EntityCallbackTimer;
|
2023-06-15 09:28:27 +00:00
|
|
|
class LDFBaseData;
|
2023-02-10 08:29:53 +00:00
|
|
|
enum class eTriggerEventType;
|
2023-03-24 23:16:45 +00:00
|
|
|
enum class eGameMasterLevel : uint8_t;
|
2023-03-04 07:16:37 +00:00
|
|
|
enum class eReplicaComponentType : uint32_t;
|
2023-05-02 22:39:21 +00:00
|
|
|
enum class eReplicaPacketType : uint8_t;
|
|
|
|
enum class eCinematicEvent : uint32_t;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-12-21 22:33:41 +00:00
|
|
|
namespace CppScripts {
|
|
|
|
class Script;
|
|
|
|
};
|
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
/**
|
2023-06-09 08:04:42 +00:00
|
|
|
* An entity in the world.
|
|
|
|
* Entities are composed of components which define their behavior.
|
2021-12-05 17:54:36 +00:00
|
|
|
*/
|
2023-06-07 03:48:30 +00:00
|
|
|
|
2023-06-09 08:22:45 +00:00
|
|
|
using ComponentPtr = std::unique_ptr<Component>;
|
2023-06-10 06:02:28 +00:00
|
|
|
using ComponentWhitelist = std::vector<eReplicaComponentType>;
|
2023-06-10 07:14:20 +00:00
|
|
|
using TemplateComponents = std::vector<std::pair<eReplicaComponentType, uint32_t>>;
|
2023-06-09 08:04:42 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
class Entity {
|
|
|
|
public:
|
2022-07-28 13:39:57 +00:00
|
|
|
explicit Entity(const LWOOBJID& objectID, EntityInfo info, Entity* parentEntity = nullptr);
|
|
|
|
virtual ~Entity();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-10 11:46:48 +00:00
|
|
|
void ApplyComponentWhitelist(TemplateComponents& components) const;
|
2023-06-10 06:02:28 +00:00
|
|
|
static const std::vector<ComponentWhitelist>& GetComponentWhitelists() { return m_ComponentWhitelists; }
|
2023-06-10 11:46:48 +00:00
|
|
|
|
|
|
|
// There are some very very edge cases we need to take care of with what components
|
|
|
|
// are kept and removed. Here is where we take care of those cases.
|
|
|
|
void ApplyComponentBlacklist(TemplateComponents& components) const;
|
|
|
|
|
|
|
|
// For adding and removing components based on LDF keys
|
|
|
|
void ApplyComponentConfig(TemplateComponents& components) const;
|
2023-06-12 08:29:43 +00:00
|
|
|
|
|
|
|
// Paths have several components they could add. This function will add them.
|
|
|
|
void AddPathComponent(TemplateComponents& components) const;
|
|
|
|
|
|
|
|
void IsGhosted();
|
2021-12-05 17:54:36 +00:00
|
|
|
virtual void Initialize();
|
2022-07-28 13:39:57 +00:00
|
|
|
|
|
|
|
bool operator==(const Entity& other) const;
|
|
|
|
bool operator!=(const Entity& other) const;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Getters
|
|
|
|
*/
|
2023-06-09 08:04:42 +00:00
|
|
|
Character* GetCharacter() const { return m_Character; }
|
|
|
|
void SetCharacter(Character* value) { m_Character = value; }
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
const LWOOBJID GetObjectID() const { return m_ObjectID; }
|
2022-07-28 13:39:57 +00:00
|
|
|
|
|
|
|
const LOT GetLOT() const { return m_TemplateID; }
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-03-24 23:16:45 +00:00
|
|
|
eGameMasterLevel GetGMLevel() const { return m_GMLevel; }
|
2023-06-09 08:04:42 +00:00
|
|
|
void SetGMLevel(const eGameMasterLevel value);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
Entity* GetParentEntity() const { return m_ParentEntity; }
|
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
const std::vector<std::string>& GetGroups() { return m_Groups; };
|
|
|
|
void SetGroups(const std::vector<std::string>& value) { m_Groups = value; }
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
Spawner* GetSpawner() const { return m_Spawner; }
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
LWOOBJID GetSpawnerID() const { return m_SpawnerID; }
|
|
|
|
|
|
|
|
const std::vector<LDFBaseData*>& GetSettings() const { return m_Settings; }
|
|
|
|
|
|
|
|
const std::vector<LDFBaseData*>& GetNetworkSettings() const { return m_NetworkSettings; }
|
|
|
|
|
|
|
|
bool GetIsDead() const;
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
bool GetPlayerReadyForUpdates() const { return m_PlayerIsReadyForUpdates; }
|
2023-06-09 08:04:42 +00:00
|
|
|
void SetPlayerReadyForUpdates() { m_PlayerIsReadyForUpdates = true; }
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
const bool GetIsGhostingCandidate() const { return m_IsGhostingCandidate; }
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
const int8_t GetObservers() const { return m_Observers; }
|
|
|
|
void SetObservers(const int8_t value);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
const uint16_t GetNetworkId() const { return m_NetworkID; }
|
2023-06-16 08:01:13 +00:00
|
|
|
void SetNetworkId(const uint16_t id) { m_NetworkID = id; }
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
Entity* GetOwner() const;
|
2023-06-16 08:01:13 +00:00
|
|
|
void SetOwnerOverride(const LWOOBJID& value) { m_OwnerOverride = value; };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-16 08:01:13 +00:00
|
|
|
const NiPoint3& GetDefaultPosition() const { return m_DefaultPosition; };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-16 08:01:13 +00:00
|
|
|
const NiQuaternion& GetDefaultRotation() const { return m_DefaultRotation; };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
const float GetDefaultScale() const { return m_Scale; }
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
const NiPoint3& GetPosition() const;
|
2023-06-09 08:04:42 +00:00
|
|
|
void SetPosition(const NiPoint3& position);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
const NiQuaternion& GetRotation() const;
|
2023-06-09 08:04:42 +00:00
|
|
|
void SetRotation(const NiQuaternion& rotation);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
virtual User* GetParentUser() const;
|
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
virtual const SystemAddress GetSystemAddress() const { return UNASSIGNED_SYSTEM_ADDRESS; };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
virtual void SetRespawnPos(const NiPoint3& position) {};
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
virtual void SetRespawnRot(const NiQuaternion& rotation) {};
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
virtual void SetSystemAddress(const SystemAddress& value) {};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Component management
|
|
|
|
*/
|
2023-06-09 08:04:42 +00:00
|
|
|
bool HasComponent(const eReplicaComponentType componentId) const;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
void Subscribe(const LWOOBJID& scriptObjId, CppScripts::Script* scriptToAdd, const std::string& notificationName);
|
|
|
|
void Unsubscribe(const LWOOBJID& scriptObjId, const std::string& notificationName);
|
2022-12-21 22:33:41 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
void SetProximityRadius(const float proxRadius, const std::string& name);
|
|
|
|
void SetProximityRadius(dpEntity* entity, const std::string& name);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
void AddChild(Entity* child);
|
2022-06-17 00:50:33 +00:00
|
|
|
void RemoveChild(Entity* child);
|
2022-07-17 04:39:13 +00:00
|
|
|
void RemoveParent();
|
2023-06-09 08:04:42 +00:00
|
|
|
void AddTimer(const std::string& name, const float time);
|
|
|
|
void AddCallbackTimer(const float time, const std::function<void()>& callback);
|
2021-12-05 17:54:36 +00:00
|
|
|
bool HasTimer(const std::string& name);
|
|
|
|
void CancelCallbackTimers();
|
|
|
|
void CancelAllTimers();
|
|
|
|
void CancelTimer(const std::string& name);
|
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
void AddToGroups(const std::string& group);
|
2021-12-05 17:54:36 +00:00
|
|
|
bool IsPlayer() const;
|
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
void WriteBaseReplicaData(RakNet::BitStream* outBitStream, const eReplicaPacketType packetType);
|
|
|
|
void WriteComponents(RakNet::BitStream* outBitStream, const eReplicaPacketType packetType);
|
2022-07-28 13:39:57 +00:00
|
|
|
void ResetFlags();
|
|
|
|
void UpdateXMLDoc(tinyxml2::XMLDocument* doc);
|
2021-12-05 17:54:36 +00:00
|
|
|
void Update(float deltaTime);
|
|
|
|
|
|
|
|
// Events
|
2023-06-09 08:04:42 +00:00
|
|
|
void OnCollisionProximity(const LWOOBJID otherEntity, const std::string& proxName, const std::string& status);
|
|
|
|
void OnCollisionPhantom(const LWOOBJID otherEntity);
|
|
|
|
void OnCollisionLeavePhantom(const LWOOBJID otherEntity);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
void OnFireEventServerSide(Entity* sender, const std::string args, const int32_t param1 = -1, const int32_t param2 = -1, const int32_t param3 = -1);
|
2022-07-28 13:39:57 +00:00
|
|
|
void OnActivityStateChangeRequest(const LWOOBJID senderID, const int32_t value1, const int32_t value2,
|
|
|
|
const std::u16string& stringValue);
|
2023-06-09 08:04:42 +00:00
|
|
|
void OnCinematicUpdate(Entity* self, Entity* sender, const eCinematicEvent event, const std::u16string& pathName,
|
|
|
|
const float pathTime, const float totalTime, const int32_t waypoint);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-16 08:01:13 +00:00
|
|
|
void NotifyObject(Entity* sender, const std::u16string& name, const int32_t param1 = 0, const int32_t param2 = 0);
|
2023-06-09 08:04:42 +00:00
|
|
|
void OnEmoteReceived(const int32_t emote, Entity* target);
|
2022-07-28 13:39:57 +00:00
|
|
|
|
|
|
|
void OnUse(Entity* originator);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
void OnHitOrHealResult(Entity* attacker, const int32_t damage);
|
2021-12-05 17:54:36 +00:00
|
|
|
void OnHit(Entity* attacker);
|
|
|
|
|
|
|
|
void OnZonePropertyEditBegin();
|
|
|
|
void OnZonePropertyEditEnd();
|
|
|
|
void OnZonePropertyModelEquipped();
|
|
|
|
void OnZonePropertyModelPlaced(Entity* player);
|
|
|
|
void OnZonePropertyModelPickedUp(Entity* player);
|
|
|
|
void OnZonePropertyModelRemoved(Entity* player);
|
|
|
|
void OnZonePropertyModelRemovedWhileEquipped(Entity* player);
|
|
|
|
void OnZonePropertyModelRotated(Entity* player);
|
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
void OnMessageBoxResponse(Entity* sender, const int32_t button, const std::u16string& identifier, const std::u16string& userData);
|
|
|
|
void OnChoiceBoxResponse(Entity* sender, const int32_t button, const std::u16string& buttonIdentifier, const std::u16string& identifier);
|
|
|
|
void RequestActivityExit(Entity* sender, const LWOOBJID& player, const bool canceled);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
void Smash(const LWOOBJID source = LWOOBJID_EMPTY, const eKillType killType = eKillType::VIOLENT, const std::u16string& deathType = u"");
|
|
|
|
void Kill(Entity* murderer = nullptr);
|
2022-07-28 13:39:57 +00:00
|
|
|
void AddRebuildCompleteCallback(const std::function<void(Entity* user)>& callback) const;
|
2023-06-16 08:01:13 +00:00
|
|
|
void AddCollisionPhantomCallback(const std::function<void(Entity* target)>& callback) { m_PhantomCollisionCallbacks.push_back(callback); };
|
|
|
|
void AddDieCallback(const std::function<void()>& callback) { m_DieCallbacks.push_back(callback); };
|
2021-12-05 17:54:36 +00:00
|
|
|
void Resurrect();
|
|
|
|
|
|
|
|
void AddLootItem(const Loot::Info& info);
|
|
|
|
void PickupItem(const LWOOBJID& objectID);
|
|
|
|
|
2023-06-16 08:01:13 +00:00
|
|
|
bool CanPickupCoins(const uint64_t& count) const;
|
|
|
|
void PickupCoins(const uint64_t& count);
|
2023-06-09 08:04:42 +00:00
|
|
|
void RegisterCoinDrop(const uint64_t& count);
|
2021-12-11 13:21:00 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
void ScheduleKillAfterUpdate(Entity* murderer = nullptr);
|
2023-06-09 08:04:42 +00:00
|
|
|
void TriggerEvent(const eTriggerEventType event, Entity* optionalTarget = nullptr);
|
2021-12-05 17:54:36 +00:00
|
|
|
void ScheduleDestructionAfterUpdate() { m_ShouldDestroyAfterUpdate = true; }
|
|
|
|
|
|
|
|
virtual NiPoint3 GetRespawnPosition() const { return NiPoint3::ZERO; }
|
|
|
|
virtual NiQuaternion GetRespawnRotation() const { return NiQuaternion::IDENTITY; }
|
2023-06-12 22:32:46 +00:00
|
|
|
CppScripts::Script* GetScript() const;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
void Sleep();
|
|
|
|
void Wake();
|
|
|
|
bool IsSleeping() const;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Utility
|
|
|
|
*/
|
2023-06-09 08:04:42 +00:00
|
|
|
|
|
|
|
//Retroactively corrects the model vault size due to incorrect initialization in a previous patch.
|
2022-04-13 08:49:55 +00:00
|
|
|
void RetroactiveVaultSize();
|
2023-06-16 08:01:13 +00:00
|
|
|
bool GetBoolean(const std::u16string& name) const { return GetVar<bool>(name); };
|
|
|
|
int32_t GetI32(const std::u16string& name) const { return GetVar<int32_t>(name); };
|
|
|
|
int64_t GetI64(const std::u16string& name) const { return GetVar<int64_t>(name); };
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2023-06-16 08:01:13 +00:00
|
|
|
void SetBoolean(const std::u16string& name, bool value) { SetVar<bool>(name, value); }
|
|
|
|
void SetI32(const std::u16string& name, int32_t value) { SetVar<int32_t>(name, value); };
|
|
|
|
void SetI64(const std::u16string& name, int64_t value) { SetVar<int64_t>(name, value); };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
bool HasVar(const std::u16string& name) const;
|
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
/**
|
|
|
|
* Get the LDF data.
|
|
|
|
*/
|
|
|
|
LDFBaseData* GetVarData(const std::u16string& name) const;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
/**
|
|
|
|
* Get the LDF value and convert it to a string.
|
|
|
|
*/
|
|
|
|
std::string GetVarAsString(const std::u16string& name) const;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
/*
|
|
|
|
* Collision
|
|
|
|
*/
|
|
|
|
std::vector<LWOOBJID>& GetTargetsInPhantom();
|
|
|
|
|
|
|
|
Entity* GetScheduledKiller() { return m_ScheduleKiller; }
|
|
|
|
|
|
|
|
const std::unordered_map<eReplicaComponentType, ComponentPtr>& GetComponents() { return m_Components; }
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
// Template declarations
|
2021-12-05 17:54:36 +00:00
|
|
|
template<typename T>
|
2023-06-09 08:04:42 +00:00
|
|
|
const T& GetVar(const std::u16string& name) const;
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
T GetVarAs(const std::u16string& name) const;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
template<typename T>
|
2023-06-09 08:04:42 +00:00
|
|
|
void SetVar(const std::u16string& name, const T& value);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
template<typename T>
|
|
|
|
T GetNetworkVar(const std::u16string& name);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
void SendNetworkVar(const std::string& data, const SystemAddress& sysAddr);
|
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
template<typename T>
|
2023-06-09 08:04:42 +00:00
|
|
|
void SetNetworkVar(const std::u16string& name, const T& value, const SystemAddress& sysAddr = UNASSIGNED_SYSTEM_ADDRESS);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
template<typename T>
|
|
|
|
void SetNetworkVar(const std::u16string& name, const std::vector<T>& value, const SystemAddress& sysAddr = UNASSIGNED_SYSTEM_ADDRESS);
|
2021-12-05 17:54:36 +00:00
|
|
|
/**
|
2023-06-09 08:04:42 +00:00
|
|
|
* @brief Get a non-owning reference to a component
|
|
|
|
*
|
|
|
|
* @tparam Cmpt The component to get a non-owning reference of
|
|
|
|
* @return Cmpt* The non-owning pointer to the component
|
2021-12-05 17:54:36 +00:00
|
|
|
*/
|
2023-06-09 08:04:42 +00:00
|
|
|
template<typename Cmpt>
|
|
|
|
Cmpt* GetComponent() const;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
/**
|
|
|
|
* @brief Adds a component to this Entity.
|
|
|
|
*
|
|
|
|
* @tparam Cmpt The component to create
|
|
|
|
* @tparam ConstructorValues The constructor values to forward to the component
|
|
|
|
* @param arguments The constructor values to forward to the component
|
|
|
|
* @return Cmpt* A non-owning pointer to the created component,
|
|
|
|
* or a non-owning pointer to the existing component if the component already existed.
|
2021-12-05 17:54:36 +00:00
|
|
|
*/
|
2023-06-09 08:04:42 +00:00
|
|
|
template<typename Cmpt, typename...ConstructorValues>
|
|
|
|
Cmpt* AddComponent(ConstructorValues... arguments);
|
2023-06-07 07:23:50 +00:00
|
|
|
|
2023-06-11 10:06:18 +00:00
|
|
|
/**
|
|
|
|
* @brief Removes a component from this Entity.
|
|
|
|
*/
|
|
|
|
template<typename Cmpt>
|
|
|
|
void RemoveComponent();
|
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
protected:
|
2022-07-28 13:39:57 +00:00
|
|
|
LWOOBJID m_ObjectID;
|
|
|
|
|
|
|
|
LOT m_TemplateID;
|
|
|
|
|
|
|
|
std::vector<LDFBaseData*> m_Settings;
|
|
|
|
std::vector<LDFBaseData*> m_NetworkSettings;
|
|
|
|
|
|
|
|
NiPoint3 m_DefaultPosition;
|
|
|
|
NiQuaternion m_DefaultRotation;
|
2021-12-05 17:54:36 +00:00
|
|
|
float m_Scale;
|
|
|
|
|
|
|
|
Spawner* m_Spawner;
|
2022-07-28 13:39:57 +00:00
|
|
|
LWOOBJID m_SpawnerID;
|
|
|
|
|
|
|
|
bool m_HasSpawnerNodeID;
|
|
|
|
uint32_t m_SpawnerNodeID;
|
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
Character* m_Character;
|
2022-07-28 13:39:57 +00:00
|
|
|
|
|
|
|
Entity* m_ParentEntity; //For spawners and the like
|
2021-12-05 17:54:36 +00:00
|
|
|
std::vector<Entity*> m_ChildEntities;
|
2023-03-24 23:16:45 +00:00
|
|
|
eGameMasterLevel m_GMLevel;
|
2021-12-05 17:54:36 +00:00
|
|
|
std::vector<std::string> m_Groups;
|
|
|
|
uint16_t m_NetworkID;
|
|
|
|
std::vector<std::function<void()>> m_DieCallbacks;
|
2023-06-09 08:04:42 +00:00
|
|
|
std::vector<std::function<void(Entity*)>> m_PhantomCollisionCallbacks;
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2023-06-07 03:48:30 +00:00
|
|
|
std::unordered_map<eReplicaComponentType, ComponentPtr> m_Components;
|
2023-06-15 06:16:31 +00:00
|
|
|
std::vector<std::unique_ptr<EntityTimer>> m_Timers;
|
|
|
|
std::vector<std::unique_ptr<EntityTimer>> m_PendingTimers;
|
|
|
|
std::vector<std::unique_ptr<EntityCallbackTimer>> m_CallbackTimers;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
bool m_ShouldDestroyAfterUpdate;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
LWOOBJID m_OwnerOverride;
|
|
|
|
|
|
|
|
Entity* m_ScheduleKiller;
|
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
bool m_PlayerIsReadyForUpdates;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
bool m_IsGhostingCandidate;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
int8_t m_Observers;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
bool m_IsParentChildDirty;
|
2022-06-16 05:58:38 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
/*
|
|
|
|
* Collision
|
|
|
|
*/
|
|
|
|
std::vector<LWOOBJID> m_TargetsInPhantom;
|
2023-06-10 06:02:28 +00:00
|
|
|
|
|
|
|
static const std::vector<ComponentWhitelist> m_ComponentWhitelists;
|
2021-12-05 17:54:36 +00:00
|
|
|
};
|
|
|
|
|
2023-06-09 08:04:42 +00:00
|
|
|
#include "Entity.tcc"
|
2023-06-07 07:23:50 +00:00
|
|
|
|
|
|
|
#endif //!__ENTITY__H__
|