#ifndef CREMONTEE_H_INCLUDED
#define CREMONTEE_H_INCLUDED

#include <irrlicht.h>
#include "CTronconRM.h"
#include "CPyloneRM.h"
#include "CVehicule.h"
#include "audiere.h"

using namespace irr;
using namespace audiere;

class CRemontee
{
    public:

	CRemontee();

	~CRemontee();

	enum
    {
        RM_TKF = 1,
        RM_TKD = 2,
        RM_TSF2 = 3
    };

	virtual void SetName(core::stringc);
	virtual core::stringc GetName();
	virtual void SetID(core::stringc);
	virtual core::stringc GetID();
	virtual void SetPositionDepart(core::vector3df);
	virtual void SetPositionArrivee(core::vector3df);
	virtual core::vector3df GetPositionDepart();
	virtual core::vector3df GetPositionArrivee();
	virtual void DrawRemonteeDepart();
	virtual void DrawRemonteeArrivee();
	virtual core::vector3df GetRotationRM();

	virtual void RedrawCable();
	virtual void AnimateRm(core::vector3df,f32);
	virtual void PlaceVehicules();
	virtual void UpdateTroncons();
	virtual void PlaySoundMoteur(bool);
	virtual OutputStreamPtr GetSoundMoteur();
	virtual CTronconRM* GetTronconByNumero(u32);
	virtual f32 GetAngleBetween(const core::vector3df&,const core::vector3df&);
	virtual u32 CompressionOrSupport(const core::vector3df&,const core::vector3df&,const core::vector3df&);


	u32 typeRM;               //Type de RM (teleski/télésiège etc...) voir enum ci-dessus
	f32 vitesse;              //Vitesse en cours de la RM
	f32 vitesseMax;           //Vitesse max de la RM
	bool constructionFinie;   //Si on on terminé la construction du RM -> on peut l'animer
	bool proprietesOuvert;    //Si la fenetre des propriétés du RM est déja ouverte
	bool enMarche;            //Si le RM est en marche

	core::array<CTronconRM*> arrTroncons;
	core::array<CPyloneRM*> arrPylones;
	core::array<CVehicule*> arrVehicules;

	protected:

	f32 espacementVehicules;     //Distance d'espacement entre chaque vehicule
    core::stringc remonteeName;  //Stocke le nom de la remontee
    core::vector3df positionDepart;
    core::vector3df rotationDepart;
    core::vector3df positionArrivee;
    core::vector3df rotationArrivee;

    AudioDevicePtr deviceA;       //Pointeur vers le gestionnaire audio Audiere
    OutputStreamPtr soundMoteur;  //Son du moteur de la RM
};


#endif // CREMONTEE_H_INCLUDED
