From f65f276d10e528ffe2581656cfa8066a20002995 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 9 Jan 2010 14:41:22 +0000 Subject: (svn r18763) -Feature [FS#3095]: rerandomise AIs on reloading (via the debug window) when they were randomly chosen --- src/ai/ai_config.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/ai/ai_config.hpp') 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 @@ -89,6 +91,11 @@ public: */ bool HasAI() const; + /** + * Is the current AI a randomly chosen AI? + */ + bool IsRandomAI() const; + /** * Get the name of the AI. */ @@ -117,6 +124,7 @@ private: class AIInfo *info; SettingValueList settings; AIConfigItemList *config_list; + bool is_random_ai; }; #endif /* AI_CONFIG_HPP */ -- cgit v1.2.3-54-g00ecf