aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/game')
-rw-r--r--src/libjin/game/je_entity.cpp0
-rw-r--r--src/libjin/game/je_entity.h27
-rw-r--r--src/libjin/game/je_gameobject.cpp2
-rw-r--r--src/libjin/game/je_gameobject.h48
-rw-r--r--src/libjin/game/je_scene.cpp0
-rw-r--r--src/libjin/game/je_scene.h73
6 files changed, 4 insertions, 146 deletions
diff --git a/src/libjin/game/je_entity.cpp b/src/libjin/game/je_entity.cpp
deleted file mode 100644
index e69de29..0000000
--- a/src/libjin/game/je_entity.cpp
+++ /dev/null
diff --git a/src/libjin/game/je_entity.h b/src/libjin/game/je_entity.h
deleted file mode 100644
index 80c6ff3..0000000
--- a/src/libjin/game/je_entity.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef __JE_ENTITY_H__
-#define __JE_ENTITY_H__
-
-#include "je_gameobject.h"
-
-namespace JinEngine
-{
- namespace Game
- {
-/*
- ///
- ///
- ///
- class Entity : public GameObject
- {
- public:
- Entity();
-
- private:
-
-
- };
-*/
- } // namespace Game
-} // namespace JinEngine
-
-#endif \ No newline at end of file
diff --git a/src/libjin/game/je_gameobject.cpp b/src/libjin/game/je_gameobject.cpp
index 1396518..731f3a7 100644
--- a/src/libjin/game/je_gameobject.cpp
+++ b/src/libjin/game/je_gameobject.cpp
@@ -1,4 +1,4 @@
-#include "je_entity.h"
+#include "je_gameobject.h"
namespace JinEngine
{
diff --git a/src/libjin/game/je_gameobject.h b/src/libjin/game/je_gameobject.h
index 7c6ec2b..e434caf 100644
--- a/src/libjin/game/je_gameobject.h
+++ b/src/libjin/game/je_gameobject.h
@@ -9,14 +9,13 @@
#include <set>
#include "../common/je_object.h"
-#include "../common/je_types.h"
-#include "../graphics/je_sprite.h"
+#include "../math/je_transform.h"
namespace JinEngine
{
namespace Game
{
- /*
+
///
/// Game object base class.
///
@@ -27,54 +26,13 @@ namespace JinEngine
///
///
///
- virtual ~GameObject();
-
- ///
- ///
- ///
- void lifecycle();
-
- ///
- ///
- ///
- void setVisible(bool isVisible);
-
- ///
- ///
- ///
- void setActive(bool isActive);
-
- ///
- ///
- ///
- void setOrder(uint32 order);
+ virtual ~GameObject() {};
protected:
- virtual void onAlive();
- virtual void onUpdate(float dt);
- virtual void onDraw();
- virtual void onDestroy();
-
- uint32 mLayer; // layer where entity belongs
- uint32 mOrder; // render index in layer
- uint32 mTag; // tag of entity, support 32 tags now
- bool mIsVisible; // if the entity is visible or not
- bool mIsActive; // if the entity is joined into the logic
-
Math::Transform mTransform;
};
- ///
- /// Entity list. For quickly adding and removing entities.
- ///
- typedef std::list<GameObject*> EntityList;
-
- ///
- /// Entity set. For searching and keeps entities unique and sorted.
- ///
- typedef std::set<GameObject*> EntitySet;
- */
} // namespace Game
} // namespace JinEngine
diff --git a/src/libjin/game/je_scene.cpp b/src/libjin/game/je_scene.cpp
deleted file mode 100644
index e69de29..0000000
--- a/src/libjin/game/je_scene.cpp
+++ /dev/null
diff --git a/src/libjin/game/je_scene.h b/src/libjin/game/je_scene.h
deleted file mode 100644
index 811d1a8..0000000
--- a/src/libjin/game/je_scene.h
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef __JE_GAME_SCENE_H__
-#define __JE_GAME_SCENE_H__
-
-#include "../core/je_configuration.h"
-#if defined(jin_game)
-
-#include <map>
-#include <list>
-
-#include "je_entity.h"
-
-namespace JinEngine
-{
- namespace Game
- {
-
- ///
- /// Handle all entities.
- ///
- class Scene
- {
- public:
- ///
- ///
- ///
- void addEntity(Entity* entity);
-
- ///
- ///
- ///
- EntityList& getEntitiesByTag(uint32 tag);
-
- ///
- ///
- ///
- EntityList& getEntitiesByLayer(uint32 layer);
-
- ///
- ///
- ///
- void setEntitiesActiveByTag(uint32 tag);
-
- ///
- ///
- ///
- void setEntitiesActiveByLayer(uint32 layer);
-
- ///
- ///
- ///
- void removeEntitiesByLayer(uint32 layer);
-
- ///
- ///
- ///
- void removeEntitiesByTag(uint32 tag);
-
- protected:
- // all entities
- EntitySet entities;
- // all entities grouped by layer, render order
- std::map<uint32, EntityList> layers;
- // all entities grouped by tag
- std::map<uint32, EntityList> tags;
-
- };
-
- } // namespace Game
-} // namespace JinEngine
-
-#endif // jin_game
-
-#endif \ No newline at end of file