move skill level array initialization into define

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8083 30fe4595-0a0c-4342-8851-515496e4dcbd
This commit is contained in:
iobyte 2022-03-22 20:26:22 +00:00
parent 7a1155b9cb
commit 3649489c23
6 changed files with 6 additions and 8 deletions

View File

@ -116,6 +116,7 @@ typedef struct RobotItf {
#define ROB_VAL_AMATEUR "amateur"
#define ROB_VAL_SEMI_PRO "semi-pro"
#define ROB_VAL_PRO "pro"
#define ROB_VALS_LEVEL { ROB_VAL_ARCADE, ROB_VAL_SEMI_ROOKIE, ROB_VAL_ROOKIE, ROB_VAL_AMATEUR, ROB_VAL_SEMI_PRO, ROB_VAL_PRO }
#define ROB_SECT_ARBITRARY "Robots/arbitrary cars"
#define ROB_VAL_FEATURE_PENALTIES "penalties"

View File

@ -337,8 +337,7 @@ void GfDriverSkin::setCarPreviewFileName(const std::string& strFileName)
// GfDriver class -------------------------------------------------------------------
// Skill level related constants.
static const char *ASkillLevelStrings[] =
{ ROB_VAL_ARCADE, ROB_VAL_SEMI_ROOKIE, ROB_VAL_ROOKIE, ROB_VAL_AMATEUR, ROB_VAL_SEMI_PRO, ROB_VAL_PRO };
static const char *ASkillLevelStrings[] = ROB_VALS_LEVEL;
static const int NbSkillLevels = sizeof(ASkillLevelStrings) / sizeof(ASkillLevelStrings[0]);
static const double ASkillLevelValues[NbSkillLevels] = { 30.0, 20.0, 10.0, 7.0, 3.0, 0.0 };

View File

@ -55,8 +55,7 @@
#endif
// ... Use new Memory Manager
static const char *aPszSkillLevelNames[] =
{ ROB_VAL_ARCADE, ROB_VAL_SEMI_ROOKIE, ROB_VAL_ROOKIE, ROB_VAL_AMATEUR, ROB_VAL_SEMI_PRO, ROB_VAL_PRO };
static const char *aPszSkillLevelNames[] = ROB_VALS_LEVEL;
static const int NSkillLevels = (int)(sizeof(aPszSkillLevelNames)/sizeof(char*));
// The list of robot modules loaded for the race.

View File

@ -69,8 +69,7 @@ extern TGFCLIENT_API WebServer webServer;
#endif //WEBSERVER
static const char *aPszSkillLevelNames[] =
{ ROB_VAL_ARCADE, ROB_VAL_SEMI_ROOKIE, ROB_VAL_ROOKIE, ROB_VAL_AMATEUR, ROB_VAL_SEMI_PRO, ROB_VAL_PRO };
static const char *aPszSkillLevelNames[] = ROB_VALS_LEVEL;
static const int NSkillLevels = (int)(sizeof(aPszSkillLevelNames)/sizeof(char*));
static const size_t PathLenMax = 1024;

View File

@ -35,7 +35,7 @@
static const char* AIGlobalSkillFilePathName = "config/raceman/extra/skill.xml";
/* Available skill level names and associated values */
static const char *SkillLevels[] = { ROB_VAL_ARCADE, ROB_VAL_SEMI_ROOKIE, ROB_VAL_ROOKIE, ROB_VAL_AMATEUR, ROB_VAL_SEMI_PRO, ROB_VAL_PRO };
static const char *SkillLevels[] = ROB_VALS_LEVEL;
static const tdble SkillLevelValues[] = { 30.0, 20.0, 10.0, 7.0, 3.0, 0.0};
static const int NSkillLevels = sizeof(SkillLevels) / sizeof(SkillLevels[0]);
static int CurSkillLevelIndex = 0;

View File

@ -50,7 +50,7 @@ static const char *DefaultWebserverusername = "username";
static const char *DefaultWebserverpassword = "password";
#endif //WEBSERVER
static const char *SkillLevelString[] = { ROB_VAL_ARCADE, ROB_VAL_SEMI_ROOKIE, ROB_VAL_ROOKIE, ROB_VAL_AMATEUR, ROB_VAL_SEMI_PRO, ROB_VAL_PRO };
static const char *SkillLevelString[] = ROB_VALS_LEVEL;
static const int NbSkillLevels = sizeof(SkillLevelString) / sizeof(SkillLevelString[0]);
static char buf[1024];