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

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

	const wchar_t* move = L"";
	if (we->ud == -1)
		move = we->lr == 0 ? L"mc_kanpa_move_lu" : L"mc_kanpa_move_ru";
	else
		move = we->lr == 0 ? L"mc_kanpa_move_l" : L"mc_kanpa_move_r";
	we->ani.sprite_index = move;
	if ((we->ani.image_index == 1 || we->ani.image_index == 3) && playWalkSound)
	{
		we->gameFunc->PlaySound(L"CS_024_quote_walk");
		playWalkSound = false;
	}
	if (we->ani.image_index == 0 || we->ani.image_index == 2)
		playWalkSound = true;
}

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