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

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

	const wchar_t* move = L"";
	if (we->ud == -1)
		move = we->lr == 0 ? L"mc_santa_move_lu" : L"mc_santa_move_ru";
	else
		move = we->lr == 0 ? L"mc_santa_move_l" : L"mc_santa_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_SantaMove::ChangeStateMsg(int stateID)
{
	if (stateID == GetStateID())
		enable = true;
	else
		enable = false;
}
