#pragma once
#include "cocos2d.h"
#include "SoundMaster.h"

class HUDScene: public cocos2d::Layer
{
private:
	cocos2d::Menu* _menu;
	cocos2d::MenuItemImage* _pauseButton;
	cocos2d::MenuItemImage* _resumeButton;
	cocos2d::MenuItemImage* _exitButton;
	cocos2d::MenuItemImage* _soundButton;
	
	cocos2d::Sprite* _menuBG;

	cocos2d::Vector<cocos2d::Sprite*> _healthbars;
	cocos2d::Vector<cocos2d::Sprite*> _healths;
	cocos2d::Vector<cocos2d::Sprite*> _throws;

	std::vector<cocos2d::Vector<cocos2d::Sprite*> > _actionPoints;

public:
	bool _soundState;
	static cocos2d::Scene* scene();
	virtual void onExit();
	
	bool init();
	void endButtonRef(Layer* layer,cocos2d::SEL_MenuHandler sel);
	
	//void tradeButtonPressed(cocos2d::Ref* pSender);
	void resumeButtonPressed(cocos2d::Ref* pSender);
	void pauseButtonPressed(cocos2d::Ref* pSender);
	void soundButtonPressed(cocos2d::Ref* pSender);

	void showPauseMenu(bool vis);

	void showGoodEnd(int score);
	void showBadEnd(int score);
	void showEnd(bool good, int score);

	void showAP(int player,int number);
	void showHealth(int player, float ratio);
	void showThrow(int player, bool _throw);
	void showPlayer(int player, bool vis);

	CREATE_FUNC(HUDScene);
};

