2009-01-12 17:11:45 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
|
|
|
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2009-01-12 17:11:45 +00:00
|
|
|
/** @file ai_config.hpp AIConfig stores the configuration settings of every AI. */
|
|
|
|
|
|
|
|
#ifndef AI_CONFIG_HPP
|
|
|
|
#define AI_CONFIG_HPP
|
|
|
|
|
2011-11-29 23:26:35 +00:00
|
|
|
#include "../script/script_config.hpp"
|
2012-01-03 20:26:05 +00:00
|
|
|
#include "../company_type.h"
|
2009-01-12 17:11:45 +00:00
|
|
|
|
2011-11-29 23:26:35 +00:00
|
|
|
class AIConfig : public ScriptConfig {
|
2009-01-12 17:11:45 +00:00
|
|
|
public:
|
2011-11-29 23:26:35 +00:00
|
|
|
/**
|
|
|
|
* Get the config of a company.
|
|
|
|
*/
|
|
|
|
static AIConfig *GetConfig(CompanyID company, ScriptSettingSource source = SSS_DEFAULT);
|
|
|
|
|
2009-01-12 17:11:45 +00:00
|
|
|
AIConfig() :
|
2011-11-29 23:26:35 +00:00
|
|
|
ScriptConfig()
|
2009-01-12 17:11:45 +00:00
|
|
|
{}
|
2010-07-31 22:16:34 +00:00
|
|
|
|
2011-11-29 23:26:35 +00:00
|
|
|
AIConfig(const AIConfig *config) :
|
|
|
|
ScriptConfig(config)
|
|
|
|
{}
|
2010-07-31 22:16:34 +00:00
|
|
|
|
2011-11-29 23:26:35 +00:00
|
|
|
class AIInfo *GetInfo() const;
|
2009-01-12 17:11:45 +00:00
|
|
|
|
2011-11-29 23:26:35 +00:00
|
|
|
/* virtual */ int GetSetting(const char *name) const;
|
|
|
|
/* virtual */ void SetSetting(const char *name, int value);
|
2009-01-12 17:11:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* When ever the AI Scanner is reloaded, all infos become invalid. This
|
|
|
|
* function tells AIConfig about this.
|
2011-06-03 19:18:39 +00:00
|
|
|
* @param force_exact_match If true try to find the exact same version
|
|
|
|
* as specified. If false any version is ok.
|
2010-02-27 12:29:44 +00:00
|
|
|
* @return \c true if the reset was successful, \c false if the AI was no longer
|
2009-01-12 17:11:45 +00:00
|
|
|
* found.
|
|
|
|
*/
|
2011-06-03 19:18:39 +00:00
|
|
|
bool ResetInfo(bool force_exact_match);
|
2009-01-12 17:11:45 +00:00
|
|
|
|
2011-11-29 23:26:35 +00:00
|
|
|
protected:
|
|
|
|
/* virtual */ void PushExtraConfigList();
|
|
|
|
/* virtual */ void ClearConfigList();
|
|
|
|
/* virtual */ ScriptInfo *FindInfo(const char *name, int version, bool force_exact_match);
|
2009-01-12 17:11:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* AI_CONFIG_HPP */
|