mkRPG
src/editor/Game/entity.h
Go to the documentation of this file.
00001 #ifndef ENTITY_H
00002 #define ENTITY_H
00003 
00004 
00005 
00013 #include "object.h"
00014 
00015 
00016 
00017 class EntityType; 
00021 class EntityType : public Type<EntityType>
00022 {
00023 public:
00024     TypeName(EntityType)
00025     EntityType(EntityType &ancestor);
00026     EntityType(DefaultTypes &parent);
00027 
00028 
00029     inline Image* image() const{return aImage ? aImage : aTypedAncestor ? aTypedAncestor->image() : nullptr;}
00030     inline void setImage(Image* im){aImage = im; touch();}
00031 
00032 
00033 private:
00034     Image * aImage;
00035 };
00036 
00040 class Entity : public TypedObject<EntityType>
00041 {
00042 public:
00043     TypeName(Entity)
00044     Entity(EntityType &type, GameObject &parent);
00045 
00046     EntityType &entityType(){return *aObjectType;}
00047 
00048 };
00049 
00050 
00051 
00052 
00053 
00054 #endif // ENTITY_H
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Defines