basic tag component

This commit is contained in:
Bluub
2021-06-07 16:42:51 +02:00
parent 7a8a76c845
commit b7bf544b48
3 changed files with 28 additions and 7 deletions
+17
View File
@@ -0,0 +1,17 @@
//
// Created By Louis Auzuret on 07/06/21
//
#include "Component/Tag/TagComponent.hpp"
namespace BBM
{
WAL::Component *TagComponent::clone(WAL::Entity &entity) const
{
return new TagComponent(entity, tag);
}
TagComponent::TagComponent(WAL::Entity &entity, std::string tag)
: Component(entity), tag(tag)
{ }
}
+9 -7
View File
@@ -13,20 +13,22 @@ namespace BBM
class TagComponent : public WAL::Component
{
public:
//! @brief tag held by the component
std::string tag;
//! @inherit
WAL::Component *clone(WAL::Entity &entity) const override;
//! @brief Create a new keyboard component using default keys.
explicit KeyboardComponent(WAL::Entity &entity);
//! @brief Create a new tag Component with a tag
explicit TagComponent(WAL::Entity &entity, std::string tag);
//! @brief A Keyboard component is copy constructable.
KeyboardComponent(const KeyboardComponent &) = default;
//! @brief A Tag component is copy constructable.
TagComponent(const TagComponent &) = default;
//! @brief default destructor
~KeyboardComponent() override = default;
~TagComponent() override = default;
//! @brief A Keyboard component can't be assigned
KeyboardComponent &operator=(const KeyboardComponent &) = delete;
//! @brief A Tag component can't be assigned
TagComponent &operator=(const TagComponent &) = delete;
};
}