diff --git a/dGame/dComponents/ActivityComponent.cpp b/dGame/dComponents/ActivityComponent.cpp new file mode 100644 index 00000000..8f7f286a --- /dev/null +++ b/dGame/dComponents/ActivityComponent.cpp @@ -0,0 +1,5 @@ +#include "ActivityComponent.h" + +ActivityComponent::ActivityComponent(Entity* parent) : Component(parent) { + +} diff --git a/dGame/dComponents/ActivityComponent.h b/dGame/dComponents/ActivityComponent.h new file mode 100644 index 00000000..58c5b522 --- /dev/null +++ b/dGame/dComponents/ActivityComponent.h @@ -0,0 +1,17 @@ +#ifndef __ACTIVITYCOMPONENT__H__ +#define __ACTIVITYCOMPONENT__H__ + +#include "Component.h" +#include "eReplicaComponentType.h" + +class Entity; + +class ActivityComponent : public Component { +public: + inline static const eReplicaComponentType ComponentType = eReplicaComponentType::INVALID; + ActivityComponent(Entity* parent); +}; + +#endif //!__ACTIVITYCOMPONENT__H__ + + diff --git a/dGame/dComponents/BaseRacingControlComponent.cpp b/dGame/dComponents/BaseRacingControlComponent.cpp new file mode 100644 index 00000000..710ce9f5 --- /dev/null +++ b/dGame/dComponents/BaseRacingControlComponent.cpp @@ -0,0 +1,5 @@ +#include "BaseRacingControlComponent.h" + +BaseRacingControlComponent::BaseRacingControlComponent(Entity* parent) : Component(parent) { + +} diff --git a/dGame/dComponents/BaseRacingControlComponent.h b/dGame/dComponents/BaseRacingControlComponent.h new file mode 100644 index 00000000..793ebb7f --- /dev/null +++ b/dGame/dComponents/BaseRacingControlComponent.h @@ -0,0 +1,16 @@ +#ifndef __BASERACINGCONTROLCOMPONENT__H__ +#define __BASERACINGCONTROLCOMPONENT__H__ + +#include "ScriptedActivityComponent.h" +#include "eReplicaComponentType.h" + +class Entity; + +class BaseRacingControlComponent : public ScriptedActivityComponent { +public: + inline static const eReplicaComponentType ComponentType = eReplicaComponentType::RACING_CONTROL; + BaseRacingControlComponent(Entity* parent); +}; + + +#endif //!__BASERACINGCONTROLCOMPONENT__H__ diff --git a/dGame/dComponents/CMakeLists.txt b/dGame/dComponents/CMakeLists.txt index 89b263ed..e46daa0b 100644 --- a/dGame/dComponents/CMakeLists.txt +++ b/dGame/dComponents/CMakeLists.txt @@ -1,4 +1,6 @@ -set(DGAME_DCOMPONENTS_SOURCES "BaseCombatAIComponent.cpp" +set(DGAME_DCOMPONENTS_SOURCES "ActivityComponent.cpp" + "BaseCombatAIComponent.cpp" + "BaseRacingControlComponent.cpp" "BouncerComponent.cpp" "BuffComponent.cpp" "BuildBorderComponent.cpp" @@ -30,6 +32,7 @@ set(DGAME_DCOMPONENTS_SOURCES "BaseCombatAIComponent.cpp" "PropertyVendorComponent.cpp" "ProximityMonitorComponent.cpp" "RacingControlComponent.cpp" + "RacingSoundTriggerComponent.cpp" "RacingStatsComponent.cpp" "RailActivatorComponent.cpp" "QuickBuildComponent.cpp" diff --git a/dGame/dComponents/GateRushControlComponent.cpp b/dGame/dComponents/GateRushControlComponent.cpp new file mode 100644 index 00000000..35caa0c3 --- /dev/null +++ b/dGame/dComponents/GateRushControlComponent.cpp @@ -0,0 +1,5 @@ +#include "GateRushControlComponent.h" + +GateRushControlComponent::GateRushControlComponent(Entity* parent) : BaseRacingControlComponent(parent) { + +} diff --git a/dGame/dComponents/GateRushControlComponent.h b/dGame/dComponents/GateRushControlComponent.h new file mode 100644 index 00000000..dc185a9a --- /dev/null +++ b/dGame/dComponents/GateRushControlComponent.h @@ -0,0 +1,15 @@ +#ifndef __GATERUSHCONTROLCOMPONENT__H__ +#define __GATERUSHCONTROLCOMPONENT__H__ + +#include "BaseRacingControlComponent.h" +#include "eReplicaComponentType.h" + +class Entity; + +class GateRushControlComponent : public BaseRacingControlComponent { +public: + inline static const eReplicaComponentType ComponentType = eReplicaComponentType::GATE_RUSH_CONTROL; + GateRushControlComponent(Entity* parent); +}; + +#endif //!__GATERUSHCONTROLCOMPONENT__H__ diff --git a/dGame/dComponents/ItemComponent.cpp b/dGame/dComponents/ItemComponent.cpp index af8608d0..c06b4b46 100644 --- a/dGame/dComponents/ItemComponent.cpp +++ b/dGame/dComponents/ItemComponent.cpp @@ -1,5 +1,5 @@ #include "ItemComponent.h" ItemComponent::ItemComponent(Entity* parent) : Component(parent) { - + } diff --git a/dGame/dComponents/MinigameControlComponent.h b/dGame/dComponents/MinigameControlComponent.h index bf555e31..b73add45 100644 --- a/dGame/dComponents/MinigameControlComponent.h +++ b/dGame/dComponents/MinigameControlComponent.h @@ -1,11 +1,15 @@ -#include "Component.h" +#ifndef __MINIGAMECONTROLCOMPONENT__H__ +#define __MINIGAMECONTROLCOMPONENT__H__ +#include "ActivityComponent.h" #include "eReplicaComponentType.h" class Entity; -class MinigameControlComponent : public Component { +class MinigameControlComponent : public ActivityComponent { public: inline static const eReplicaComponentType ComponentType = eReplicaComponentType::MINIGAME_CONTROL; MinigameControlComponent(Entity* parent); }; + +#endif //!__MINIGAMECONTROLCOMPONENT__H__ diff --git a/dGame/dComponents/QuickBuildComponent.h b/dGame/dComponents/QuickBuildComponent.h index 84c4343f..cbbcdb8f 100644 --- a/dGame/dComponents/QuickBuildComponent.h +++ b/dGame/dComponents/QuickBuildComponent.h @@ -8,7 +8,7 @@ #include "NiPoint3.h" #include "ScriptedActivityComponent.h" #include "Preconditions.h" -#include "Component.h" +#include "ActivityComponent.h" #include "eReplicaComponentType.h" #include "eRebuildState.h" @@ -20,7 +20,7 @@ enum class eQuickBuildFailReason : uint32_t; * consists of an activator that shows a popup and then the actual entity that the bricks are built into. Note * that quick builds are also scripted activities so this shared some logic with the ScriptedActivityComponent. */ -class QuickBuildComponent : public Component { +class QuickBuildComponent : public ActivityComponent { public: inline static const eReplicaComponentType ComponentType = eReplicaComponentType::QUICK_BUILD; diff --git a/dGame/dComponents/RacingControlComponent.cpp b/dGame/dComponents/RacingControlComponent.cpp index 5ccbd05f..4ea2c4b6 100644 --- a/dGame/dComponents/RacingControlComponent.cpp +++ b/dGame/dComponents/RacingControlComponent.cpp @@ -29,8 +29,7 @@ #define M_PI 3.14159265358979323846264338327950288 #endif -RacingControlComponent::RacingControlComponent(Entity* parent) - : Component(parent) { +RacingControlComponent::RacingControlComponent(Entity* parent) : BaseRacingControlComponent(parent) { m_PathName = u"MainPath"; m_RemainingLaps = 3; m_LeadingPlayer = LWOOBJID_EMPTY; diff --git a/dGame/dComponents/RacingControlComponent.h b/dGame/dComponents/RacingControlComponent.h index 66554026..b6e09042 100644 --- a/dGame/dComponents/RacingControlComponent.h +++ b/dGame/dComponents/RacingControlComponent.h @@ -6,7 +6,7 @@ #include "BitStream.h" #include "Entity.h" -#include "Component.h" +#include "BaseRacingControlComponent.h" #include "eReplicaComponentType.h" /** @@ -103,7 +103,7 @@ struct RacingPlayerInfo { /** * Component that's attached to a manager entity in each race zone that loads player vehicles, keep scores, etc. */ -class RacingControlComponent : public Component { +class RacingControlComponent : public BaseRacingControlComponent { public: inline static const eReplicaComponentType ComponentType = eReplicaComponentType::RACING_CONTROL; diff --git a/dGame/dComponents/RacingSoundTriggerComponent.cpp b/dGame/dComponents/RacingSoundTriggerComponent.cpp new file mode 100644 index 00000000..e69de29b diff --git a/dGame/dComponents/RacingSoundTriggerComponent.h b/dGame/dComponents/RacingSoundTriggerComponent.h new file mode 100644 index 00000000..c35e76ce --- /dev/null +++ b/dGame/dComponents/RacingSoundTriggerComponent.h @@ -0,0 +1,15 @@ +#ifndef __RACINGSOUNDTRIGGERCOMPONENT__H__ +#define __RACINGSOUNDTRIGGERCOMPONENT__H__ + +#include "SoundTriggerComponent.h" +#include "eReplicaComponentType.h" + +class Entity; + +class RacingSoundTriggerComponent : public SoundTriggerComponent { +public: + inline static const eReplicaComponentType ComponentType = eReplicaComponentType::RACING_SOUND_TRIGGER; + RacingSoundTriggerComponent(Entity* parent); +}; + +#endif //!__RACINGSOUNDTRIGGERCOMPONENT__H__ diff --git a/dGame/dComponents/ShootingGalleryComponent.cpp b/dGame/dComponents/ShootingGalleryComponent.cpp index 0b01344d..f2c6d0e9 100644 --- a/dGame/dComponents/ShootingGalleryComponent.cpp +++ b/dGame/dComponents/ShootingGalleryComponent.cpp @@ -2,7 +2,7 @@ #include "EntityManager.h" #include "ScriptedActivityComponent.h" -ShootingGalleryComponent::ShootingGalleryComponent(Entity* parent) : Component(parent) { +ShootingGalleryComponent::ShootingGalleryComponent(Entity* parent) : ActivityComponent(parent) { } ShootingGalleryComponent::~ShootingGalleryComponent() = default; diff --git a/dGame/dComponents/ShootingGalleryComponent.h b/dGame/dComponents/ShootingGalleryComponent.h index 93fe4ba1..319ac4ae 100644 --- a/dGame/dComponents/ShootingGalleryComponent.h +++ b/dGame/dComponents/ShootingGalleryComponent.h @@ -2,7 +2,7 @@ #include "dCommonVars.h" #include "NiPoint3.h" #include "Entity.h" -#include "Component.h" +#include "ActivityComponent.h" #include "eReplicaComponentType.h" /** @@ -71,7 +71,7 @@ struct StaticShootingGalleryParams { * A very ancient component that was used to guide shooting galleries, it's still kind of used but a lot of logic is * also in the related scripts. */ -class ShootingGalleryComponent : public Component { +class ShootingGalleryComponent : public ActivityComponent { public: inline static const eReplicaComponentType ComponentType = eReplicaComponentType::SHOOTING_GALLERY; diff --git a/dGame/dEntity/Entity.cpp b/dGame/dEntity/Entity.cpp index d26898fb..07f01b4d 100644 --- a/dGame/dEntity/Entity.cpp +++ b/dGame/dEntity/Entity.cpp @@ -71,6 +71,8 @@ #include "MinigameControlComponent.h" #include "ItemComponent.h" #include "DonationVendorComponent.h" +#include "GateRushControlComponent.h" +#include "RacingSoundTriggerComponent.h" // Table includes #include "CDComponentsRegistryTable.h" @@ -418,6 +420,12 @@ void Entity::Initialize() { AddComponent(); } break; + case eReplicaComponentType::GATE_RUSH_CONTROL: + AddComponent(); + break; + case eReplicaComponentType::RACING_SOUND_TRIGGER: + AddComponent(); + break; case eReplicaComponentType::GHOST: case eReplicaComponentType::SPAWN: case eReplicaComponentType::MODULAR_BUILD: @@ -459,7 +467,6 @@ void Entity::Initialize() { case eReplicaComponentType::DROPPED_LOOT: case eReplicaComponentType::FACTION_TRIGGER: case eReplicaComponentType::BBB: - case eReplicaComponentType::RACING_SOUND_TRIGGER: case eReplicaComponentType::CHAT_BUBBLE: case eReplicaComponentType::FRIENDS_LIST: case eReplicaComponentType::GUILD: @@ -480,7 +487,6 @@ void Entity::Initialize() { case eReplicaComponentType::INTERACTION_MANAGER: case eReplicaComponentType::COMBAT_MEDIATOR: case eReplicaComponentType::ACHIEVEMENT_VENDOR: - case eReplicaComponentType::GATE_RUSH_CONTROL: case eReplicaComponentType::ROLLER: case eReplicaComponentType::PLAYER_FORCED_MOVEMENT: case eReplicaComponentType::CRAFTING: