Add ghost component (#1409)

will be used to migrate other Player functionality in a future PR.

Tested that I can login still.
This commit is contained in:
David Markowitz 2024-01-12 11:18:28 -08:00 committed by GitHub
parent 929d029f12
commit 8b6fb8fb44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 0 deletions

View File

@ -80,6 +80,7 @@
#include "RacingStatsComponent.h"
#include "CollectibleComponent.h"
#include "ItemComponent.h"
#include "GhostComponent.h"
// Table includes
#include "CDComponentsRegistryTable.h"
@ -436,6 +437,8 @@ void Entity::Initialize() {
AddComponent<PlayerForcedMovementComponent>();
AddComponent<CharacterComponent>(m_Character)->LoadFromXml(m_Character->GetXMLDoc());
AddComponent<GhostComponent>();
}
if (compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::INVENTORY) > 0 || m_Character) {

View File

@ -10,6 +10,7 @@ set(DGAME_DCOMPONENTS_SOURCES
"ControllablePhysicsComponent.cpp"
"DestroyableComponent.cpp"
"DonationVendorComponent.cpp"
"GhostComponent.cpp"
"InventoryComponent.cpp"
"ItemComponent.cpp"
"LevelProgressionComponent.cpp"

View File

@ -0,0 +1,4 @@
#include "GhostComponent.h"
// TODO Move ghosting related code from Player to here
GhostComponent::GhostComponent(Entity* parent) : Component(parent) {}

View File

@ -0,0 +1,13 @@
#ifndef __GHOSTCOMPONENT__H__
#define __GHOSTCOMPONENT__H__
#include "Component.h"
#include "eReplicaComponentType.h"
class GhostComponent : public Component {
public:
static inline const eReplicaComponentType ComponentType = eReplicaComponentType::GHOST;
GhostComponent(Entity* parent);
};
#endif //!__GHOSTCOMPONENT__H__