//! Player controls connector /*! * Class for assigning keys to respond to player events. * */ /* * Copyright (C) 2009-2010 Alejandro Valenzuela Roca, * * http://mexinetica.com/~lanjoe9 * * This file is part of MotorJ, a free framework for videogame development. * * * MotorJ is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MotorJ is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with MotorJ. If not, see . */ #ifndef PLAYERCTL_CLASS #define PLAYERCTL_CLASS #include #include //! key assignation helper structure typedef struct { SDLKey key; bool * toggleVar; } mjKeyAssign; //! Class to perform control scheme assignment class mjPlayerCtl { public: std::vector assignments; //! Assign a key to toggle a particular variable void AssignKey(SDLKey SDLkeyPressed, bool * variableToggled); //! Process a keyboard event with previously assigned keys bool ProcessKeybdEvent(SDL_KeyboardEvent& keyboardEvent); }; #endif