/*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_FIGHT
#define DEF_FIGHT

#include <SFML/Graphics.hpp>
#include <sstream>
#include "extlibs/TinyXML/tinyxml.h"

#include "Engines/Graphics/GraphicsEngine.hpp"
#include "Engines/Graphics/ImageEngine.hpp"
#include "Engines/Physics/PhysicsEngine.hpp"
#include "GUI/Complex/FightInterface.hpp"
#include "Player/Player.hpp"

#include "Screens/Screen.hpp"

class GameEngine;

//Screen's inheriting class representing the fight screen
class Fight : public Screen
{
    public:
        Fight(GameEngine *gameEngine);
        ~Fight();
        
        void addPlayer(const std::string &playerName);
        void clearPlayers();
        
        //Screen virtual method
        void run();
    
    private:
        Player *loadPlayer(const std::string &playerName, const std::string &xmlPath);
        void deletePlayers();
        
        GameEngine *m_gameEngine;
        sf::RenderWindow *m_renderWindow;
        
        std::vector<Player*> m_playersList;
        
        sf::View m_gameView;
        sf::Sprite m_background;
        sf::Text m_fpsText;
        
        FightInterface m_interface;
        
        GraphicsEngine m_gameRenderEngine;
        GraphicsEngine m_interfaceRenderEngine;
        PhysicsEngine m_physicsEngine;
};

#endif