00001 /* Game - Holds information about a particular style of a game (e.g. "single", "double"). */ 00002 00003 #ifndef GAMEDEF_H 00004 #define GAMEDEF_H 00005 00006 #include "GameInput.h" 00007 #include "MenuInput.h" 00008 #include "GameConstantsAndTypes.h" 00009 00010 00011 const int MAX_STYLES_PER_GAME = 10; 00012 00013 // 00014 // PrimaryMenuButton and SecondaryMenuButton are used to support using DeviceInputs that only 00015 // navigate the menus. 00016 // 00017 // A button being a primary menu button means that this GameButton will generate a the 00018 // corresponding MenuInput. 00019 // A button being a primary menu button means that this GameButton will generate a the 00020 // corresponding MenuInput IF AND ONLY IF the GameButton corresponding to the pimary input 00021 // is not mapped. 00022 // 00023 // Example 1: A user is using a an arcade DDR machine as their controllre. This machine has 00024 // MenuLeft, MenuStart, and MenuRight buttons on the cabinet, so they should be used to navigate menus. 00025 // The user will map these DeviceInputs to the GameButtons "MenuLeft (optional)", "MenuStart", and 00026 // "MenuRight (optional)". 00027 // 00028 // Example 2: A user is using PlayStation DDR soft pads to play. His controller doesn't have dedicated 00029 // DeviceInputs for MenuLeft and MenuRight. The user maps Up, Down, Left, and Right as normal. 00030 // Since the Left and Right GameButtons have the flag FLAG_SECONDARY_MENU_*, they will function as 00031 // MenuLeft and MenuRight as long as "MenuLeft (optional)" and "MenuRight (optional)" are not mapped. 00032 // 00033 00034 class Style; 00035 00036 #define NO_DEFAULT_KEY -1 00037 00038 class Game 00039 { 00040 public: 00041 const char *m_szName; 00042 const char *m_szDescription; 00043 00044 int m_iNumControllers; 00045 int m_iButtonsPerController; 00046 int GetNumGameplayButtons() const; 00047 char m_szButtonNames[MAX_GAME_BUTTONS][60]; // The name used by the button graphics system. e.g. "left", "right", "middle C", "snare" 00048 GameButton m_DedicatedMenuButton[NUM_MENU_BUTTONS]; 00049 GameButton m_SecondaryMenuButton[NUM_MENU_BUTTONS]; 00050 int m_iDefaultKeyboardKey[MAX_GAME_CONTROLLERS][MAX_GAME_BUTTONS]; // default keyboard keys only have an effect the current game is this game 00051 00052 GameButton ButtonNameToIndex( const CString &sButtonName ) const; 00053 MenuInput GameInputToMenuInput( GameInput GameI ) const; 00054 void MenuInputToGameInput( MenuInput MenuI, GameInput GameIout[4] ) const; 00055 CString ColToButtonName( int col ) const; 00056 00057 TapNoteScore m_mapMarvelousTo; 00058 TapNoteScore m_mapPerfectTo; 00059 TapNoteScore m_mapGreatTo; 00060 TapNoteScore m_mapGoodTo; 00061 TapNoteScore m_mapBooTo; 00062 }; 00063 00064 #endif 00065 00066 /* 00067 * (c) 2001-2002 Chris Danford 00068 * All rights reserved. 00069 * 00070 * Permission is hereby granted, free of charge, to any person obtaining a 00071 * copy of this software and associated documentation files (the 00072 * "Software"), to deal in the Software without restriction, including 00073 * without limitation the rights to use, copy, modify, merge, publish, 00074 * distribute, and/or sell copies of the Software, and to permit persons to 00075 * whom the Software is furnished to do so, provided that the above 00076 * copyright notice(s) and this permission notice appear in all copies of 00077 * the Software and that both the above copyright notice(s) and this 00078 * permission notice appear in supporting documentation. 00079 * 00080 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00081 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00082 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00083 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00084 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00085 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00086 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00087 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00088 * PERFORMANCE OF THIS SOFTWARE. 00089 */