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

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

	const wchar_t* move = L"";
	if (we->ud == -1)
		move = we->lr == 0 ? L"mc_king_move_lu" : L"mc_king_move_ru";
	else
		move = we->lr == 0 ? L"mc_king_move_l" : L"mc_king_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_KingMove::ChangeStateMsg(int stateID)
{
	if (stateID == GetStateID())
		enable = true;
	else
		enable = false;
}
