#ifndef _TT_PLAYER_MANAGER_
#define _TT_PLAYER_MANAGER_

#include "GPlayer.h"

#include "GPlayerSetting.h"

#include <map>
#include <vector>

namespace GPlayerManagerConsts {
	static const float AUTO_CROUCH_HP_THRESHOLD = 0.3f;
}

class GPlayerManager{
public:
	std::map<int, GPlayerSetting> m_mapPlayerSettingMap;		//! プレイヤーの攻撃等の設定一覧

private:
	void standToWalk(GPlayer* player, HPLVector* velocityAngle);
	void walkToStand(GPlayer* player, HPLVector* velocityAngle);
	void jump(GPlayer* player, HPLVector* velocityAngle);
	void crouch(GPlayer* player, HPLVector* velocityAngle);

	void playerJump(GPlayer* player, HPLVector* velocityAngle);
public:
	GPlayerManager();
	~GPlayerManager();
public:
	void move(GPlayer* player, HPLVector* velocityAngle);
	void collisionCheck(GPlayer* player, HPLVector* center, HPLVector* velocityAngle);

	void attack(GPlayer* player, HPLVector* center, HPLVector* velocityAngle);

	/**
		相棒AI
	*/
	void moveAI(GPlayer* player);

	/******
		移動する（障害物があれば飛び越える)
	*/
	void moveOverObject(GPlayer* player, int direction);
	
	/**
		敵に対する行動
	*/
	bool actionAgainstEnemy(GPlayer* player, GPlayer* enemy);

	/**
		isCheckFarY上下の差が大きい部分も確認するかどうか
	*/
	bool searchFarEnemy(GPlayer* player, bool isCheckOnlyNearY,
		bool isCheckMeleeThreshold);

	/** 単体の敵に対して攻撃対象とするかどうか判断
	  * @retval		true		見つけた
	  * @retval		false		見つからない
	  */
	bool checkEnemy( GPlayer* player, bool isCheckOnlyNearY,
		bool isCheckMeleeThreshold, GPlayer* lpEnemy );

	/**
	  */
	void checkHitToPlayer( GPlayer* lpPlayer );

	/**
	  */
	bool checkHitToOnePlayer( GPlayer* lpPlayer, GPlayer* lpTargetPlayer );

	bool isSkipToSearch( GPlayer* lpPlayer, GPlayer* lpTarget );
};

#endif
