feat(entity): the client's faction trigger component (72)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-10-01 07:17:47 -05:00
parent a6381be720
commit d1a778a140
2 changed files with 24 additions and 0 deletions

View File

@@ -90,6 +90,7 @@
#include "CollectibleComponent.h"
#include "ItemComponent.h"
#include "MinifigComponent.h"
#include "FactionTriggerComponent.h"
#include "RocketLandingComponent.h"
#include "GenericActivatorComponent.h"
#include "ShowcaseModelHandlerComponent.h"
@@ -1078,6 +1079,12 @@ void Entity::Initialize() {
if (id > -1) AddComponent<RocketLandingComponent>(id);
break;
}
case eReplicaComponentType::FACTION_TRIGGER: {
// LWOFactionTriggerComponent: the client makes it from the registry
const auto id = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::FACTION_TRIGGER, -1);
if (id > -1) AddComponent<FactionTriggerComponent>(id);
break;
}
default:
break;
}

View File

@@ -0,0 +1,17 @@
#ifndef FACTIONTRIGGERCOMPONENT_H
#define FACTIONTRIGGERCOMPONENT_H
#include "Component.h"
#include "eReplicaComponentType.h"
/**
* Faction trigger, as the client's LWOFactionTriggerComponent makes it from the registry. Nothing of it is sent or done on the server yet.
*/
class FactionTriggerComponent final : public Component {
public:
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::FACTION_TRIGGER;
FactionTriggerComponent(Entity* parent, const int32_t componentID) : Component(parent, componentID) {}
};
#endif // FACTIONTRIGGERCOMPONENT_H