From 58d09aa3ca4409e2a15473b0ac3c0446f0acb1a2 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 22 Oct 2018 21:30:21 +0800 Subject: *misc --- src/libjin/Game/je_entity.h | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'src/libjin/Game/je_entity.h') 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 #include #include +#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 }; -- cgit v1.1-26-g67d0