/************************************************************************/
/* Ex Nihlo Engine by Hermanns Christophe								*/
/************************************************************************/
/* This program is free software; you can redistribute it and/or		*/
/* modify it under the terms of the GNU General Public License			*/
/* as published by the Free Software Foundation; either version 2		*/
/* of the License, or (at your option) any later version.				*/
/*																		*/
/* This program is distributed in the hope that it will be useful,		*/
/* but WITHOUT ANY WARRANTY; without even the implied warranty of		*/
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.					*/
/*																		*/
/* See the GNU General Public License for more details.					*/
/*																		*/
/* You should have received a copy of the GNU General Public License	*/
/* along with this program; if not, write to the Free Software			*/
/* Foundation, Inc., 59 Temple Place - Suite 330,						*/
/* Boston, MA  02111-1307, USA.											*/
/*																		*/
/* If you use a important part of this code please send me a mail		*/
/* I just want to see where my code go thks :)							*/
/************************************************************************/

/************************************************************************/
/* Contact                                                              */  
/************************************************************************/
/* ExNihilo Website :www.ploksoftware.org                               */
/*                                                                      */
/* Hermanns Christophe ExNihilo creator and main programmer             */
/*                                                                      */
/* Mail             : Data@ploksoftware.org								*/
/* ICQ              : 8030901											*/
/* MSN Messenger    : Data_7@hotmail.com								*/
/*                                                                      */
/*                                                                      */
/************************************************************************/

/************************************************************************/
/* File Description             										*/
/************************************************************************/
/* File Name   :ExManagerModel.h										*/
/*																		*/
/* Start Date  :03/15/2002												*/
/*																		*/
/* Last Update :06/20/2003                                              */
/*																		*/
/* File Description :													*/
/*                                                                      */
/* For update of this file check : www.ploksoftware.org                 */
/************************************************************************/

#ifndef __EXMANAGERMODEL_H__
#define __EXMANAGERMODEL_H__
//------------------------------------------------------------------------
//Includes
//------------------------------------------------------------------------
#include "ExDefine.h"
//------------------------------------------------------------------------
#include "Math/ExMath.h"
//------------------------------------------------------------------------
#include "Manager/ManagerObject/ExManagerObject.h"
#include "Manager/ManagerObject/ExManagerTexture.h"
#include "Manager/ManagerObject/ExManagerVertexArrays.h"
//------------------------------------------------------------------------
#include "Object/Object3d/Model/ExCModel.h"
#include "Object/Object3d/Model/ExCModelMD2.h"
#include "Object/Object3d/Model/ExCModelMD3.h"
#include "Object/Object3d/Model/ExCModelASC.h"
#include "Object/Object3d/Model/ExCModel3DS.h"
#include "Object/Object3d/Model/ExCModelOBJ.h"
#include "Object/Object3d/Model/ExCModelEXM.h"
//------------------------------------------------------------------------
enum	ModelType
{
	MODEL_MD2,MODEL_MD3,MODEL_ASC,MODEL_ASE,MODEL_3DS,MODEL_OBJ,MODEL_EXM,MODEL_UNKNOW
};
//------------------------------------------------------------------------
class ExManagerModel : public ExManagerObject<ExCModel *> 
{
private:
//------------------------------------------------------------------------
// Variable
//------------------------------------------------------------------------
	ExManagerTexture				*ManagerTexture;
	ExManagerVertexArrays			*ManagerVertexArrays;
	
	ModelType FindModelType(std::string FileName);
//------------------------------------------------------------------------
// Singleton creation
//------------------------------------------------------------------------
	static bool m_flag; 
	static ExManagerModel *m_instance;
	ExManagerModel(void);
	~ExManagerModel(void);
public:
	static ExManagerModel*  CreateSingleton(void);
//------------------------------------------------------------------------
// Methode
//------------------------------------------------------------------------
	
	ExCAction InputCommand(ExCCommand Command);
	ExCAction InputAction(ExCAction Action);

	inline void SetManagerTexture(ExManagerTexture * Texture){ManagerTexture = Texture;}
	inline void SetManagerVertexArrays(ExManagerVertexArrays * VertexArrays){ManagerVertexArrays = VertexArrays;}
	void Reset(void);
	void Init(void);
	void Reload(void);
	void List(void);
	void Draw(void);
	ExNihilo::ExId Load(std::string FileName);
	ExNihilo::ExId Load(std::string FileName,std::string ObjectName);

	ExCModel* GetObject(ExNihilo::ExId id);
	ExCModel* GetCurrentObject(void);
};
//------------------------------------------------------------------------
#endif //__EXMANAGERMODEL_H__
