Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

CodeDetector.h

Go to the documentation of this file.
00001 /* CodeDetector Uses InputQueue to detect input of codes. */ 00002 00003 #ifndef CODEDETECTOR_H 00004 #define CODEDETECTOR_H 00005 00006 #include "GameInput.h" 00007 00008 struct CodeItem 00009 { 00010 public: 00011 bool Load( CString sButtonsNames ); 00012 bool EnteredCode( GameController controller ) const; 00013 00014 private: 00015 vector<GameButton> buttons; 00016 enum Type 00017 { 00018 sequence, // press the buttons in sequence 00019 hold_and_press, // hold the first iNumButtons-1 buttons, then press the last 00020 tap // press all buttons simultaneously 00021 }; 00022 Type m_Type; 00023 float fMaxSecondsBack; 00024 }; 00025 00026 class CodeDetector 00027 { 00028 public: 00029 enum Code { 00030 CODE_EASIER1, 00031 CODE_EASIER2, 00032 CODE_HARDER1, 00033 CODE_HARDER2, 00034 CODE_NEXT_SORT1, 00035 CODE_NEXT_SORT2, 00036 CODE_NEXT_SORT3, 00037 CODE_NEXT_SORT4, 00038 CODE_SORT_MENU1, 00039 CODE_SORT_MENU2, 00040 CODE_MODE_MENU1, 00041 CODE_MODE_MENU2, 00042 CODE_MIRROR, 00043 CODE_LEFT, 00044 CODE_RIGHT, 00045 CODE_SHUFFLE, 00046 CODE_SUPER_SHUFFLE, 00047 CODE_NEXT_TRANSFORM, 00048 CODE_NEXT_SCROLL_SPEED, 00049 CODE_PREVIOUS_SCROLL_SPEED, 00050 CODE_NEXT_ACCEL, 00051 CODE_NEXT_EFFECT, 00052 CODE_NEXT_APPEARANCE, 00053 CODE_NEXT_TURN, 00054 CODE_REVERSE, 00055 CODE_HOLDS, 00056 CODE_MINES, 00057 CODE_DARK, 00058 CODE_HIDDEN, 00059 CODE_RANDOMVANISH, 00060 CODE_CANCEL_ALL, 00061 CODE_NEXT_THEME, 00062 CODE_NEXT_THEME2, 00063 CODE_NEXT_ANNOUNCER, 00064 CODE_NEXT_ANNOUNCER2, 00065 CODE_NEXT_GAME, 00066 CODE_NEXT_GAME2, 00067 CODE_BW_NEXT_GROUP, 00068 CODE_BW_NEXT_GROUP2, 00069 CODE_SAVE_SCREENSHOT, 00070 CODE_CANCEL_ALL_PLAYER_OPTIONS, 00071 CODE_BACK_IN_EVENT_MODE, 00072 NUM_CODES // leave this at the end 00073 }; 00074 00075 static void RefreshCacheItems( CString sClass="" ); // call this before checking codes, but call infrequently 00076 static bool EnteredEasierDifficulty( GameController controller ); 00077 static bool EnteredHarderDifficulty( GameController controller ); 00078 static bool EnteredNextSort( GameController controller ); 00079 static bool EnteredSortMenu( GameController controller ); 00080 static bool EnteredModeMenu( GameController controller ); 00081 static bool DetectAndAdjustMusicOptions( GameController controller ); 00082 static bool EnteredCode( GameController controller, Code code ); 00083 static bool EnteredNextBannerGroup( GameController controller ); 00084 }; 00085 00086 #endif 00087 00088 /* 00089 * (c) 2001-2004 Chris Danford 00090 * All rights reserved. 00091 * 00092 * Permission is hereby granted, free of charge, to any person obtaining a 00093 * copy of this software and associated documentation files (the 00094 * "Software"), to deal in the Software without restriction, including 00095 * without limitation the rights to use, copy, modify, merge, publish, 00096 * distribute, and/or sell copies of the Software, and to permit persons to 00097 * whom the Software is furnished to do so, provided that the above 00098 * copyright notice(s) and this permission notice appear in all copies of 00099 * the Software and that both the above copyright notice(s) and this 00100 * permission notice appear in supporting documentation. 00101 * 00102 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00103 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00104 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00105 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00106 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00107 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00108 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00109 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00110 * PERFORMANCE OF THIS SOFTWARE. 00111 */

Generated on Thu Jan 27 20:57:18 2005 for StepMania by doxygen 1.3.7