/*Copyright (C) 2010 Deveaux Duncan

This file is part of Hikou no mizu.

Hikou no mizu 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 3 of the License, or
(at your option) any later version.

Hikou no mizu 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 Hikou no mizu.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef DEF_GESTIONNAIRE_ANIMATION
#define DEF_GESTIONNAIRE_ANIMATION

#include <SFML/Graphics.hpp>
#include <vector>
#include <string>
#include "Moteurs/MoteurGraphique.hpp"
#include "Autres/TinyXML/tinyxml.h"
#include "Animation.hpp"

class GestionnaireAnimation
{	
	public:
		GestionnaireAnimation(std::string pCheminAnimations, std::string pCheminListeAnimations);
		
		void lanceAnimation(bool pAnimBloquante, int pIdAnimation, int pIdAnimationRetour=0);
		void executeAnimation();
		
		void demarreAffichage(MoteurGraphique &pMoteurRendu);
		void supprimeAffichage(MoteurGraphique &pMoteurRendu);
		
		
		Animation *getActAnimation();
		bool getAnimBloquanteLancee();
		const sf::Vector2f &getOrigineAnimation() const;
		
		void setSensAnimations(int pSens);
		int getSensAnimations() const;
		
		float getLargeurAnimation() const;
		float getHauteurAnimation() const;
		
		void setPositionAnimationsX(float pPosition);
		float getPositionAnimationsX() const;
		void setPositionAnimationsY(float pPosition);
		float getPositionAnimationsY() const;
	
	private:
		void chargeListeAnim(std::string pCheminAnimations, std::string pCheminListeAnimations);
		
		std::vector<Animation> listeAnimations;
		std::vector<int> listePositionsOrigine;
		sf::Sprite imageMoteurRendu;
		int sensAnimations;
		int changeSens;
		int iAnimation;
		int iAnimationRetour;
		bool animBloquanteLancee;
};

#endif
