#pragma once

#include "SDL.h"

#include <string>


class List;

typedef enum { TILE, ENEMY, PLAYER, BULLET, EVENTPOINT, CAMERA, CUTSCENE, DOOR, BOSS } CollisionType;


class Object
{
public:
	Object();
	Object(List* objInfo, int x, int y);
	virtual SDL_Rect getBox(){ return _box; };
	virtual void collide( Object* o ){};
	virtual void draw() = 0;
	virtual void update(){};
	virtual std::string id() {return _id;}
	virtual void setId(std::string id){_id = id;}

	virtual void setPos(int x, int y) {_box.x = x; _box.y = y;}

	virtual void load(List *objInfo, bool fromConstructor = true) {}

	static Object* loadObject(std::string filename, int x , int y );
	//static Object* load(List * objInfo, int x, int y) =0;

	virtual Object *copy(){return NULL;}

	virtual void control(){};

	// Accessor functions
	bool collidable(){ return _collidable; };
	void setCollidable( bool b ){ _collidable = b; };
	bool solid(){ return _solid; };
	void setSolid( bool b ){ _solid = b; };
	double getDepth(){ return _depth; };
	void setDepth( double depth ){ _depth = depth; };
	CollisionType getType(){ return _type; };
	void setType( CollisionType type ){ _type = type; };

	std::string getId() {return _id;};

protected:
	SDL_Rect _box;
	bool _collidable;
	bool _solid;
	double _depth;

	std::string _id;
	CollisionType _type;
};
