#include "CS_SantaFishSwim.h"
const int CS_SantaFishSTATENAME_SWIM = ++entityStateID;
CS_SantaFishSwim::CS_SantaFishSwim()
{
	stateID = CS_SantaFishSTATENAME_SWIM;
}

void CS_SantaFishSwim::State()
{
	auto we = e.lock();
	if (!we)
		return;

	const wchar_t* move = L"";
	if (we->ud == -1)
		move = we->lr == 0 ? L"mc_santafish_swim_lu" : L"mc_santafish_swim_ru";
	else if (we->ud == 0)
		move = we->lr == 0 ? L"mc_santafish_swim_l" : L"mc_santafish_swim_r";
	else if (we->ud == 1)
		move = we->lr == 0 ? L"mc_santafish_swim_ld" : L"mc_santafish_swim_rd";
	we->ani.sprite_index = move;
}

void CS_SantaFishSwim::ChangeStateMsg(int stateID)
{
	if (stateID == GetStateID())
		enable = true;
	else
		enable = false;
}
