#ifndef GameObject_h_INCLUDED
#define GameObject_h_INCLUDED

#include <vector>

#include <Autodestroyable.h>

class Player;

class GameObject: public Autodestroyable
{
public:
	enum {
		GAMEOBJECT_UNKNOWN, 
		GAMEOBJECT_GIRLBODY, 
		GAMEOBJECT_BATTERY, 
		GAMEOBJECT_MEDICALROBOT, 
		GAMEOBJECT_CHEMICALLIQUID, 
		GAMEOBJECT_PAPER, 
		GAMEOBJECT_EXPLOSION,
		GAMEOBJECT_CHEMICALBOTTLE,
		GAMEOBJECT_FIREFIGHTERROBOT,
		GAMEOBJECT_GIRLBLOOD,
		GAMEOBJECT_SCREWDRIVER};
	GameObject(int parId, const vector3df& pos);
	void manage(Player* player, std::vector<GameObject*>& gameObjects);
	const vector3df& getPosition() const {return objectNode->getPosition();}
	~GameObject();
	bool isCollidingPos(aabbox3df box, const vector3df& pos) const;
	bool needShakingScreen();

	std::vector<GameObject*> getPendingCreatedObjects() {return pendingCreatedObjects;}
	void clearPendingCreatedObjects() {pendingCreatedObjects.clear();}

	int getAndClearStupidEndId() {int tmp = stupidEndId;stupidEndId = -1;return tmp;}
private:
	ISceneNode* objectNode;
	ITextSceneNode* textNode;
	IBillboardSceneNode* balloon;
	IShadowVolumeSceneNode* shadow;
	int id;
	bool isTextNodeVisible;
	bool is3DMesh;
	bool isCollidable;
	void setPosition(const vector3df& pos);
	u32* customIdData;
	std::vector<GameObject*> pendingCreatedObjects;
	void setTextNodeText(const std::string& text);
	int stupidEndId;
};

typedef std::vector<GameObject*> GameObjectVector;
typedef std::vector<std::string> GlobalMessageVector;

#endif //GameObject_h_INCLUDED
