#ifndef CMOUNTAIN_H_INCLUDED
#define CMOUNTAIN_H_INCLUDED

#include <irrlicht.h>
#include <fstream>
#include "CStation.h"
#include "CArbre.h"
#include "CTKFixe.h"
#include "CTSFixe.h"
#include "CTKDebrayable.h"
#include "CRider.h"

using namespace irr;

class CMountain
{
    public:

    enum
    {
        TERRAIN_NODE_ID = 1,
        STATION_NODE_ID = 2,
        ARBRE_NODE_ID = 3,
        TKF_NODE_ID = 4,
        TSF2_NODE_ID=5,
        TKD_NODE_ID=6
    };

	CMountain(core::stringc);

	~CMountain();

	video::IVideoDriver* driver;
	scene::ISceneManager* smgr;
	IrrlichtDevice *device;

	void LoadMountain();
	CArbre* getArbreByID(core::stringc);
	CRemontee* getRemonteeByID(core::stringc);
	core::vector3df clickTerrainCoordinates();
	scene::ISceneNode* getNodeByClick();

	//f32 getTerrainHeight(f32,f32);
	f32 GetHeight(const core::vector3df&, f32);
	scene::ITerrainSceneNode* terrain;
	scene::ITriangleSelector* selector;

	core::array<CArbre*> arrArbres;
	core::array<CStation*> arrStations;
    core::array<CRemontee*> arrRemontees;
    core::array<CRider*> arrRiders;


	private:

	//core::array<CStation> stations;

	scene::ISceneNode* skybox;

	core::stringc configFileName;
	core::stringc mountainMap;
    core::stringc heightfieldFilename;
    core::stringc terrainTextureFilename;



    const core::array<std::string> explode(const std::string&, const char&);
};


#endif // CMOUNTAIN_H_INCLUDED
