/*!
* @file HaveHp.cpp
* @brief HP保持抽象クラスを定義する
* @date 2014/06/11
* @author Deskull
* 2014 Sikabane Works.
*/

#include "stdafx.h"
#include "HaveHp.h"

namespace Deeangband
{
	HaveHp::HaveHp(void)
	{
		return;
	}

	HaveHp::~HaveHp(void)
	{
		return;
	}

	HP HaveHp::GetCurHP(void)
	{
		return this->currentHp;
	}

	HP HaveHp::GetMaxHP(void)
	{
		return this->maxHp;
	}

	HP HaveHp::GetNorMaxHP(void)
	{
		return this->maxMaxHp;
	}

	void HaveHp::CalcHP(HP amount)
	{
		this->currentHp += amount;
		if(this->currentHp < 0) this->currentHp = 0;
		if(this->currentHp > this->maxHp) this->currentHp = this->maxHp;
	}

	void HaveHp::SetHP(HP amount)
	{
		this->currentHp = amount;
		if(this->currentHp < 0) this->currentHp = 0;
		if(this->currentHp > this->maxHp) this->currentHp = this->maxHp;
	}

	void HaveHp::CalcMaxHP(HP amount)
	{
		this->maxHp += amount;
		if(this->maxHp < 0) this->maxHp = 0;
		if(this->maxHp > this->maxMaxHp) this->maxHp = this->maxMaxHp;
	}

	void HaveHp::SetMaxHP(HP amount)
	{
		this->maxHp = amount;
		if(this->maxHp < 0) this->maxHp = 0;
		if(this->maxHp > this->maxMaxHp) this->maxHp = this->maxMaxHp;
	}

	void HaveHp::CalcMaxMaxHP(HP amount)
	{
		this->maxMaxHp += amount;
		if(this->maxMaxHp < 0) this->maxMaxHp = 0;
	}

	void HaveHp::SetMaxMaxHP(HP amount)
	{
		this->maxMaxHp = amount;
		if(this->maxMaxHp < 0) this->maxMaxHp = 0;
	}

}
