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

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

	we->ani.sprite_index = we->lr == 0 ? L"mc_puppy_move_l" : L"mc_puppy_move_r";
	if ((we->ani.image_index == 1 || we->ani.image_index == 3) && playWalkSound)
	{
		we->gameFunc->PlaySound(L"CS_puppy_move");
		playWalkSound = false;
	}
	if (we->ani.image_index == 0 || we->ani.image_index == 2)
		playWalkSound = true;
}

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