#include "Controller.hh"

namespace App
{

Controller::Controller() : m_lastCommand(0)
{
    m_lastEvent = nullptr;
}

Controller::~Controller()
{
}

Uint32 Controller::HandleEvent(SDL_Event *event)
{
    m_lastEvent = event;
    switch (m_lastEvent->type)
    {
    case SDL_KEYDOWN:
        switch (m_lastEvent->key.keysym.scancode)
        {
        case SDL_SCANCODE_ESCAPE:
            m_lastCommand = -1;
            break;
        
        default:
            break;
        }
        break;
    
    default:
        m_lastCommand = 0;
        break;
    }
    return m_lastCommand;
}
    
} // namespace App

