#include "CS_Countdown_Trigger.h"

CS_Countdown_Trigger::CS_Countdown_Trigger()
{
	hp = 100;
}

void CS_Countdown_Trigger::Step()
{
	if (countdown > 0)
	{
		countdown--;
		if (countdown == 0)
		{
			hp = 0;
			Destroy();
		}
	}
}

void CS_Countdown_Trigger::SetState(std::wstring stateName, int lr)
{
	if (stateName == L"countdown")
	{
		countdown = lr;
	}
}

std::shared_ptr<Entity> CreateCS_Countdown_Trigger()
{
	return std::make_shared<CS_Countdown_Trigger>();
}
