OptionsGame.h

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////////////
00002 //    Scorched3D (c) 2000-2009
00003 //
00004 //    This file is part of Scorched3D.
00005 //
00006 //    Scorched3D is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    Scorched3D is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with Scorched3D; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 ////////////////////////////////////////////////////////////////////////////////
00020 
00021 #if !defined(__INCLUDE_OptionsGameh_INCLUDE__)
00022 #define __INCLUDE_OptionsGameh_INCLUDE__
00023 
00024 #include <common/OptionEntry.h>
00025 
00026 class OptionsGame
00027 {
00028 public:
00029         OptionsGame();
00030         virtual ~OptionsGame();
00031 
00032         enum TurnType
00033         {
00034                 TurnSimultaneous = 0,
00035                 TurnSequentialLooserFirst = 1,
00036                 TurnSequentialRandom = 2
00037         };
00038         enum WindForce
00039         {
00040                 WindRandom = 0,
00041                 WindNone = 1,
00042                 Wind1 = 2,
00043                 Wind2 = 3,
00044                 Wind3 = 4,
00045                 Wind4 = 5,
00046                 Wind5 = 6,
00047                 WindBreezy = 7,
00048                 WindGale = 8
00049         };
00050         enum WindType
00051         {
00052                 WindOnRound = 0,
00053                 WindOnMove = 1
00054         };
00055         enum WallType
00056         {
00057                 WallRandom = 0,
00058                 WallConcrete = 1,
00059                 WallBouncy = 2,
00060                 WallWrapAround = 3,
00061                 WallNone = 4,
00062                 WallActive = 5,
00063                 WallInactive = 6
00064         };
00065         enum WeapScale
00066         {
00067                 ScaleSmall = 0,
00068                 ScaleMedium = 1,
00069                 ScaleLarge = 2
00070         };
00071         enum ResignType
00072         {
00073                 ResignStart = 0,
00074                 ResignEnd = 1,
00075                 ResignDueToHealth = 2
00076         };
00077         enum MovementRestrictionType
00078         {
00079                 MovementRestrictionNone = 0,
00080                 MovementRestrictionLand = 1,
00081                 MovementRestrictionLandOrAbove = 2
00082         };
00083         enum TeamBallanceType
00084         {
00085                 TeamBallanceNone,
00086                 TeamBallanceAuto,
00087                 TeamBallanceBotsVs,
00088                 TeamBallanceAutoByScore,
00089                 TeamBallanceAutoByBots
00090         };
00091         
00092         const char *getTutorial() { return tutorial_; }
00093         OptionEntryString &getTutorialEntry() { return tutorial_; }
00094 
00095         int getPhysicsFPS() { return physicsFPS_; }
00096         OptionEntryInt &getPhysicsFPSEntry() { return physicsFPS_; }
00097 
00098         int getScorePerMoney() { return scorePerMoney_; }
00099         OptionEntryInt &getScorePerMoneyEntry() { return scorePerMoney_; }
00100 
00101         int getScorePerAssist() { return scorePerAssist_; }
00102         OptionEntryInt &getScorePerAssistEntry() { return scorePerAssist_; }
00103 
00104         int getScorePerKill() { return scorePerKill_; }
00105         OptionEntryInt &getScorePerKillEntry() { return scorePerKill_; }
00106 
00107         int getScoreWonForRound() { return scoreWonForRound_; }
00108         OptionEntryInt &getScoreWonForRoundEntry() { return scoreWonForRound_; }
00109 
00110         int getScoreWonForLives() { return scoreWonForLives_; }
00111         OptionEntryInt &getScoreWonForLivesEntry() { return scoreWonForLives_; }
00112 
00113         int getTeams() { return teams_; }
00114         OptionEntryInt &getTeamsEntry() { return teams_; }
00115 
00116         int getStartArmsLevel() { return startArmsLevel_; }
00117         OptionEntryInt &getStartArmsLevelEntry() { return startArmsLevel_; }
00118 
00119         int getEndArmsLevel() { return endArmsLevel_; }
00120         OptionEntryInt &getEndArmsLevelEntry() { return endArmsLevel_; }
00121 
00122         int getMaxNumberWeapons() { return maxNumberWeapons_; }
00123         OptionEntryInt &getMaxNumberWeaponsEntry() { return maxNumberWeapons_; }
00124 
00125         int getNoMaxPlayers() { return numberOfPlayers_; }
00126         OptionEntryInt &getNoMaxPlayersEntry() { return numberOfPlayers_; }
00127 
00128         int getNoMinPlayers() { return numberOfMinPlayers_; }
00129         OptionEntryInt &getNoMinPlayersEntry() { return numberOfMinPlayers_; }
00130 
00131         int getNoRounds() { return numberOfRounds_; }
00132         OptionEntryInt &getNoRoundsEntry() { return numberOfRounds_; }
00133 
00134         int getRemoveBotsAtPlayers() { return removeBotsAtPlayers_; }
00135         OptionEntryInt &getRemoveBotsAtPlayersEntry() { return removeBotsAtPlayers_; }
00136 
00137         int getNoMaxRoundTurns() { return maxRoundTurns_; }
00138         OptionEntryInt &getNoMaxRoundTurnsEntry() { return maxRoundTurns_; }
00139 
00140         int getStartMoney() { return moneyStarting_; }
00141         OptionEntryInt &getStartMoneyEntry() { return moneyStarting_; }
00142 
00143         int getInterest() { return moneyInterest_; }
00144         OptionEntryInt &getInterestEntry() { return moneyInterest_; }
00145 
00146         int getFreeMarketAdjustment() { return freeMarketAdjustment_; }
00147         OptionEntryInt &getFreeMarketAdjustmentEntry() { return freeMarketAdjustment_; }
00148 
00149         int getFreeMarketLimits() { return freeMarketLimits_; }
00150         OptionEntryInt &getFreeMarketLimitsEntry() { return freeMarketLimits_; }
00151 
00152         int getMaxLandscapeSize() { return maxLandscapeSize_; }
00153         OptionEntryInt &getMaxLandscapeSizeEntry() { return maxLandscapeSize_; }
00154 
00155         int getStartTime() { return startTime_; }
00156         OptionEntryInt &getStartTimeEntry() { return startTime_; }
00157 
00158         int getShotTime() { return shotTime_; }
00159         OptionEntryInt &getShotTimeEntry() { return shotTime_; }
00160 
00161         int getKeepAliveTime() { return keepAliveTime_; }
00162         OptionEntryInt &getKeepAliveTimeEntry() { return keepAliveTime_; }
00163 
00164         int getKeepAliveTimeoutTime() { return keepAliveTimeoutTime_; }
00165         OptionEntryInt &getKeepAliveTimeoutTimeEntry() { return keepAliveTimeoutTime_; }
00166 
00167         int getBuyingTime() { return buyingTime_; }
00168         OptionEntryInt &getBuyingTimeEntry() { return buyingTime_; }
00169 
00170         int getRoundScoreTime() { return roundScoreTime_; }
00171         OptionEntryInt &getRoundScoreTimeEntry() { return roundScoreTime_; }
00172 
00173         int getScoreTime() { return scoreTime_; }
00174         OptionEntryInt &getScoreTimeEntry() { return scoreTime_; }
00175 
00176         int getAllowedMissedMoves() { return allowedMissedMoves_; }
00177         OptionEntryInt &getAllowedMissedMovesEntry() { return allowedMissedMoves_; }
00178 
00179         int getIdleKickTime() { return idleKickTime_; }
00180         OptionEntryInt &getIdleKickTimeEntry() { return idleKickTime_; }
00181 
00182         int getIdleShotKickTime() { return idleShotKickTime_; }
00183         OptionEntryInt &getIdleShotKickTimeEntry() { return idleShotKickTime_; }
00184 
00185         int getMinFallingDistance() { return minFallingDistance_; }
00186         OptionEntryInt &getMinFallingDistanceEntry() { return minFallingDistance_; }
00187 
00188         int getMaxClimbingDistance() { return maxClimbingDistance_; }
00189         OptionEntryInt &getMaxClimbingDistanceEntry() { return maxClimbingDistance_; }
00190 
00191         int getPlayerLives() { return playerLives_; }
00192         OptionEntryInt &getPlayerLivesEntry() { return playerLives_; }
00193 
00194         int getGravity() { return gravity_; }
00195         OptionEntryInt &getGravityEntry() { return gravity_; }
00196 
00197         OptionEntryEnum getWindForce() { return windForce_; } // WindForce
00198         OptionEntryEnum &getWindForceEntry() { return windForce_; } // WindForce
00199 
00200         OptionEntryEnum getWindType() { return windType_; } // WindType
00201         OptionEntryEnum &getWindTypeEntry() { return windType_; } // WindType
00202 
00203         OptionEntryEnum getWallType() { return wallType_; } // WallType
00204         OptionEntryEnum &getWallTypeEntry() { return wallType_; } // WallType
00205 
00206         OptionEntryEnum getWeapScale() { return weapScale_; } // WeapScale
00207         OptionEntryEnum &getWeapScaleEntry() { return weapScale_; } // WeapScale
00208         
00209         OptionEntryEnum getTurnType() { return turnType_; } // TurnType
00210         OptionEntryEnum &getTurnTypeEntry() { return turnType_; } // TurnType
00211          
00212         int getBuyOnRound() { return moneyBuyOnRound_; }
00213         OptionEntryInt &getBuyOnRoundEntry() { return moneyBuyOnRound_; }
00214 
00215         int getMoneyPerRound() { return moneyPerRound_; }
00216         OptionEntryInt &getMoneyPerRoundEntry() { return moneyPerRound_; }
00217 
00218         int getMoneyWonForRound() { return moneyWonForRound_; }
00219         OptionEntryInt &getMoneyWonForRoundEntry() { return moneyWonForRound_; }
00220 
00221         int getMoneyWonForLives() { return moneyWonForLives_; }
00222         OptionEntryInt &getMoneyWonForLivesEntry() { return moneyWonForLives_; }
00223 
00224         int getMoneyWonPerKillPoint() { return moneyPerKillPoint_; }
00225         OptionEntryInt &getMoneyWonPerKillPointEntry() { return moneyPerKillPoint_; }
00226 
00227         int getMoneyWonPerMultiKillPoint() { return moneyPerMultiKillPoint_; }
00228         OptionEntryInt &getMoneyWonPerMultiKillPointEntry() { return moneyPerMultiKillPoint_; }
00229 
00230         int getMoneyWonPerAssistPoint() { return moneyPerAssistPoint_; }
00231         OptionEntryInt &getMoneyWonPerAssistPointEntry() { return moneyPerAssistPoint_; }
00232 
00233         int getMoneyWonPerHitPoint() { return moneyPerHitPoint_; }
00234         OptionEntryInt &getMoneyWonPerHitPointEntry() { return moneyPerHitPoint_; }
00235 
00236         bool getMoneyPerHealthPoint() { return moneyPerHealthPoint_; }
00237         OptionEntryBool &getMoneyPerHealthPointEntry() { return moneyPerHealthPoint_; }
00238 
00239         bool getLimitPowerByHealth() { return limitPowerByHealth_; }
00240         OptionEntryBool &getLimitPowerByHealthEntry() { return limitPowerByHealth_; }
00241         
00242         OptionEntryEnum getTeamBallance() { return teamBallance_; } // TeamBallanceType
00243         OptionEntryEnum &getTeamBallanceEntry() { return teamBallance_; } // TeamBallanceType
00244 
00245         int getComputersDeathTalk() { return computersDeathTalk_; }
00246         OptionEntryInt &getComputersDeathTalkEntry() { return computersDeathTalk_; }
00247 
00248         int getComputersAttackTalk() { return computersAttackTalk_; }
00249         OptionEntryInt &getComputersAttackTalkEntry() { return computersAttackTalk_; }
00250 
00251         const char * getEconomy() { return economy_; }
00252         OptionEntryStringEnum &getEconomyEntry() { return economy_; }
00253 
00254         const char * getLandscapes() { return landscapes_; }
00255         OptionEntryString &getLandscapesEntry() { return landscapes_; }
00256 
00257         const char * getStatsLogger() { return statsLogger_; }
00258         OptionEntryStringEnum &getStatsLoggerEntry() { return statsLogger_; }
00259 
00260         const char * getServerFileLogger() { return serverFileLogger_; }
00261         OptionEntryStringEnum &getServerFileLoggerEntry() { return serverFileLogger_; }
00262 
00263         const char * getBotNamePrefix() { return botNamePrefix_; }
00264         OptionEntryString &getBotNamePrefixEntry() { return botNamePrefix_; }
00265 
00266         bool getGiveAllWeapons() { return giveAllWeapons_; }
00267         OptionEntryBool &getGiveAllWeaponsEntry() { return giveAllWeapons_; }
00268 
00269         bool getDelayedDefenseActivation() { return delayedDefenseActivation_; }
00270         OptionEntryBool &getDelayedDefenseActivationEntry() { return delayedDefenseActivation_; }
00271 
00272         bool getCycleMaps() { return cycleMaps_; }
00273         OptionEntryBool &getCycleMapsEntry() { return cycleMaps_; }
00274 
00275         int getResignMode() { return resignMode_; }
00276         OptionEntryInt &getResignModeEntry() { return resignMode_; }
00277 
00278         OptionEntryEnum getMovementRestriction() { return movementRestriction_; } // MovementRestrictionType
00279         OptionEntryEnum &getMovementRestrictionEntry() { return movementRestriction_; } // MovementRestrictionType
00280 
00281         bool getRandomizeBotNames() { return randomizeBotNames_; }
00282         OptionEntryBool &getRandomizeBotNamesEntry() { return randomizeBotNames_; }
00283 
00284         int getPortNo() { return portNo_; }
00285         OptionEntryInt &getPortNoEntry() { return portNo_; }
00286 
00287         int getManagementPortNo() { return managementPortNo_; }
00288         OptionEntryInt &getManagementPortNoEntry() { return managementPortNo_; }
00289 
00290         const char * getMod() { return mod_; }
00291         OptionEntryString &getModEntry() { return mod_; }
00292 
00293         const char * getMOTD() { return motd_; }
00294         OptionEntryString &getMOTDEntry() { return motd_; }
00295 
00296         int getModDownloadSpeed() { return modDownloadSpeed_; }
00297         OptionEntryInt &getModDownloadSpeedEntry() { return modDownloadSpeed_; }
00298 
00299         int getMaxAvatarSize() { return maxAvatarSize_; }
00300         OptionEntryInt &getMaxAvatarSizeEntry() { return maxAvatarSize_; }
00301 
00302         const char * getServerName() { return serverName_; }
00303         OptionEntryString &getServerNameEntry() { return serverName_; }
00304 
00305         const char * getServerPassword() { return serverPassword_; }
00306         OptionEntryString &getServerPasswordEntry() { return serverPassword_; }
00307 
00308         OptionEntryString &getPlayerType(int no) { DIALOG_ASSERT(no<24); return *playerType_[no]; }
00309 
00310         const char * getPublishAddress() { return publishAddress_; }
00311         OptionEntryString &getPublishAddressEntry() { return publishAddress_; }
00312 
00313         bool getAllowSameIP() { return allowSameIP_; }
00314         OptionEntryBool &getAllowSameIPEntry() { return allowSameIP_; }
00315 
00316         bool getAllowSameUniqueId() { return allowSameUniqueId_; }
00317         OptionEntryBool &getAllowSameUniqueIdEntry() { return allowSameUniqueId_; }
00318 
00319         bool getPublishServer() { return publishServer_; }
00320         OptionEntryBool &getPublishServerEntry() { return publishServer_; }
00321 
00322         bool getResidualPlayers() { return residualPlayers_; }
00323         OptionEntryBool &getResidualPlayersEntry() { return residualPlayers_; }
00324 
00325         bool getAutoSendSyncCheck() { return autoSendSyncCheck_; }
00326         OptionEntryBool &getAutoSendSyncCheckEntry() { return autoSendSyncCheck_; }
00327 
00328         bool getActionSyncCheck() { return actionSyncCheck_; }
00329         OptionEntryBool &getActionSyncCheckEntry() { return actionSyncCheck_; }
00330 
00331         const char * getAuthHandler() { return authHandler_; }
00332         OptionEntryStringEnum &getAuthHandlerEntry() { return authHandler_; }
00333 
00334         bool getRegisteredUserNames() { return registeredUserNames_; }
00335         OptionEntryBool &getRegisteredUserNamesEntry() { return registeredUserNames_; }
00336 
00337         bool getAllowMultiLingualChat() { return allowMultiLingualChat_; }
00338         OptionEntryBool &getAllowMultiLingualChatEntry() { return allowMultiLingualChat_; }
00339 
00340         bool getAllowMultiLingualNames() { return allowMultiLingualNames_; }
00341         OptionEntryBool &getAllowMultiLingualNamesEntry() { return allowMultiLingualNames_; }
00342 
00343         bool getDebugFeatures() { return debugFeatures_; }
00344         OptionEntryBool &getDebugFeaturesEntry() { return debugFeatures_; }
00345 
00346         // Fns used to save or restore the state of the options
00347         std::list<OptionEntry *> &getOptions();
00348         std::list<OptionEntry *> &getPlayerTypeOptions(); 
00349         virtual bool writeOptionsToXML(XMLNode *xmlNode);
00350         virtual bool readOptionsFromXML(XMLNode *xmlNode);
00351         virtual bool writeOptionsToFile(const std::string &filePath);
00352         virtual bool readOptionsFromFile(const std::string &filePath);
00353         virtual bool writeToBuffer(NetBuffer &buffer, bool useProtected, bool usePlayerTypes);
00354         virtual bool readFromBuffer(NetBufferReader &reader, bool useProtected, bool usePlayerTypes);
00355 
00356 protected:
00357         std::list<OptionEntry *> options_;
00358         std::list<OptionEntry *> playerTypeOptions_;
00359 
00360         OptionEntryBoundedInt physicsFPS_;
00361         OptionEntryBoundedInt startArmsLevel_;
00362         OptionEntryBoundedInt endArmsLevel_;
00363         OptionEntryBoundedInt maxRoundTurns_;
00364         OptionEntryBoundedInt keepAliveTime_;
00365         OptionEntryBoundedInt keepAliveTimeoutTime_;
00366         OptionEntryBoundedInt shotTime_;
00367         OptionEntryBoundedInt startTime_;
00368         OptionEntryBoundedInt buyingTime_;
00369         OptionEntryBoundedInt roundScoreTime_;
00370         OptionEntryBoundedInt scoreTime_;
00371         OptionEntryBoundedInt allowedMissedMoves_;
00372         OptionEntryBoundedInt numberOfRounds_;
00373         OptionEntryBoundedInt maxNumberWeapons_;
00374         OptionEntryBoundedInt gravity_;
00375         OptionEntryBoundedInt minFallingDistance_;
00376         OptionEntryBoundedInt maxClimbingDistance_;
00377         OptionEntryBoundedInt playerLives_;
00378         OptionEntryBoundedInt teams_;
00379         OptionEntryBoundedInt numberOfPlayers_;
00380         OptionEntryBoundedInt numberOfMinPlayers_;
00381         OptionEntryBoundedInt removeBotsAtPlayers_;
00382         OptionEntryBoundedInt computersDeathTalk_;
00383         OptionEntryBoundedInt computersAttackTalk_;
00384         OptionEntryBoundedInt moneyBuyOnRound_;
00385         OptionEntryBoundedInt moneyWonForRound_;
00386         OptionEntryBoundedInt moneyWonForLives_;
00387         OptionEntryBoundedInt moneyPerKillPoint_;
00388         OptionEntryBoundedInt moneyPerMultiKillPoint_;
00389         OptionEntryBoundedInt moneyPerAssistPoint_;
00390         OptionEntryBoundedInt moneyPerHitPoint_;
00391         OptionEntryBoundedInt moneyPerRound_;
00392         OptionEntryBool moneyPerHealthPoint_;
00393         OptionEntryBoundedInt scorePerMoney_;
00394         OptionEntryBoundedInt scorePerAssist_;
00395         OptionEntryBoundedInt scorePerKill_;
00396         OptionEntryBoundedInt scoreWonForRound_;
00397         OptionEntryBoundedInt scoreWonForLives_;
00398         OptionEntryInt maxLandscapeSize_;
00399         OptionEntryInt freeMarketAdjustment_;
00400         OptionEntryInt freeMarketLimits_;
00401         OptionEntryBoundedInt moneyStarting_;
00402         OptionEntryBoundedInt idleKickTime_;
00403         OptionEntryBoundedInt idleShotKickTime_;
00404         OptionEntryEnum teamBallance_;
00405         OptionEntryBoundedInt moneyInterest_;
00406         OptionEntryBool limitPowerByHealth_;
00407         OptionEntryString tutorial_;
00408         OptionEntryBool cycleMaps_;
00409         OptionEntryBool delayedDefenseActivation_;
00410         OptionEntryEnum resignMode_;
00411         OptionEntryEnum movementRestriction_;
00412         OptionEntryEnum turnType_;
00413         OptionEntryEnum windForce_;
00414         OptionEntryEnum windType_;
00415         OptionEntryEnum wallType_;
00416         OptionEntryEnum weapScale_;
00417         OptionEntryBoundedInt modDownloadSpeed_;
00418         OptionEntryInt maxAvatarSize_;
00419         OptionEntryString mod_;
00420         OptionEntryString motd_;
00421         OptionEntryStringEnum economy_;
00422         OptionEntryString landscapes_;
00423         OptionEntryStringEnum statsLogger_;
00424         OptionEntryStringEnum serverFileLogger_;
00425 
00426         // Server only options
00427         OptionEntryString botNamePrefix_;
00428         OptionEntryBool actionSyncCheck_;
00429         OptionEntryBool autoSendSyncCheck_;
00430         OptionEntryBool residualPlayers_;
00431         OptionEntryBool randomizeBotNames_;
00432         OptionEntryBool giveAllWeapons_;
00433         OptionEntryBool registeredUserNames_;
00434         OptionEntryBool allowMultiLingualChat_;
00435         OptionEntryBool allowMultiLingualNames_;
00436         OptionEntryStringEnum authHandler_;
00437         OptionEntryString serverName_;
00438         OptionEntryString *playerType_[24];
00439         OptionEntryString serverPassword_;
00440         OptionEntryInt portNo_;
00441         OptionEntryInt managementPortNo_;
00442         OptionEntryString publishAddress_;
00443         OptionEntryBool publishServer_;
00444         OptionEntryBool allowSameIP_;
00445         OptionEntryBool allowSameUniqueId_;
00446         OptionEntryBool debugFeatures_;
00447 
00448         // Depricated (old) options
00449         OptionEntryEnum depricatedScoreType_;
00450         OptionEntryBool depricatedAutoBallanceTeams_;
00451         OptionEntryBoundedInt depricatedMaxArmsLevel_;
00452         OptionEntryString depricatedServerAdminPassword_;
00453         OptionEntryString depricatedMasterListServer_;
00454         OptionEntryString depricatedMasterListServerURI_;
00455 
00456 };
00457 
00458 #endif

Generated on Mon Feb 16 15:14:49 2009 for Scorched3D by  doxygen 1.5.3