#ifndef _UG_PLAYER_
#define _UG_PLAYER_

#include <hpllib/HPLLib.h>

//#include "UGManaCard.h"

namespace PlayerType{
	enum{
		Udonge,
	};
};

class UGPlayer: public HPLPlayer{
private:

	/**
		中級魔法のチャージ完了点滅
		brightでした
	*/
	bool isChargeLight;
	bool isCharging_;

	/** 瞬きカウンター */
//	HPLCounter* mabatakiCounter;

	int seqID;

	int oldID;
public:
	void setSequenceID(int s){
		seqID = s;
		getSequence()->resetCounter();
	}
/*	void processMabataki();
	bool isBoring(){
		if(mabatakiCounter->isAlive() == false){
			return true;
		}

		return false;
	}

	bool isChargeReady(){
		if(getSelectedManaCard()->getCharge() == getSelectedManaCard()->getChargeMax()){
			return true;
		}

		return false;
	}

	void setCharging(bool b){
		isCharging_ = b;

		if(b == false){
			manaCardList[getSelectedManaCardIndex()].setCharge(0);
		}
	}
	bool isCharging(){
		return isCharging_;
	}

	UGManaCard* getSelectedManaCard(){
		return &manaCardList[getSelectedManaCardIndex()];
	}

	int getSelectedManaCardIndex(){
		return selectedManaCardIndex;
	}
	void setSelectedManaCardIndex(int sel){
		if(sel < 0){
			sel = manaCardList.size() - 1;
		}
		if(sel >= manaCardList.size()){
			sel = 0;
		}
		/////
		// 切り替えると中級チャージは0になるのだった
		manaCardList[getSelectedManaCardIndex()].setCharge(0);
		manaCardList[sel].setCharge(0);
		selectedManaCardIndex = sel;
	}

	UGMagic::Magic* getMagic(){
		return &magic;
	}

	HPLSprite* undelsenSprite;
	HPLSprite* durandanaSprite;
	HPLSprite* evigenSprite;
	//HPLSprite;
*/
	UGPlayer(int t);
	virtual ~UGPlayer();

	/** AIBOOOOO! */
//	UGPlayer* aibo;

	/** */
	void collision(HPLMatrix<int>* matrix,
		std::map<int, HPLBlock*>* blockMap){}
	/**
		入力情報に対する動作設定
	*/
	void input(HPLSDLInputManager* inputManager){}

	void die(HPLShootingObject* damageSource);

	/**
		@param dmg ダメージ量
		@param damageSource ダメージ源となるオブジェクト
	*/
	void damage(float dmg, HPLShootingObject* damageSource,
		bool isInv, int nextState);
	void damage(float dmg, HPLShootingObject* damageSource);

	void draw(HPLSDLImageManager* imageManager);
/*	void drawHeadUpMana(HPLSDLImageManager* imageManager);
	void drawCharge(HPLSDLImageManager* imageManager);
*/
	bool isAutoCrouch(){return false;}
	HPLSequence* getSequence();
	int getSequenceID();
	void changeState(int st);

	/////
	/** プレイヤーのステートを元に戻す */
	int rollBackState();

	/** オーバーライド */
	void setType(int t);
};

#endif
