scaffold activity based components

This commit is contained in:
Aaron Kimbre 2023-06-23 10:30:03 -05:00
parent c78760db59
commit f27e0400e7
17 changed files with 105 additions and 15 deletions

View File

@ -0,0 +1,5 @@
#include "ActivityComponent.h"
ActivityComponent::ActivityComponent(Entity* parent) : Component(parent) {
}

View File

@ -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__

View File

@ -0,0 +1,5 @@
#include "BaseRacingControlComponent.h"
BaseRacingControlComponent::BaseRacingControlComponent(Entity* parent) : Component(parent) {
}

View File

@ -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__

View File

@ -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"

View File

@ -0,0 +1,5 @@
#include "GateRushControlComponent.h"
GateRushControlComponent::GateRushControlComponent(Entity* parent) : BaseRacingControlComponent(parent) {
}

View File

@ -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__

View File

@ -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__

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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__

View File

@ -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;

View File

@ -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;

View File

@ -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<ProximityMonitorComponent>();
}
break;
case eReplicaComponentType::GATE_RUSH_CONTROL:
AddComponent<GateRushControlComponent>();
break;
case eReplicaComponentType::RACING_SOUND_TRIGGER:
AddComponent<RacingSoundTriggerComponent>();
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: