diff options
author | rubidium <rubidium@openttd.org> | 2010-01-09 14:41:22 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-01-09 14:41:22 +0000 |
commit | f65f276d10e528ffe2581656cfa8066a20002995 (patch) | |
tree | 40c36e7a0eb0070dbb4cb04eda09480fee9d0bbf /src/ai/ai_config.hpp | |
parent | 7f6016031e8367c8ce53a4017e5dadd47dc1974e (diff) | |
download | openttd-f65f276d10e528ffe2581656cfa8066a20002995.tar.xz |
(svn r18763) -Feature [FS#3095]: rerandomise AIs on reloading (via the debug window) when they were randomly chosen
Diffstat (limited to 'src/ai/ai_config.hpp')
-rw-r--r-- | src/ai/ai_config.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/ai/ai_config.hpp b/src/ai/ai_config.hpp index 5008b3a3e..fb53b725b 100644 --- a/src/ai/ai_config.hpp +++ b/src/ai/ai_config.hpp @@ -25,7 +25,8 @@ public: name(NULL), version(-1), info(NULL), - config_list(NULL) + config_list(NULL), + is_random_ai(false) {} AIConfig(const AIConfig *config); ~AIConfig(); @@ -34,8 +35,9 @@ public: * Set another AI to be loaded in this slot. * @param name The name of the AI. * @param version The version of the AI to load, or -1 of latest. + * @param is_random Is the AI chosen randomly? */ - void ChangeAI(const char *name, int version = -1); + void ChangeAI(const char *name, int version = -1, bool is_random = false); /** * When ever the AI Scanner is reloaded, all infos become invalid. This @@ -90,6 +92,11 @@ public: bool HasAI() const; /** + * Is the current AI a randomly chosen AI? + */ + bool IsRandomAI() const; + + /** * Get the name of the AI. */ const char *GetName() const; @@ -117,6 +124,7 @@ private: class AIInfo *info; SettingValueList settings; AIConfigItemList *config_list; + bool is_random_ai; }; #endif /* AI_CONFIG_HPP */ |