#include "InputSymbolController.h"


et::InputSymbolController::InputSymbolController(mof::InputReceiver* pInput)
: SymbolController()
{
	m_pInput = pInput;
}

et::InputSymbolController::~InputSymbolController(void)
{
}

void et::InputSymbolController::move(Symbol* pSymbol){


	mof::Vector3D nextPosition = pSymbol->getPosition();
	//とりあえず移動させてみて、壁がきたら静止させる
	if(m_pInput->checkKeyState(mof::InputReceiver::UP)){
		nextPosition.z += 0.15f;
		pSymbol->move(et::Symbol::UP , nextPosition , 6);
	}
	else if(m_pInput->checkKeyState(mof::InputReceiver::DOWN)){
		nextPosition.z -= 0.15f;
		pSymbol->move(et::Symbol::DOWN , nextPosition , 6);
	}
	else if(m_pInput->checkKeyState(mof::InputReceiver::LEFT)){
		nextPosition.x -= 0.15f;
		pSymbol->move(et::Symbol::LEFT , nextPosition , 6);
	}
	else if(m_pInput->checkKeyState(mof::InputReceiver::RIGHT)){
		nextPosition.x += 0.15f;
		pSymbol->move(et::Symbol::RIGHT , nextPosition , 6);
	}
}
