From 1f399a72779dd75ca2aaac1a0b9ab7708ddd6178 Mon Sep 17 00:00:00 2001 From: Aaron Kimbre Date: Mon, 4 Dec 2023 20:59:08 -0600 Subject: [PATCH] chore: rename zonecontrolcomp to minigamecontrolcomp --- dCommon/dEnums/eReplicaComponentType.h | 2 +- dGame/Entity.cpp | 12 ++++++------ dGame/dComponents/CMakeLists.txt | 2 +- dGame/dComponents/MiniGameControlComponent.cpp | 5 +++++ dGame/dComponents/MiniGameControlComponent.h | 15 +++++++++++++++ dGame/dComponents/MinigameComponent.cpp | 5 +++++ dGame/dComponents/ZoneControlComponent.cpp | 5 ----- dGame/dComponents/ZoneControlComponent.h | 15 --------------- 8 files changed, 33 insertions(+), 28 deletions(-) create mode 100644 dGame/dComponents/MiniGameControlComponent.cpp create mode 100644 dGame/dComponents/MiniGameControlComponent.h create mode 100644 dGame/dComponents/MinigameComponent.cpp delete mode 100644 dGame/dComponents/ZoneControlComponent.cpp delete mode 100644 dGame/dComponents/ZoneControlComponent.h diff --git a/dCommon/dEnums/eReplicaComponentType.h b/dCommon/dEnums/eReplicaComponentType.h index ca60355f..83acbf89 100644 --- a/dCommon/dEnums/eReplicaComponentType.h +++ b/dCommon/dEnums/eReplicaComponentType.h @@ -54,7 +54,7 @@ enum class eReplicaComponentType : uint32_t { PHYSICS_SYSTEM, QUICK_BUILD, SWITCH, - ZONE_CONTROL, // Minigame + MINI_GAME_CONTROL, CHANGLING, CHOICE_BUILD, PACKAGE, diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index f62a0825..a73e356f 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -76,7 +76,7 @@ #include "eGameMasterLevel.h" #include "eReplicaComponentType.h" #include "eReplicaPacketType.h" -#include "ZoneControlComponent.h" +#include "MiniGameControlComponent.h" #include "RacingStatsComponent.h" #include "CollectibleComponent.h" #include "ItemComponent.h" @@ -217,8 +217,8 @@ void Entity::Initialize() { AddComponent(petComponentId); } - if (compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::ZONE_CONTROL) > 0) { - AddComponent(); + if (compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::MINI_GAME_CONTROL) > 0) { + AddComponent(); } uint32_t possessableComponentId = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::POSSESSABLE); @@ -1197,9 +1197,9 @@ void Entity::WriteComponents(RakNet::BitStream* outBitStream, eReplicaPacketType } } - ZoneControlComponent* zoneControlComponent; - if (TryGetComponent(eReplicaComponentType::ZONE_CONTROL, zoneControlComponent)) { - zoneControlComponent->Serialize(outBitStream, bIsInitialUpdate); + MiniGameControlComponent* miniGameControlComponent; + if (TryGetComponent(eReplicaComponentType::MINI_GAME_CONTROL, miniGameControlComponent)) { + miniGameControlComponent->Serialize(outBitStream, bIsInitialUpdate); } // BBB Component, unused currently diff --git a/dGame/dComponents/CMakeLists.txt b/dGame/dComponents/CMakeLists.txt index 814a4fb9..fa0aea35 100644 --- a/dGame/dComponents/CMakeLists.txt +++ b/dGame/dComponents/CMakeLists.txt @@ -45,6 +45,6 @@ set(DGAME_DCOMPONENTS_SOURCES "BaseCombatAIComponent.cpp" "TriggerComponent.cpp" "HavokVehiclePhysicsComponent.cpp" "VendorComponent.cpp" - "ZoneControlComponent.cpp" + "MiniGameControlComponent.cpp" PARENT_SCOPE ) diff --git a/dGame/dComponents/MiniGameControlComponent.cpp b/dGame/dComponents/MiniGameControlComponent.cpp new file mode 100644 index 00000000..fdd56a2c --- /dev/null +++ b/dGame/dComponents/MiniGameControlComponent.cpp @@ -0,0 +1,5 @@ +#include "MiniGameControlComponent.h" + +void MiniGameControlComponent::Serialize(RakNet::BitStream* outBitStream, bool isConstruction) { + outBitStream->Write(0x40000000); +} diff --git a/dGame/dComponents/MiniGameControlComponent.h b/dGame/dComponents/MiniGameControlComponent.h new file mode 100644 index 00000000..06a9c24e --- /dev/null +++ b/dGame/dComponents/MiniGameControlComponent.h @@ -0,0 +1,15 @@ +#ifndef __MINIGAMECONTROLCOMPONENT__H__ +#define __MINIGAMECONTROLCOMPONENT__H__ + +#include "Component.h" +#include "eReplicaComponentType.h" + +class MiniGameControlComponent final : public Component { +public: + inline static const eReplicaComponentType ComponentType = eReplicaComponentType::MINI_GAME_CONTROL; + + MiniGameControlComponent(Entity* parent) : Component(parent) {} + void Serialize(RakNet::BitStream* outBitStream, bool isConstruction); +}; + +#endif //!__MINIGAMECONTROLCOMPONENT__H__ diff --git a/dGame/dComponents/MinigameComponent.cpp b/dGame/dComponents/MinigameComponent.cpp new file mode 100644 index 00000000..6bcb985e --- /dev/null +++ b/dGame/dComponents/MinigameComponent.cpp @@ -0,0 +1,5 @@ +#include "MinigameComponent.h" + +void MinigameComponent::Serialize(RakNet::BitStream* outBitStream, bool isConstruction) { + outBitStream->Write(0x40000000); +} diff --git a/dGame/dComponents/ZoneControlComponent.cpp b/dGame/dComponents/ZoneControlComponent.cpp deleted file mode 100644 index ca9c6626..00000000 --- a/dGame/dComponents/ZoneControlComponent.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "ZoneControlComponent.h" - -void ZoneControlComponent::Serialize(RakNet::BitStream* outBitStream, bool isConstruction) { - outBitStream->Write(0x40000000); -} diff --git a/dGame/dComponents/ZoneControlComponent.h b/dGame/dComponents/ZoneControlComponent.h deleted file mode 100644 index ba235a80..00000000 --- a/dGame/dComponents/ZoneControlComponent.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef __ZONECONTROLCOMPONENT__H__ -#define __ZONECONTROLCOMPONENT__H__ - -#include "Component.h" -#include "eReplicaComponentType.h" - -class ZoneControlComponent final : public Component { -public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::ZONE_CONTROL; - - ZoneControlComponent(Entity* parent) : Component(parent) {} - void Serialize(RakNet::BitStream* outBitStream, bool isConstruction); -}; - -#endif //!__ZONECONTROLCOMPONENT__H__