Sparkle 0.0.1
Loading...
Searching...
No Matches
spk_component_2d.hpp
1#pragma once
2
3#include "structure/engine/spk_component.hpp"
4
5#include <string>
6
7namespace spk
8{
9 class Entity2D;
10
16 {
17 friend class spk::Entity;
18
19 private:
20 Entity2D *_castedOwner = nullptr;
21
23
24 void _setOwner(spk::Entity *p_owner) override;
25
26 public:
31 explicit Component2D(const std::wstring &p_name);
32
37 Entity2D *owner();
42 const Entity2D *owner() const;
43 };
44}
Component2D(const std::wstring &p_name)
Builds a 2D component with a name.
Definition spk_component_2d.cpp:9
Entity2D * owner()
Returns the 2D owner entity.
Definition spk_component_2d.cpp:14
Base class for engine components attached to entities.
Definition spk_component.hpp:23
Entity * owner()
Returns the owning entity.
Definition spk_component.cpp:47
Entity owning a Transform2D component.
Definition spk_entity_2d.hpp:13
Hierarchical game object containing components and children.
Definition spk_entity.hpp:34