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

GameConstantsAndTypes.h

Go to the documentation of this file.
00001 /* GameConstantsAndTypes - Things used in many places that don't change often. */ 00002 00003 #ifndef GAME_CONSTANTS_AND_TYPES_H 00004 #define GAME_CONSTANTS_AND_TYPES_H 00005 00006 #include "PlayerNumber.h" // TODO: Get rid of this dependency. -Chris 00007 #include "EnumHelper.h" 00008 00009 00010 // 00011 // Note definitions 00012 // 00013 const int MAX_METER = 13; 00014 const int MIN_METER = 1; 00015 00016 00017 /* This is just cached song data. Not all of it may actually be displayed 00018 * in the radar. */ 00019 enum RadarCategory 00020 { 00021 RADAR_STREAM = 0, 00022 RADAR_VOLTAGE, 00023 RADAR_AIR, 00024 RADAR_FREEZE, 00025 RADAR_CHAOS, 00026 RADAR_NUM_TAPS_AND_HOLDS, 00027 RADAR_NUM_JUMPS, 00028 RADAR_NUM_HOLDS, 00029 RADAR_NUM_MINES, 00030 RADAR_NUM_HANDS, 00031 NUM_RADAR_CATEGORIES // leave this at the end 00032 }; 00033 #define FOREACH_RadarCategory( rc ) FOREACH_ENUM( RadarCategory, NUM_RADAR_CATEGORIES, rc ) 00034 const CString& RadarCategoryToString( RadarCategory cat ); 00035 CString RadarCategoryToThemedString( RadarCategory cat ); 00036 00037 00038 00039 enum StepsType 00040 { 00041 STEPS_TYPE_DANCE_SINGLE = 0, 00042 STEPS_TYPE_DANCE_DOUBLE, 00043 STEPS_TYPE_DANCE_COUPLE, 00044 STEPS_TYPE_DANCE_SOLO, 00045 STEPS_TYPE_PUMP_SINGLE, 00046 STEPS_TYPE_PUMP_HALFDOUBLE, 00047 STEPS_TYPE_PUMP_DOUBLE, 00048 STEPS_TYPE_PUMP_COUPLE, 00049 STEPS_TYPE_EZ2_SINGLE, 00050 STEPS_TYPE_EZ2_DOUBLE, 00051 STEPS_TYPE_EZ2_REAL, 00052 STEPS_TYPE_PARA_SINGLE, 00053 STEPS_TYPE_PARA_VERSUS, 00054 STEPS_TYPE_DS3DDX_SINGLE, 00055 STEPS_TYPE_BM_SINGLE5, 00056 STEPS_TYPE_BM_DOUBLE5, 00057 STEPS_TYPE_BM_SINGLE7, 00058 STEPS_TYPE_BM_DOUBLE7, 00059 STEPS_TYPE_MANIAX_SINGLE, 00060 STEPS_TYPE_MANIAX_DOUBLE, 00061 STEPS_TYPE_TECHNO_SINGLE4, 00062 STEPS_TYPE_TECHNO_SINGLE5, 00063 STEPS_TYPE_TECHNO_SINGLE8, 00064 STEPS_TYPE_TECHNO_DOUBLE4, 00065 STEPS_TYPE_TECHNO_DOUBLE5, 00066 STEPS_TYPE_PNM_FIVE, 00067 STEPS_TYPE_PNM_NINE, 00068 STEPS_TYPE_LIGHTS_CABINET, 00069 NUM_STEPS_TYPES, // leave this at the end 00070 STEPS_TYPE_INVALID, 00071 }; 00072 #define FOREACH_StepsType( st ) FOREACH_ENUM( StepsType, NUM_STEPS_TYPES, st ) 00073 00074 // 00075 // Play mode stuff 00076 // 00077 enum PlayMode 00078 { 00079 PLAY_MODE_REGULAR, 00080 PLAY_MODE_NONSTOP, // DDR EX Nonstop 00081 PLAY_MODE_ONI, // DDR EX Challenge 00082 PLAY_MODE_ENDLESS, // DDR PlayStation Endless 00083 PLAY_MODE_BATTLE, // manually launched attacks 00084 PLAY_MODE_RAVE, // automatically launched attacks - DDR Disney Rave "Dance Magic" 00085 NUM_PLAY_MODES, 00086 PLAY_MODE_INVALID 00087 }; 00088 #define FOREACH_PlayMode( pm ) FOREACH_ENUM( PlayMode, NUM_PLAY_MODES, pm ) 00089 const CString& PlayModeToString( PlayMode pm ); 00090 CString PlayModeToThemedString( PlayMode pm ); 00091 PlayMode StringToPlayMode( const CString& s ); 00092 00093 00094 00095 00096 enum SortOrder { 00097 SORT_PREFERRED, 00098 SORT_GROUP, 00099 SORT_TITLE, 00100 SORT_BPM, 00101 SORT_MOST_PLAYED, 00102 SORT_GRADE, 00103 SORT_ARTIST, 00104 SORT_EASY_METER, 00105 SORT_MEDIUM_METER, 00106 SORT_HARD_METER, 00107 SORT_CHALLENGE_METER, 00108 SORT_SORT_MENU, 00109 SORT_MODE_MENU, 00110 SORT_ALL_COURSES, 00111 SORT_NONSTOP_COURSES, 00112 SORT_ONI_COURSES, 00113 SORT_ENDLESS_COURSES, 00114 SORT_ROULETTE, 00115 NUM_SORT_ORDERS, 00116 SORT_INVALID 00117 }; 00118 const SortOrder MAX_SELECTABLE_SORT = (SortOrder)(SORT_ROULETTE-1); 00119 #define FOREACH_SortOrder( so ) FOREACH_ENUM( SortOrder, NUM_SORT_ORDERS, so ) 00120 const CString& SortOrderToString( SortOrder so ); 00121 SortOrder StringToSortOrder( const CString& str ); 00122 00123 inline bool IsSongSort( SortOrder so ) { return so >= SORT_PREFERRED && so <= SORT_CHALLENGE_METER; } 00124 00125 // 00126 // Scoring stuff 00127 // 00128 00129 enum TapNoteScore { 00130 TNS_NONE, 00131 TNS_HIT_MINE, 00132 TNS_MISS, 00133 TNS_BOO, 00134 TNS_GOOD, 00135 TNS_GREAT, 00136 TNS_PERFECT, 00137 TNS_MARVELOUS, 00138 NUM_TAP_NOTE_SCORES 00139 }; 00140 #define FOREACH_TapNoteScore( tns ) FOREACH_ENUM( TapNoteScore, NUM_TAP_NOTE_SCORES, tns ) 00141 const CString& TapNoteScoreToString( TapNoteScore tns ); 00142 CString TapNoteScoreToThemedString( TapNoteScore tns ); 00143 TapNoteScore StringToTapNoteScore( const CString& str ); 00144 00145 00146 enum HoldNoteScore 00147 { 00148 HNS_NONE, // this HoldNote has not been scored yet 00149 HNS_NG, // the HoldNote has passed and they missed it 00150 HNS_OK, // the HoldNote has passed and was successfully held all the way through 00151 NUM_HOLD_NOTE_SCORES 00152 }; 00153 #define FOREACH_HoldNoteScore( hns ) FOREACH_ENUM( HoldNoteScore, NUM_HOLD_NOTE_SCORES, hns ) 00154 const CString& HoldNoteScoreToString( HoldNoteScore hns ); 00155 CString HoldNoteScoreToThemedString( HoldNoteScore hns ); 00156 HoldNoteScore StringToHoldNoteScore( const CString& str ); 00157 00158 00159 // 00160 // Profile and MemCard stuff 00161 // 00162 enum ProfileSlot 00163 { 00164 PROFILE_SLOT_PLAYER_1, 00165 PROFILE_SLOT_PLAYER_2, 00166 PROFILE_SLOT_MACHINE, 00167 NUM_PROFILE_SLOTS, 00168 PROFILE_SLOT_INVALID 00169 }; 00170 #define FOREACH_ProfileSlot( slot ) FOREACH_ENUM( ProfileSlot, NUM_PROFILE_SLOTS, slot ) 00171 00172 00173 enum MemoryCardState 00174 { 00175 MEMORY_CARD_STATE_READY, 00176 MEMORY_CARD_STATE_TOO_LATE, 00177 MEMORY_CARD_STATE_WRITE_ERROR, 00178 MEMORY_CARD_STATE_NO_CARD, 00179 NUM_MEMORY_CARD_STATES, 00180 MEMORY_CARD_STATE_INVALID, 00181 }; 00182 00183 const CString& MemoryCardStateToString( MemoryCardState mcs ); 00184 00185 00186 // 00187 // Ranking stuff 00188 // 00189 enum RankingCategory 00190 { 00191 RANKING_A, // 1-3 meter per song avg. 00192 RANKING_B, // 4-6 meter per song avg. 00193 RANKING_C, // 7-9 meter per song avg. 00194 RANKING_D, // 10+ meter per song avg. // doesn't count extra stage! 00195 NUM_RANKING_CATEGORIES, 00196 RANKING_INVALID 00197 }; 00198 #define FOREACH_RankingCategory( rc ) FOREACH_ENUM( RankingCategory, NUM_RANKING_CATEGORIES, rc ) 00199 const CString& RankingCategoryToString( RankingCategory rc ); 00200 RankingCategory StringToRankingCategory( const CString& rc ); 00201 00202 const CString RANKING_TO_FILL_IN_MARKER[NUM_PLAYERS] = {"#P1#","#P2#"}; 00203 inline bool IsRankingToFillIn( const CString& sName ) { return !sName.empty() && sName[0]=='#'; } 00204 00205 RankingCategory AverageMeterToRankingCategory( int iAverageMeter ); 00206 00207 const int NUM_RANKING_LINES = 5; 00208 00209 00210 // 00211 // Group stuff 00212 // 00213 #define GROUP_ALL_MUSIC CString("--ALL MUSIC--") 00214 00215 00216 // 00217 // 00218 // 00219 enum PlayerController 00220 { 00221 PC_HUMAN, 00222 PC_CPU, 00223 PC_AUTOPLAY, 00224 NUM_PLAYER_CONTROLLERS 00225 }; 00226 00227 const int MIN_SKILL = 0; 00228 const int MAX_SKILL = 10; 00229 00230 00231 enum StageResult 00232 { 00233 RESULT_WIN, 00234 RESULT_LOSE, 00235 RESULT_DRAW 00236 }; 00237 00238 00239 // 00240 // Battle stuff 00241 // 00242 const int NUM_INVENTORY_SLOTS = 3; 00243 enum AttackLevel 00244 { 00245 ATTACK_LEVEL_1, 00246 ATTACK_LEVEL_2, 00247 ATTACK_LEVEL_3, 00248 NUM_ATTACK_LEVELS 00249 }; 00250 const int NUM_ATTACKS_PER_LEVEL = 3; 00251 const int ITEM_NONE = -1; 00252 00253 00254 #define BG_ANIMS_DIR CString("BGAnimations/") 00255 #define VISUALIZATIONS_DIR CString("Visualizations/") 00256 #define RANDOMMOVIES_DIR CString("RandomMovies/") 00257 #define DATA_DIR CString("Data/") 00258 00259 00260 // 00261 // Coin stuff 00262 // 00263 00264 enum CoinMode { COIN_HOME, COIN_PAY, COIN_FREE, NUM_COIN_MODES }; 00265 00266 const CString& CoinModeToString( CoinMode cm ); 00267 00268 00269 // 00270 // Premium 00271 // 00272 enum Premium { PREMIUM_NONE, PREMIUM_DOUBLES, PREMIUM_JOINT, NUM_PREMIUMS }; 00273 00274 const CString& PremiumToString( Premium p ); 00275 00276 00277 // 00278 // Award stuff 00279 // 00280 00281 enum PerDifficultyAward 00282 { 00283 AWARD_FULL_COMBO_GREATS, 00284 AWARD_SINGLE_DIGIT_GREATS, 00285 AWARD_ONE_GREAT, 00286 AWARD_FULL_COMBO_PERFECTS, 00287 AWARD_SINGLE_DIGIT_PERFECTS, 00288 AWARD_ONE_PERFECT, 00289 AWARD_FULL_COMBO_MARVELOUSES, 00290 AWARD_GREATS_80_PERCENT, 00291 AWARD_GREATS_90_PERCENT, 00292 AWARD_GREATS_100_PERCENT, 00293 NUM_PER_DIFFICULTY_AWARDS, 00294 PER_DIFFICULTY_AWARD_INVALID, 00295 }; 00296 #define FOREACH_PerDifficultyAward( pma ) FOREACH_ENUM( PerDifficultyAward, NUM_PER_DIFFICULTY_AWARDS, pma ) 00297 const CString& PerDifficultyAwardToString( PerDifficultyAward pma ); 00298 CString PerDifficultyAwardToThemedString( PerDifficultyAward pma ); 00299 PerDifficultyAward StringToPerDifficultyAward( const CString& pma ); 00300 00301 00302 enum PeakComboAward 00303 { 00304 AWARD_1000_PEAK_COMBO, 00305 AWARD_2000_PEAK_COMBO, 00306 AWARD_3000_PEAK_COMBO, 00307 AWARD_4000_PEAK_COMBO, 00308 AWARD_5000_PEAK_COMBO, 00309 AWARD_6000_PEAK_COMBO, 00310 AWARD_7000_PEAK_COMBO, 00311 AWARD_8000_PEAK_COMBO, 00312 AWARD_9000_PEAK_COMBO, 00313 AWARD_10000_PEAK_COMBO, 00314 NUM_PEAK_COMBO_AWARDS, 00315 PEAK_COMBO_AWARD_INVALID, 00316 }; 00317 #define FOREACH_PeakComboAward( pca ) FOREACH_ENUM( PeakComboAward, NUM_PEAK_COMBO_AWARDS, pca ) 00318 const CString& PeakComboAwardToString( PeakComboAward pma ); 00319 CString PeakComboAwardToThemedString( PeakComboAward pma ); 00320 PeakComboAward StringToPeakComboAward( const CString& pma ); 00321 00322 00323 struct DisplayBpms 00324 { 00325 void Add( float f ); 00326 float GetMin() const; 00327 float GetMax() const; 00328 bool BpmIsConstant() const; 00329 bool IsMystery() const; 00330 vector<float> vfBpms; 00331 }; 00332 00333 enum StyleType 00334 { 00335 ONE_PLAYER_ONE_SIDE, // e.g. single 00336 TWO_PLAYERS_TWO_SIDES, // e.g. versus 00337 ONE_PLAYER_TWO_SIDES, // e.g. double 00338 NUM_STYLE_TYPES 00339 }; 00340 const CString& StyleTypeToString( StyleType s ); 00341 StyleType StringToStyleType( const CString& s ); 00342 00343 00344 #endif 00345 00346 /* 00347 * (c) 2001-2004 Chris Danford, Chris Gomez 00348 * All rights reserved. 00349 * 00350 * Permission is hereby granted, free of charge, to any person obtaining a 00351 * copy of this software and associated documentation files (the 00352 * "Software"), to deal in the Software without restriction, including 00353 * without limitation the rights to use, copy, modify, merge, publish, 00354 * distribute, and/or sell copies of the Software, and to permit persons to 00355 * whom the Software is furnished to do so, provided that the above 00356 * copyright notice(s) and this permission notice appear in all copies of 00357 * the Software and that both the above copyright notice(s) and this 00358 * permission notice appear in supporting documentation. 00359 * 00360 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00361 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00362 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00363 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00364 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00365 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00366 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00367 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00368 * PERFORMANCE OF THIS SOFTWARE. 00369 */

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