#include "CS_HealthRefillWater.h"

CS_HealthRefillWater::CS_HealthRefillWater()
{
	ani.png = L"CS_CaveStoryMod";
	ani.sprite_index = L"ls_healthrefill_water";
	cbRect.enableCbRect = true;
	cbRect.enableSoild = true;
	cbRect.left = cbRect.right = 5;
	cbRect.top = 6;
	cbRect.bottom = 8;
	drawBeforeOtherEntity = true;
}

void CS_HealthRefillWater::Init(std::weak_ptr<Entity> self)
{
	stateGravity.Init(shared_from_this());
	stateResist.Init(shared_from_this());
	stateSplash.Init(shared_from_this());
	Entity::Init(self);
}

void CS_HealthRefillWater::Step()
{
	//跟上移动平台
	Entity::BeginMovingPlatform();
	stateGravity.Step();
	stateResist.Step();
	stateSplash.Step();
	//跟上移动平台
	Entity::EndMovingPlatform();
	//清除最后一次碰撞结果
	Entity::ClearCollisionResult();
	//执行运动
	Entity::Step();
	//执行碰撞
	Entity::Collision();
}

std::shared_ptr<Entity> CreateCS_HealthRefillWater()
{
	return std::make_shared<CS_HealthRefillWater>();
}
