00001 #pragma once
00002
00003 #include "SDL.h"
00004
00005 #include <string>
00006
00007
00008 class List;
00009
00010 typedef enum { TILE, ENEMY, PLAYER, BULLET, EVENTPOINT, CAMERA, CUTSCENE, DOOR } CollisionType;
00011
00012
00013 class Object
00014 {
00015 public:
00016 Object();
00017 Object(List* objInfo, int x, int y);
00018 virtual SDL_Rect getBox(){ return _box; };
00019 virtual void collide( Object* o ){};
00020 virtual void draw() = 0;
00021 virtual void update(){};
00022 virtual std::string id() {return _id;}
00023 virtual void setId(std::string id){_id = id;}
00024
00025 virtual void load(List *objInfo) {}
00026
00027 static Object* loadObject(std::string filename, int x , int y );
00028
00029
00030 virtual void control(){};
00031
00032
00033 bool collidable(){ return _collidable; };
00034 void setCollidable( bool b ){ _collidable = b; };
00035 double getDepth(){ return _depth; };
00036 void setDepth( double depth ){ _depth = depth; };
00037 CollisionType getType(){ return _type; };
00038 void setType( CollisionType type ){ _type = type; };
00039
00040 protected:
00041 SDL_Rect _box;
00042 bool _collidable;
00043 double _depth;
00044
00045 std::string _id;
00046 CollisionType _type;
00047 };