Remove dependence on PlayerNumber.h in GameConstantsAndTypes.h. Make RANKING_TO_FILL_IN_MARKER more robust in the face of NUM_PLAYERS changing.

This commit is contained in:
Steve Checkoway
2007-06-09 07:50:51 +00:00
parent 23c5b96074
commit f1bc9cc1cd
2 changed files with 10 additions and 3 deletions
+9 -1
View File
@@ -8,10 +8,18 @@
#include "LuaManager.h"
#include "GameManager.h"
#include "LocalizedString.h"
#include "PlayerNumber.h"
#include <float.h>
const RString RANKING_TO_FILL_IN_MARKER[NUM_PLAYERS] = {"#P1#","#P2#"};
static vector<RString> GenerateRankingToFillInMarker()
{
vector<RString> vRankings;
FOREACH_ENUM( PlayerNumber, pn )
vRankings.push_back( ssprintf("#P%d#", pn+1) );
return vRankings;
}
extern const vector<RString> RANKING_TO_FILL_IN_MARKER( GenerateRankingToFillInMarker() );
extern const RString GROUP_ALL = "---Group All---";
+1 -2
View File
@@ -3,7 +3,6 @@
#ifndef GAME_CONSTANTS_AND_TYPES_H
#define GAME_CONSTANTS_AND_TYPES_H
#include "PlayerNumber.h" // TODO: Get rid of this dependency. -Chris
#include "EnumHelper.h"
@@ -256,7 +255,7 @@ enum RankingCategory
const RString& RankingCategoryToString( RankingCategory rc );
RankingCategory StringToRankingCategory( const RString& rc );
extern const RString RANKING_TO_FILL_IN_MARKER[NUM_PLAYERS];
extern const vector<RString> RANKING_TO_FILL_IN_MARKER;
inline bool IsRankingToFillIn( const RString& sName ) { return !sName.empty() && sName[0]=='#'; }
RankingCategory AverageMeterToRankingCategory( int iAverageMeter );