Collectible, Item, further re-implement initialize

This commit is contained in:
David Markowitz
2023-06-10 04:46:48 -07:00
parent cebe3c732a
commit b91f84d884
11 changed files with 285 additions and 254 deletions

View File

@@ -3,10 +3,12 @@ set(DGAME_DCOMPONENTS_SOURCES "BaseCombatAIComponent.cpp"
"BuffComponent.cpp"
"BuildBorderComponent.cpp"
"CharacterComponent.cpp"
"CollectibleComponent.cpp"
"Component.cpp"
"ControllablePhysicsComponent.cpp"
"DestroyableComponent.cpp"
"InventoryComponent.cpp"
"ItemComponent.cpp"
"LevelProgressionComponent.cpp"
"LUPExhibitComponent.cpp"
"MinigameControlComponent.cpp"

View File

@@ -0,0 +1,11 @@
#include "CollectibleComponent.h"
#include "Entity.h"
CollectibleComponent::CollectibleComponent(Entity* parent) : Component(parent) {
}
void CollectibleComponent::Startup() {
m_CollectibleId = GetParentEntity()->GetVarAs<int32_t>(u"collectible_id");
}

View File

@@ -0,0 +1,22 @@
#ifndef __COLLECTIBLECOMPONENT__H__
#define __COLLECTIBLECOMPONENT__H__
#include "Component.h"
#include "eReplicaComponentType.h"
#include <cstdint>
class CollectibleComponent : public Component {
public:
inline static const eReplicaComponentType ComponentType = eReplicaComponentType::COLLECTIBLE;
CollectibleComponent(Entity* parent);
void Startup() override;
uint32_t GetCollectibleId() const { return m_CollectibleId; }
private:
uint32_t m_CollectibleId;
};
#endif //!__COLLECTIBLECOMPONENT__H__

View File

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

View File

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