#include "CS_CurlyFaceToBack.h"
#include "CS_Curly.h"
const int CS_CurlySTATENAME_FACETOBACK = GetNextEntityStateID();
CS_CurlyFaceToBack::CS_CurlyFaceToBack()
{
	stateID = CS_CurlySTATENAME_FACETOBACK;
}

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

	auto mychar = std::static_pointer_cast<CS_Curly>(we);
	if (mychar->fishState)
		we->ani.sprite_index = we->lr == 0 ? L"mc_curlyfish_back_l" : L"mc_curlyfish_back_r";
	else
		we->ani.sprite_index = we->lr == 0 ? L"mc_curly_back_l" : L"mc_curly_back_r";
}

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