#ifndef GAME_OBJECT_H
#define GAME_OBJECT_H

#include "engine/ientity.h"
#include "engine/camera.h"

#include "render/model.h"
#include "render/modelsystem.h"

#include "game_lua_help.h"

enum EMovmentDir
{
	EMovementDir_None = 1 << 0,
	EMovementDir_Forward = 1 << 1,
	EMovementDir_Backward = 1 << 2,
	EMovementDir_Left = 1 << 3,
	EMovementDir_Right = 1 << 4
};

class Entity : public IEntityBase
{
public:
	Entity();
	virtual ~Entity();

	virtual void Update(float dt);
	virtual void Render();

	// Game entity extensions
	virtual void LoadModel(const char* filename);
	void SetVisible(bool visible);
	bool GetVisible();


	void InitFromTable(LuaPlus::LuaObject& _object);

protected:
	Model* m_model;

	LuaPlus::LuaObject m_luaObject;
	LuaPlus::LuaObject m_onInitFunction;
	LuaPlus::LuaObject m_onShutdownFunction;
	LuaPlus::LuaObject m_onUpdateFunction;
};

class TempPlayer : public Entity
{
public:
	TempPlayer();
	~TempPlayer();

	virtual void Update(float dt);

	void UpdateCameraMovement(float dt);

	void UpdateCameraLook();

private:
	uint32_t GenMovementDir();

private:
	Camera m_camera;
};

class Weapon : public Entity
{
public:
	Weapon();
	~Weapon();

	virtual void Update(float dt);
};

#endif // !GAME_OBJECT_H
