mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-06 10:44:08 +00:00
Collectible, Item, further re-implement initialize
This commit is contained in:
@@ -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"
|
||||
|
11
dGame/dComponents/CollectibleComponent.cpp
Normal file
11
dGame/dComponents/CollectibleComponent.cpp
Normal 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");
|
||||
}
|
22
dGame/dComponents/CollectibleComponent.h
Normal file
22
dGame/dComponents/CollectibleComponent.h
Normal 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__
|
5
dGame/dComponents/ItemComponent.cpp
Normal file
5
dGame/dComponents/ItemComponent.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
#include "ItemComponent.h"
|
||||
|
||||
ItemComponent::ItemComponent(Entity* parent) : Component(parent) {
|
||||
|
||||
}
|
15
dGame/dComponents/ItemComponent.h
Normal file
15
dGame/dComponents/ItemComponent.h
Normal 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__
|
Reference in New Issue
Block a user