#include "CS_JackMove.h"
const int CS_JackSTATENAME_MOVE = GetNextEntityStateID();
CS_JackMove::CS_JackMove()
{
	stateID = CS_JackSTATENAME_MOVE;
}

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

	const wchar_t* move = L"";
	if (we->ud == -1)
		move = we->lr == 0 ? L"mc_jack_move_lu" : L"mc_jack_move_ru";
	else
		move = we->lr == 0 ? L"mc_jack_move_l" : L"mc_jack_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_JackMove::ChangeStateMsg(int stateID)
{
	if (stateID == GetStateID())
		enable = true;
	else
		enable = false;
}
