farmlands/src/controller/PlayerController.h

53 lines
863 B
C++

/*
* PlayerController.h
*
* Created on: Nov 27, 2016
* Author: tibi
*/
#ifndef CONTROLLER_PLAYERCONTROLLER_H_
#define CONTROLLER_PLAYERCONTROLLER_H_
#include <SDL2/SDL.h>
namespace farmlands {
// Forward declarations
struct GameState;
namespace controller {
class PlayerController
{
public:
PlayerController();
virtual ~PlayerController();
/**
* Initializes game renderer
*/
void initialize(GameState* gameState);
/**
* Processes an event.
*
* @returns true if the event was handled, or false otherwise.
*/
bool processEvent(SDL_Event& event);
/**
* Called at the update logic step for every frame
*/
void updateLogic();
private:
bool canMove(float x, float y);
GameState* m_gameState;
};
} /* namespace controller */
} /* namespace farmlands */
#endif /* CONTROLLER_PLAYERCONTROLLER_H_ */