breakout the component types into a scoped enum (#1002)

* breakout the component types into a scoped enum

tested that things are the same as they were before

* fix missed rename

* fix brick-by-brick name to be crafting
because that's what it is
This commit is contained in:
Aaron Kimbrell
2023-03-04 01:16:37 -06:00
committed by GitHub
parent 2837f68f44
commit e524b86e12
106 changed files with 598 additions and 430 deletions

View File

@@ -106,7 +106,7 @@ BaseCombatAIComponent::BaseCombatAIComponent(Entity* parent, const uint32_t id):
int32_t collisionGroup = (COLLISION_GROUP_DYNAMIC | COLLISION_GROUP_ENEMY);
CDComponentsRegistryTable* componentRegistryTable = CDClientManager::Instance()->GetTable<CDComponentsRegistryTable>("ComponentsRegistry");
auto componentID = componentRegistryTable->GetByIDAndType(parent->GetLOT(), COMPONENT_TYPE_CONTROLLABLE_PHYSICS);
auto componentID = componentRegistryTable->GetByIDAndType(parent->GetLOT(), eReplicaComponentType::CONTROLLABLE_PHYSICS);
CDPhysicsComponentTable* physicsComponentTable = CDClientManager::Instance()->GetTable<CDPhysicsComponentTable>("PhysicsComponent");

View File

@@ -8,6 +8,7 @@
#include "dpWorld.h"
#include "dpEntity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
#include <vector>
#include <map>
@@ -46,7 +47,7 @@ struct AiSkillEntry
*/
class BaseCombatAIComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_BASE_COMBAT_AI;
static const eReplicaComponentType ComponentType = eReplicaComponentType::BASE_COMBAT_AI;
BaseCombatAIComponent(Entity* parentEntity, uint32_t id);
~BaseCombatAIComponent() override;
@@ -245,7 +246,7 @@ private:
/**
* @brief Sets the AiState and prepares the entity for serialization next frame.
*
*
*/
void SetAiState(AiState newState);
@@ -377,7 +378,7 @@ private:
/**
* Whether or not the Component has dirty information and should update next frame
*
*
*/
bool m_DirtyStateOrTarget = false;

View File

@@ -5,13 +5,14 @@
#include "RakNetTypes.h"
#include "Entity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* Attached to bouncer entities, allowing other entities to bounce off of it
*/
class BouncerComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_BOUNCER;
static const eReplicaComponentType ComponentType = eReplicaComponentType::BOUNCER;
BouncerComponent(Entity* parentEntity);
~BouncerComponent() override;

View File

@@ -7,6 +7,7 @@
#include <unordered_map>
#include <map>
#include "Component.h"
#include "eReplicaComponentType.h"
class Entity;
@@ -41,7 +42,7 @@ struct Buff
*/
class BuffComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_BUFF;
static const eReplicaComponentType ComponentType = eReplicaComponentType::BUFF;
explicit BuffComponent(Entity* parent);

View File

@@ -9,13 +9,14 @@
#include "BitStream.h"
#include "Entity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* Component for the build border, allowing the user to start building when interacting with it
*/
class BuildBorderComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_BUILD_BORDER;
static const eReplicaComponentType ComponentType = eReplicaComponentType::BUILD_BORDER;
BuildBorderComponent(Entity* parent);
~BuildBorderComponent() override;

View File

@@ -9,6 +9,7 @@
#include <string>
#include "CDMissionsTable.h"
#include "tinyxml2.h"
#include "eReplicaComponentType.h"
/**
* The statistics that can be achieved per zone
@@ -59,7 +60,7 @@ enum StatisticID {
*/
class CharacterComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_CHARACTER;
static const eReplicaComponentType ComponentType = eReplicaComponentType::CHARACTER;
CharacterComponent(Entity* parent, Character* character);
~CharacterComponent() override;

View File

@@ -10,6 +10,7 @@
#include "dpCollisionChecks.h"
#include "PhantomPhysicsComponent.h"
#include "eBubbleType.h"
#include "eReplicaComponentType.h"
class Entity;
class dpEntity;
@@ -19,7 +20,7 @@ class dpEntity;
*/
class ControllablePhysicsComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_CONTROLLABLE_PHYSICS;
static const eReplicaComponentType ComponentType = eReplicaComponentType::CONTROLLABLE_PHYSICS;
ControllablePhysicsComponent(Entity* entity);
~ControllablePhysicsComponent() override;

View File

@@ -76,9 +76,9 @@ DestroyableComponent::~DestroyableComponent() {
void DestroyableComponent::Reinitialize(LOT templateID) {
CDComponentsRegistryTable* compRegistryTable = CDClientManager::Instance()->GetTable<CDComponentsRegistryTable>("ComponentsRegistry");
int32_t buffComponentID = compRegistryTable->GetByIDAndType(templateID, COMPONENT_TYPE_BUFF);
int32_t collectibleComponentID = compRegistryTable->GetByIDAndType(templateID, COMPONENT_TYPE_COLLECTIBLE);
int32_t rebuildComponentID = compRegistryTable->GetByIDAndType(templateID, COMPONENT_TYPE_REBUILD);
int32_t buffComponentID = compRegistryTable->GetByIDAndType(templateID, eReplicaComponentType::BUFF);
int32_t collectibleComponentID = compRegistryTable->GetByIDAndType(templateID, eReplicaComponentType::COLLECTIBLE);
int32_t rebuildComponentID = compRegistryTable->GetByIDAndType(templateID, eReplicaComponentType::QUICK_BUILD);
int32_t componentID = 0;
if (collectibleComponentID > 0) componentID = collectibleComponentID;
@@ -810,7 +810,7 @@ void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType
script->OnPlayerDied(zoneControl, m_Parent);
}
std::vector<Entity*> scriptedActs = EntityManager::Instance()->GetEntitiesByComponent(COMPONENT_TYPE_SCRIPTED_ACTIVITY);
std::vector<Entity*> scriptedActs = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::SCRIPTED_ACTIVITY);
for (Entity* scriptEntity : scriptedActs) {
if (scriptEntity->GetObjectID() != zoneControl->GetObjectID()) { // Don't want to trigger twice on instance worlds
for (CppScripts::Script* script : CppScripts::GetEntityScripts(scriptEntity)) {

View File

@@ -6,6 +6,7 @@
#include "tinyxml2.h"
#include "Entity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
namespace CppScripts {
class Script;
@@ -17,7 +18,7 @@ namespace CppScripts {
*/
class DestroyableComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_DESTROYABLE;
static const eReplicaComponentType ComponentType = eReplicaComponentType::DESTROYABLE;
DestroyableComponent(Entity* parentEntity);
~DestroyableComponent() override;

View File

@@ -48,7 +48,7 @@ InventoryComponent::InventoryComponent(Entity* parent, tinyxml2::XMLDocument* do
}
auto* compRegistryTable = CDClientManager::Instance()->GetTable<CDComponentsRegistryTable>("ComponentsRegistry");
const auto componentId = compRegistryTable->GetByIDAndType(lot, COMPONENT_TYPE_INVENTORY);
const auto componentId = compRegistryTable->GetByIDAndType(lot, eReplicaComponentType::INVENTORY);
auto* inventoryComponentTable = CDClientManager::Instance()->GetTable<CDInventoryComponentTable>("InventoryComponent");
auto items = inventoryComponentTable->Query([=](const CDInventoryComponent entry) { return entry.id == componentId; });
@@ -181,7 +181,7 @@ void InventoryComponent::AddItem(
inventoryType = Inventory::FindInventoryTypeForLot(lot);
}
auto* missions = static_cast<MissionComponent*>(this->m_Parent->GetComponent(COMPONENT_TYPE_MISSION));
auto* missions = static_cast<MissionComponent*>(this->m_Parent->GetComponent(eReplicaComponentType::MISSION));
auto* inventory = GetInventory(inventoryType);
@@ -818,7 +818,7 @@ void InventoryComponent::EquipItem(Item* item, const bool skipChecks) {
if (character != nullptr && !skipChecks) {
// Hacky proximity rocket
if (item->GetLot() == 6416) {
const auto rocketLauchPads = EntityManager::Instance()->GetEntitiesByComponent(COMPONENT_TYPE_ROCKET_LAUNCH);
const auto rocketLauchPads = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::ROCKET_LAUNCH);
const auto position = m_Parent->GetPosition();
@@ -914,7 +914,7 @@ void InventoryComponent::UnEquipItem(Item* item) {
void InventoryComponent::EquipScripts(Item* equippedItem) {
CDComponentsRegistryTable* compRegistryTable = CDClientManager::Instance()->GetTable<CDComponentsRegistryTable>("ComponentsRegistry");
if (!compRegistryTable) return;
int32_t scriptComponentID = compRegistryTable->GetByIDAndType(equippedItem->GetLot(), COMPONENT_TYPE_SCRIPT, -1);
int32_t scriptComponentID = compRegistryTable->GetByIDAndType(equippedItem->GetLot(), eReplicaComponentType::SCRIPT, -1);
if (scriptComponentID > -1) {
CDScriptComponentTable* scriptCompTable = CDClientManager::Instance()->GetTable<CDScriptComponentTable>("ScriptComponent");
CDScriptComponent scriptCompData = scriptCompTable->GetByID(scriptComponentID);
@@ -929,7 +929,7 @@ void InventoryComponent::EquipScripts(Item* equippedItem) {
void InventoryComponent::UnequipScripts(Item* unequippedItem) {
CDComponentsRegistryTable* compRegistryTable = CDClientManager::Instance()->GetTable<CDComponentsRegistryTable>("ComponentsRegistry");
if (!compRegistryTable) return;
int32_t scriptComponentID = compRegistryTable->GetByIDAndType(unequippedItem->GetLot(), COMPONENT_TYPE_SCRIPT, -1);
int32_t scriptComponentID = compRegistryTable->GetByIDAndType(unequippedItem->GetLot(), eReplicaComponentType::SCRIPT, -1);
if (scriptComponentID > -1) {
CDScriptComponentTable* scriptCompTable = CDClientManager::Instance()->GetTable<CDScriptComponentTable>("ScriptComponent");
CDScriptComponent scriptCompData = scriptCompTable->GetByID(scriptComponentID);
@@ -1331,7 +1331,7 @@ std::vector<uint32_t> InventoryComponent::FindBuffs(Item* item, bool castOnEquip
return entry.objectTemplate == static_cast<unsigned int>(item->GetLot());
});
auto* missions = static_cast<MissionComponent*>(m_Parent->GetComponent(COMPONENT_TYPE_MISSION));
auto* missions = static_cast<MissionComponent*>(m_Parent->GetComponent(eReplicaComponentType::MISSION));
for (const auto& result : results) {
if (result.castOnType == 1) {

View File

@@ -20,6 +20,7 @@
#include "eItemSetPassiveAbilityID.h"
#include "PossessorComponent.h"
#include "eInventoryType.h"
#include "eReplicaComponentType.h"
class Entity;
class ItemSet;
@@ -36,7 +37,7 @@ enum class eItemType : int32_t;
class InventoryComponent : public Component
{
public:
static const uint32_t ComponentType = COMPONENT_TYPE_INVENTORY;
static const eReplicaComponentType ComponentType = eReplicaComponentType::INVENTORY;
explicit InventoryComponent(Entity* parent, tinyxml2::XMLDocument* document = nullptr);
void Update(float deltaTime) override;

View File

@@ -2,6 +2,7 @@
#include "Component.h"
#include "Entity.h"
#include "eReplicaComponentType.h"
/**
* Component that handles the LOT that is shown in the LUP exhibit in the LUP world. Works by setting a timer and
@@ -10,7 +11,7 @@
class LUPExhibitComponent : public Component
{
public:
static const uint32_t ComponentType = COMPONENT_TYPE_EXHIBIT;
static const eReplicaComponentType ComponentType = eReplicaComponentType::EXHIBIT;
LUPExhibitComponent(Entity* parent);
~LUPExhibitComponent();

View File

@@ -4,6 +4,7 @@
#include "GameMessages.h"
#include "Component.h"
#include "eCharacterVersion.h"
#include "eReplicaComponentType.h"
/**
* Component that handles level progression and serilization.
@@ -12,7 +13,7 @@
class LevelProgressionComponent : public Component {
public:
static const uint32_t ComponentType = eReplicaComponentType::COMPONENT_TYPE_LEVEL_PROGRESSION;
static const eReplicaComponentType ComponentType = eReplicaComponentType::LEVEL_PROGRESSION;
/**
* Constructor for this component

View File

@@ -16,6 +16,7 @@
#include "CDClientManager.h"
#include "CDMissionsTable.h"
#include "Component.h"
#include "eReplicaComponentType.h"
class AchievementCacheKey;
@@ -26,7 +27,7 @@ class AchievementCacheKey;
class MissionComponent : public Component
{
public:
static const uint32_t ComponentType = COMPONENT_TYPE_MISSION;
static const eReplicaComponentType ComponentType = eReplicaComponentType::MISSION;
explicit MissionComponent(Entity* parent);
~MissionComponent() override;

View File

@@ -40,7 +40,7 @@ bool OfferedMission::GetAcceptMission() const {
MissionOfferComponent::MissionOfferComponent(Entity* parent, const LOT parentLot) : Component(parent) {
auto* compRegistryTable = CDClientManager::Instance()->GetTable<CDComponentsRegistryTable>("ComponentsRegistry");
auto value = compRegistryTable->GetByIDAndType(parentLot, COMPONENT_TYPE_MISSION_OFFER, -1);
auto value = compRegistryTable->GetByIDAndType(parentLot, eReplicaComponentType::MISSION_OFFER, -1);
if (value != -1) {
const uint32_t componentId = value;
@@ -77,7 +77,7 @@ void MissionOfferComponent::OnUse(Entity* originator) {
void MissionOfferComponent::OfferMissions(Entity* entity, const uint32_t specifiedMissionId) {
// First, get the entity's MissionComponent. If there is not one, then we cannot offer missions to this entity.
auto* missionComponent = static_cast<MissionComponent*>(entity->GetComponent(COMPONENT_TYPE_MISSION));
auto* missionComponent = static_cast<MissionComponent*>(entity->GetComponent(eReplicaComponentType::MISSION));
if (!missionComponent) {
Game::logger->Log("MissionOfferComponent", "Unable to get mission component for Entity %llu", entity->GetObjectID());

View File

@@ -10,6 +10,7 @@
#include "Component.h"
#include <vector>
#include <stdint.h>
#include "eReplicaComponentType.h"
class Entity;
@@ -60,7 +61,7 @@ private:
*/
class MissionOfferComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_MISSION_OFFER;
static const eReplicaComponentType ComponentType = eReplicaComponentType::MISSION_OFFER;
MissionOfferComponent(Entity* parent, LOT parentLot);
~MissionOfferComponent() override;

View File

@@ -10,7 +10,7 @@ ModelComponent::ModelComponent(Entity* parent) : Component(parent) {
void ModelComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
// ItemComponent Serialization. Pets do not get this serialization.
if (!m_Parent->HasComponent(COMPONENT_TYPE_PET)) {
if (!m_Parent->HasComponent(eReplicaComponentType::PET)) {
outBitStream->Write1();
outBitStream->Write<LWOOBJID>(m_userModelID != LWOOBJID_EMPTY ? m_userModelID : m_Parent->GetObjectID());
outBitStream->Write<int>(0);

View File

@@ -4,6 +4,7 @@
#include "NiPoint3.h"
#include "NiQuaternion.h"
#include "Component.h"
#include "eReplicaComponentType.h"
class Entity;
@@ -12,7 +13,7 @@ class Entity;
*/
class ModelComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_MODEL;
static const eReplicaComponentType ComponentType = eReplicaComponentType::MODEL;
ModelComponent(Entity* parent);

View File

@@ -3,6 +3,7 @@
#include "BitStream.h"
#include "Entity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* Component that belongs to an object that may be modularly built, like cars and rockets. Note that this is not the
@@ -11,7 +12,7 @@
*/
class ModuleAssemblyComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_MODULE_ASSEMBLY;
static const eReplicaComponentType ComponentType = eReplicaComponentType::MODULE_ASSEMBLY;
ModuleAssemblyComponent(Entity* MSG_CHAT_INTERNAL_PLAYER_REMOVED_NOTIFICATION);
~ModuleAssemblyComponent() override;

View File

@@ -19,7 +19,7 @@ MovementAIComponent::MovementAIComponent(Entity* parent, MovementAIInfo info) :
m_BaseCombatAI = nullptr;
m_BaseCombatAI = reinterpret_cast<BaseCombatAIComponent*>(m_Parent->GetComponent(COMPONENT_TYPE_BASE_COMBAT_AI));
m_BaseCombatAI = reinterpret_cast<BaseCombatAIComponent*>(m_Parent->GetComponent(eReplicaComponentType::BASE_COMBAT_AI));
//Try and fix the insane values:
if (m_Info.wanderRadius > 5.0f) m_Info.wanderRadius = m_Info.wanderRadius * 0.5f;
@@ -286,7 +286,7 @@ float MovementAIComponent::GetBaseSpeed(LOT lot) {
int32_t componentID;
CDPhysicsComponent* physicsComponent = nullptr;
componentID = componentRegistryTable->GetByIDAndType(lot, COMPONENT_TYPE_CONTROLLABLE_PHYSICS, -1);
componentID = componentRegistryTable->GetByIDAndType(lot, eReplicaComponentType::CONTROLLABLE_PHYSICS, -1);
if (componentID != -1) {
physicsComponent = physicsComponentTable->GetByID(componentID);
@@ -294,7 +294,7 @@ float MovementAIComponent::GetBaseSpeed(LOT lot) {
goto foundComponent;
}
componentID = componentRegistryTable->GetByIDAndType(lot, COMPONENT_TYPE_SIMPLE_PHYSICS, -1);
componentID = componentRegistryTable->GetByIDAndType(lot, eReplicaComponentType::SIMPLE_PHYSICS, -1);
if (componentID != -1) {
physicsComponent = physicsComponentTable->GetByID(componentID);

View File

@@ -13,6 +13,7 @@
#include "Game.h"
#include "dLogger.h"
#include "Component.h"
#include "eReplicaComponentType.h"
#include <vector>
class ControllablePhysicsComponent;
@@ -56,7 +57,7 @@ struct MovementAIInfo {
*/
class MovementAIComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_MOVEMENT_AI;
static const eReplicaComponentType ComponentType = eReplicaComponentType::MOVEMENT_AI;
MovementAIComponent(Entity* parentEntity, MovementAIInfo info);
~MovementAIComponent() override;

View File

@@ -14,6 +14,7 @@
#include "EntityManager.h"
#include "Component.h"
#include "eMovementPlatformState.h"
#include "eReplicaComponentType.h"
class Path;
@@ -105,7 +106,7 @@ public:
*/
class MovingPlatformComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_MOVING_PLATFORM;
static const eReplicaComponentType ComponentType = eReplicaComponentType::MOVING_PLATFORM;
MovingPlatformComponent(Entity* parent, const std::string& pathName);
~MovingPlatformComponent() override;

View File

@@ -4,6 +4,7 @@
#include "MovementAIComponent.h"
#include "Component.h"
#include "Preconditions.h"
#include "eReplicaComponentType.h"
enum class PetAbilityType
{
@@ -20,7 +21,7 @@ enum class PetAbilityType
class PetComponent : public Component
{
public:
static const uint32_t ComponentType = COMPONENT_TYPE_PET;
static const eReplicaComponentType ComponentType = eReplicaComponentType::PET;
explicit PetComponent(Entity* parentEntity, uint32_t componentId);
~PetComponent() override;

View File

@@ -144,7 +144,7 @@ PhantomPhysicsComponent::PhantomPhysicsComponent(Entity* parent) : Component(par
if (!m_HasCreatedPhysics) {
CDComponentsRegistryTable* compRegistryTable = CDClientManager::Instance()->GetTable<CDComponentsRegistryTable>("ComponentsRegistry");
auto componentID = compRegistryTable->GetByIDAndType(m_Parent->GetLOT(), COMPONENT_TYPE_PHANTOM_PHYSICS);
auto componentID = compRegistryTable->GetByIDAndType(m_Parent->GetLOT(), eReplicaComponentType::PHANTOM_PHYSICS);
CDPhysicsComponentTable* physComp = CDClientManager::Instance()->GetTable<CDPhysicsComponentTable>("PhysicsComponent");
@@ -254,7 +254,7 @@ void PhantomPhysicsComponent::CreatePhysics() {
z = m_Parent->GetVar<float>(u"primitiveModelValueZ");
} else {
CDComponentsRegistryTable* compRegistryTable = CDClientManager::Instance()->GetTable<CDComponentsRegistryTable>("ComponentsRegistry");
auto componentID = compRegistryTable->GetByIDAndType(m_Parent->GetLOT(), COMPONENT_TYPE_PHANTOM_PHYSICS);
auto componentID = compRegistryTable->GetByIDAndType(m_Parent->GetLOT(), eReplicaComponentType::PHANTOM_PHYSICS);
CDPhysicsComponentTable* physComp = CDClientManager::Instance()->GetTable<CDPhysicsComponentTable>("PhysicsComponent");

View File

@@ -12,6 +12,7 @@
#include "CppScripts.h"
#include "InvalidScript.h"
#include "Component.h"
#include "eReplicaComponentType.h"
class LDFBaseData;
class Entity;
@@ -25,7 +26,7 @@ class dpEntity;
*/
class PhantomPhysicsComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_PHANTOM_PHYSICS;
static const eReplicaComponentType ComponentType = eReplicaComponentType::PHANTOM_PHYSICS;
PhantomPhysicsComponent(Entity* parent);
~PhantomPhysicsComponent() override;

View File

@@ -2,6 +2,7 @@
#include "Entity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* Component that handles player forced movement
@@ -9,7 +10,7 @@
*/
class PlayerForcedMovementComponent : public Component {
public:
static const uint32_t ComponentType = eReplicaComponentType::COMPONENT_TYPE_PLAYER_FORCED_MOVEMENT;
static const eReplicaComponentType ComponentType = eReplicaComponentType::PLAYER_FORCED_MOVEMENT;
/**
* Constructor for this component

View File

@@ -6,6 +6,7 @@
#include "Item.h"
#include "PossessorComponent.h"
#include "eAninmationFlags.h"
#include "eReplicaComponentType.h"
/**
* Represents an entity that can be controlled by some other entity, generally used by cars to indicate that some
@@ -13,7 +14,7 @@
*/
class PossessableComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_POSSESSABLE;
static const eReplicaComponentType ComponentType = eReplicaComponentType::POSSESSABLE;
PossessableComponent(Entity* parentEntity, uint32_t componentId);

View File

@@ -3,6 +3,7 @@
#include "BitStream.h"
#include "Entity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
// possession types
enum class ePossessionType : uint8_t {
@@ -17,7 +18,7 @@ enum class ePossessionType : uint8_t {
*/
class PossessorComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_POSSESSOR;
static const eReplicaComponentType ComponentType = eReplicaComponentType::POSSESSOR;
PossessorComponent(Entity* parent);
~PossessorComponent() override;

View File

@@ -9,6 +9,7 @@
#include "BitStream.h"
#include "Entity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
struct PropertyState {
LWOOBJID ownerID;
@@ -21,7 +22,7 @@ struct PropertyState {
*/
class PropertyComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_PROPERTY;
static const eReplicaComponentType ComponentType = eReplicaComponentType::PROPERTY;
explicit PropertyComponent(Entity* parentEntity);
~PropertyComponent() override;
[[nodiscard]] PropertyState* GetPropertyState() const { return m_PropertyState; };

View File

@@ -6,13 +6,14 @@
#include "Entity.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "eReplicaComponentType.h"
/**
* Represents the launch pad that's used to select and browse properties
*/
class PropertyEntranceComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_PROPERTY_ENTRANCE;
static const eReplicaComponentType ComponentType = eReplicaComponentType::PROPERTY_ENTRANCE;
explicit PropertyEntranceComponent(uint32_t componentID, Entity* parent);
/**

View File

@@ -255,7 +255,7 @@ void PropertyManagementComponent::OnStartBuilding() {
LWOMAPID zoneId = 1100;
const auto entrance = EntityManager::Instance()->GetEntitiesByComponent(COMPONENT_TYPE_PROPERTY_ENTRANCE);
const auto entrance = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::PROPERTY_ENTRANCE);
originalPrivacyOption = privacyOption;

View File

@@ -3,6 +3,7 @@
#include <chrono>
#include "Entity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* Information regarding which players may visit this property
@@ -31,7 +32,7 @@ enum class PropertyPrivacyOption
class PropertyManagementComponent : public Component
{
public:
static const uint32_t ComponentType = COMPONENT_TYPE_PROPERTY_MANAGEMENT;
static const eReplicaComponentType ComponentType = eReplicaComponentType::PROPERTY_MANAGEMENT;
PropertyManagementComponent(Entity* parent);
static PropertyManagementComponent* Instance();

View File

@@ -2,6 +2,7 @@
#include "Entity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* The property guard that stands on a property before it's claimed, allows entities to attempt claiming this property.
@@ -9,7 +10,7 @@
class PropertyVendorComponent : public Component
{
public:
static const uint32_t ComponentType = COMPONENT_TYPE_PROPERTY_VENDOR;
static const eReplicaComponentType ComponentType = eReplicaComponentType::PROPERTY_VENDOR;
explicit PropertyVendorComponent(Entity* parent);
/**

View File

@@ -11,6 +11,7 @@
#include "dpWorld.h"
#include "dpEntity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* Utility component for detecting how close entities are to named proximities for this entity. Allows you to store
@@ -18,7 +19,7 @@
*/
class ProximityMonitorComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_PROXIMITY_MONITOR;
static const eReplicaComponentType ComponentType = eReplicaComponentType::PROXIMITY_MONITOR;
ProximityMonitorComponent(Entity* parentEntity, int smallRadius = -1, int largeRadius = -1);
~ProximityMonitorComponent() override;

View File

@@ -7,6 +7,7 @@
#include "BitStream.h"
#include "Entity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* Information for each player in the race
@@ -104,7 +105,7 @@ struct RacingPlayerInfo {
*/
class RacingControlComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_RACING_CONTROL;
static const eReplicaComponentType ComponentType = eReplicaComponentType::RACING_CONTROL;
RacingControlComponent(Entity* parentEntity);
~RacingControlComponent();

View File

@@ -4,6 +4,7 @@
#include <string>
#include "dCommonVars.h"
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* Component that handles the traveling using rails, e.g. the ninjago posts that can be used to travel using Spinjitzu.
@@ -14,7 +15,7 @@ public:
explicit RailActivatorComponent(Entity* parent, int32_t componentID);
~RailActivatorComponent() override;
static const uint32_t ComponentType = COMPONENT_TYPE_RAIL_ACTIVATOR;
static const eReplicaComponentType ComponentType = eReplicaComponentType::RAIL_ACTIVATOR;
/**
* Handles the OnUse event from some entity, initiates the rail movement

View File

@@ -53,7 +53,7 @@ RebuildComponent::~RebuildComponent() {
}
void RebuildComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
if (m_Parent->GetComponent(COMPONENT_TYPE_DESTROYABLE) == nullptr) {
if (m_Parent->GetComponent(eReplicaComponentType::DESTROYABLE) == nullptr) {
if (bIsInitialUpdate) {
outBitStream->Write(false);
}

View File

@@ -9,6 +9,7 @@
#include "ScriptedActivityComponent.h"
#include "Preconditions.h"
#include "Component.h"
#include "eReplicaComponentType.h"
class Entity;
@@ -19,7 +20,7 @@ class Entity;
*/
class RebuildComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_REBUILD;
static const eReplicaComponentType ComponentType = eReplicaComponentType::QUICK_BUILD;
RebuildComponent(Entity* entity);
~RebuildComponent() override;

View File

@@ -22,7 +22,7 @@ RenderComponent::RenderComponent(Entity* parent) : Component(parent) {
/*
auto* table = CDClientManager::Instance()->GetTable<CDComponentsRegistryTable>("ComponentsRegistry");
const auto entry = table->GetByIDAndType(parent->GetLOT(), COMPONENT_TYPE_RENDER);
const auto entry = table->GetByIDAndType(parent->GetLOT(), eReplicaComponentType::RENDER);
std::stringstream query;

View File

@@ -8,6 +8,7 @@
#include "AMFFormat.h"
#include "Component.h"
#include "eReplicaComponentType.h"
class Entity;
@@ -55,7 +56,7 @@ struct Effect {
*/
class RenderComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_RENDER;
static const eReplicaComponentType ComponentType = eReplicaComponentType::RENDER;
RenderComponent(Entity* entity);
~RenderComponent() override;

View File

@@ -11,6 +11,7 @@
#include "NiPoint3.h"
#include "NiQuaternion.h"
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* Component that handles rigid bodies that can be interacted with, mostly client-side rendered. An example is the
@@ -18,7 +19,7 @@
*/
class RigidbodyPhantomPhysicsComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_PHANTOM_PHYSICS;
static const eReplicaComponentType ComponentType = eReplicaComponentType::PHANTOM_PHYSICS;
RigidbodyPhantomPhysicsComponent(Entity* parent);
~RigidbodyPhantomPhysicsComponent() override;

View File

@@ -3,6 +3,7 @@
#include "Entity.h"
#include "GameMessages.h"
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* Component that handles the LUP/WBL rocket launchpad that can be interacted with to travel to WBL worlds.
@@ -10,7 +11,7 @@
*/
class RocketLaunchLupComponent : public Component {
public:
static const uint32_t ComponentType = eReplicaComponentType::COMPONENT_TYPE_ROCKET_LAUNCH_LUP;
static const eReplicaComponentType ComponentType = eReplicaComponentType::ROCKET_LAUNCH_LUP;
/**
* Constructor for this component, builds the m_LUPWorlds vector

View File

@@ -9,6 +9,7 @@
#include "BitStream.h"
#include "Entity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
class PreconditionExpression;
@@ -17,7 +18,7 @@ class PreconditionExpression;
*/
class RocketLaunchpadControlComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_ROCKET_LAUNCH;
static const eReplicaComponentType ComponentType = eReplicaComponentType::ROCKET_LAUNCH;
RocketLaunchpadControlComponent(Entity* parent, int rocketId);
~RocketLaunchpadControlComponent() override;

View File

@@ -137,7 +137,7 @@ void ScriptedActivityComponent::PlayerJoin(Entity* player) {
}
void ScriptedActivityComponent::PlayerJoinLobby(Entity* player) {
if (!m_Parent->HasComponent(COMPONENT_TYPE_REBUILD))
if (!m_Parent->HasComponent(eReplicaComponentType::QUICK_BUILD))
GameMessages::SendMatchResponse(player, player->GetSystemAddress(), 0); // tell the client they joined a lobby
LobbyPlayer* newLobbyPlayer = new LobbyPlayer();
newLobbyPlayer->entityID = player->GetObjectID();

View File

@@ -11,6 +11,7 @@
#include "BitStream.h"
#include "Entity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* Represents an instance of an activity, having participants and score
@@ -153,7 +154,7 @@ struct ActivityPlayer {
*/
class ScriptedActivityComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_SCRIPTED_ACTIVITY;
static const eReplicaComponentType ComponentType = eReplicaComponentType::SCRIPTED_ACTIVITY;
ScriptedActivityComponent(Entity* parent, int activityID);
~ScriptedActivityComponent() override;

View File

@@ -3,6 +3,7 @@
#include "NiPoint3.h"
#include "Entity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* Parameters for the shooting gallery that change during playtime
@@ -72,7 +73,7 @@ struct StaticShootingGalleryParams {
*/
class ShootingGalleryComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_SHOOTING_GALLERY;
static const eReplicaComponentType ComponentType = eReplicaComponentType::SHOOTING_GALLERY;
explicit ShootingGalleryComponent(Entity* parent);
~ShootingGalleryComponent();

View File

@@ -11,6 +11,7 @@
#include "NiPoint3.h"
#include "NiQuaternion.h"
#include "Component.h"
#include "eReplicaComponentType.h"
class Entity;
@@ -27,7 +28,7 @@ enum class eClimbableType : int32_t {
*/
class SimplePhysicsComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_SIMPLE_PHYSICS;
static const eReplicaComponentType ComponentType = eReplicaComponentType::SIMPLE_PHYSICS;
SimplePhysicsComponent(uint32_t componentID, Entity* parent);
~SimplePhysicsComponent() override;

View File

@@ -128,7 +128,7 @@ void SkillComponent::RegisterPlayerProjectile(const LWOOBJID projectileId, Behav
}
void SkillComponent::Update(const float deltaTime) {
if (!m_Parent->HasComponent(COMPONENT_TYPE_BASE_COMBAT_AI) && m_Parent->GetLOT() != 1) {
if (!m_Parent->HasComponent(eReplicaComponentType::BASE_COMBAT_AI) && m_Parent->GetLOT() != 1) {
CalculateUpdate(deltaTime);
}

View File

@@ -13,6 +13,7 @@
#include "Component.h"
#include "Entity.h"
#include "dLogger.h"
#include "eReplicaComponentType.h"
struct ProjectileSyncEntry {
LWOOBJID id = LWOOBJID_EMPTY;
@@ -58,7 +59,7 @@ struct SkillExecutionResult {
*/
class SkillComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_SKILL;
static const eReplicaComponentType ComponentType = eReplicaComponentType::SKILL;
explicit SkillComponent(Entity* parent);
~SkillComponent() override;

View File

@@ -3,6 +3,7 @@
#include "Entity.h"
#include "GUID.h"
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* Music that should be played by the client
@@ -19,7 +20,7 @@ struct MusicCue {
*/
class SoundTriggerComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_SOUND_TRIGGER;
static const eReplicaComponentType ComponentType = eReplicaComponentType::SOUND_TRIGGER;
explicit SoundTriggerComponent(Entity* parent);
~SoundTriggerComponent() override;

View File

@@ -9,13 +9,14 @@
#include "BouncerComponent.h"
#include <algorithm>
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* A component for switches in game, including pet triggered switches.
*/
class SwitchComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_SWITCH;
static const eReplicaComponentType ComponentType = eReplicaComponentType::SWITCH;
SwitchComponent(Entity* parent);
~SwitchComponent() override;

View File

@@ -2,6 +2,7 @@
#define __TRIGGERCOMPONENT__H__
#include "Component.h"
#include "eReplicaComponentType.h"
namespace LUTriggers {
struct Trigger;
@@ -10,7 +11,7 @@ namespace LUTriggers {
class TriggerComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_TRIGGER;
static const eReplicaComponentType ComponentType = eReplicaComponentType::TRIGGER;
explicit TriggerComponent(Entity* parent, const std::string triggerInfo);

View File

@@ -3,13 +3,14 @@
#include "BitStream.h"
#include "Entity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* Physics component for vehicles.
*/
class VehiclePhysicsComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_VEHICLE_PHYSICS;
static const eReplicaComponentType ComponentType = eReplicaComponentType::VEHICLE_PHYSICS;
VehiclePhysicsComponent(Entity* parentEntity);
~VehiclePhysicsComponent() override;

View File

@@ -119,7 +119,7 @@ void VendorComponent::RefreshInventory(bool isCreation) {
void VendorComponent::SetupConstants() {
auto* compRegistryTable = CDClientManager::Instance()->GetTable<CDComponentsRegistryTable>("ComponentsRegistry");
int componentID = compRegistryTable->GetByIDAndType(m_Parent->GetLOT(), COMPONENT_TYPE_VENDOR);
int componentID = compRegistryTable->GetByIDAndType(m_Parent->GetLOT(), eReplicaComponentType::VENDOR);
auto* vendorComponentTable = CDClientManager::Instance()->GetTable<CDVendorComponentTable>("VendorComponent");
std::vector<CDVendorComponent> vendorComps = vendorComponentTable->Query([=](CDVendorComponent entry) { return (entry.id == componentID); });

View File

@@ -7,13 +7,14 @@
#include "Entity.h"
#include "GameMessages.h"
#include "RakNetTypes.h"
#include "eReplicaComponentType.h"
/**
* A component for vendor NPCs. A vendor sells items to the player.
*/
class VendorComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_VENDOR;
static const eReplicaComponentType ComponentType = eReplicaComponentType::VENDOR;
VendorComponent(Entity* parent);
~VendorComponent() override;