#include "CS_Sprinkler.h"

CS_Sprinkler::CS_Sprinkler()
{
	ani.png = L"CS_CaveStoryMod";
	ani.sprite_index = L"ls_sprinkler";
	drawBeforeOtherEntity = true;
}

void CS_Sprinkler::Step()
{
	if (lr == 0)
	{
		if (++ani_wait > 1)
		{
			ani_wait = 0;
			++ani_no;
		}

		if (ani_no > 1)
		{
			ani_no = 0;
			return;
		}
		ani.image_index = ani_no;
	}
	else
	{
		ani_wait = 0;
		ani.image_index = 0;
	}
}

void CS_Sprinkler::SetState(int stateID, int lr)
{
	this->lr = lr;
}

std::shared_ptr<Entity> CreateCS_Sprinkler()
{
	return std::make_shared<CS_Sprinkler>();
}


