aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Game/je_entity.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-10-22 21:30:21 +0800
committerchai <chaifix@163.com>2018-10-22 21:30:21 +0800
commit58d09aa3ca4409e2a15473b0ac3c0446f0acb1a2 (patch)
tree37dadab5575116c75b54064556b045ba8a245871 /src/libjin/Game/je_entity.h
parent99bea1e47c813016d89c9e99296fa66e183d808f (diff)
*misc
Diffstat (limited to 'src/libjin/Game/je_entity.h')
-rw-r--r--src/libjin/Game/je_entity.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/libjin/Game/je_entity.h b/src/libjin/Game/je_entity.h
index 41a3c10..4a252da 100644
--- a/src/libjin/Game/je_entity.h
+++ b/src/libjin/Game/je_entity.h
@@ -4,9 +4,11 @@
#include "../core/je_configuration.h"
#if defined(jin_game)
+#include <list>
#include <map>
#include <set>
+#include "../common/je_object.h"
#include "../common/je_types.h"
namespace JinEngine
@@ -17,24 +19,41 @@ namespace JinEngine
///
/// Game object base class.
///
- class Entity
+ class Entity : public Object
{
public:
+
+ ///
+ ///
+ ///
virtual ~Entity();
+ ///
+ ///
+ ///
void lifecycle();
+ ///
+ ///
+ ///
+ void setVisible(bool isVisible);
+
+ ///
+ ///
+ ///
+ void setActive(bool isActive);
+
protected:
virtual void onAlive();
virtual void onUpdate(float dt);
virtual void onDraw();
virtual void onDie();
- uint32 layer; // layer where entity belongs
- uint32 index; // render index in layer
- uint64 tag; // tag of entity
- bool mIsVisible;
- bool mIsActive;
+ uint32 layer; // layer where entity belongs
+ uint32 index; // render index in layer
+ uint64 tag; // tag of entity, 64 now
+ bool mIsVisible; // if the entity is visible or not
+ bool mIsActive; // if the entity is joined into the logic
};