| Unuk 1.0

- Main Page
- Classes
- Files

- File List
- File Members

src/libUnuk/Entity.h
Go to the documentation of this file.

    00001 #ifndef _ENTITY_H_
    00002 #define _ENTITY_H_
    00003 #include "Geometry.h"
    00004 #include "EntityType.h"
    00005 #include "Static.h"
    00006
    00007 class GameWorld;
    00008
    00009 /*
    00010  * Entity is static because we will mainly be handling
    00011  * pointers (that can be copied around) but we want
    00012  * all entities to be initiaized by the gameworld.
    00013  */
    00014
    00015 class Entity : private Static {
    00016 public:
    00017   Entity(GameWorld* const gameWorld);
    00018   virtual ~Entity(void);
    00019
    00020   void Prepare(float dt);
    00021   void Render(void) const;
    00022   void PostRender(void);
    00023   bool Initialize(void);
    00024   void Shutdown(void);
    00025   bool CanBeRemoved(void) const;
    00026   void Destroy(void);
    00027
    00028   virtual Vector2 GetPosition(void) const = 0;
    00029   //virtual Vector2 GetVelocity() const = 0;
    00030   virtual void SetPosition(const Vector2& position) = 0;
    00031
    00032   virtual EntityType GetType(void) const = 0;
    00033
    00034 private:
    00035   virtual void OnPrepare(float dt)    = 0;
    00036   virtual void OnRender(void) const   = 0;
    00037   virtual void OnPostRender(void)     = 0;
    00038   virtual bool OnInitiaize(void)      = 0;
    00039   virtual void OnShutdown(void)       = 0;
    00040
    00041   bool m_canBeRemoved;
    00042
    00043   GameWorld* m_world;
    00044 };
    00045
    00046 #endif

All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines