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

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

	const wchar_t* move = L"";
	if (we->ud == -1)
		move = we->lr == 0 ? L"mc_jackfish_swim_lu" : L"mc_jackfish_swim_ru";
	else if(we->ud == 0)
		move = we->lr == 0 ? L"mc_jackfish_swim_l" : L"mc_jackfish_swim_r";
	else if (we->ud == 1)
		move = we->lr == 0 ? L"mc_jackfish_swim_ld" : L"mc_jackfish_swim_rd";
	we->ani.sprite_index = move;
}

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