2009-08-21 22:21:05 +02: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 18:11:45 +01:00
|
|
|
/** @file ai_config.hpp AIConfig stores the configuration settings of every AI. */
|
|
|
|
|
|
|
|
#ifndef AI_CONFIG_HPP
|
|
|
|
#define AI_CONFIG_HPP
|
|
|
|
|
2011-11-30 00:26:35 +01:00
|
|
|
#include "../script/script_config.hpp"
|
2012-01-03 21:26:05 +01:00
|
|
|
#include "../company_type.h"
|
2009-01-12 18:11:45 +01:00
|
|
|
|
2011-11-30 00:26:35 +01:00
|
|
|
class AIConfig : public ScriptConfig {
|
2009-01-12 18:11:45 +01:00
|
|
|
public:
|
2011-11-30 00:26:35 +01:00
|
|
|
/**
|
|
|
|
* Get the config of a company.
|
|
|
|
*/
|
|
|
|
static AIConfig *GetConfig(CompanyID company, ScriptSettingSource source = SSS_DEFAULT);
|
|
|
|
|
2009-01-12 18:11:45 +01:00
|
|
|
AIConfig() :
|
2011-11-30 00:26:35 +01:00
|
|
|
ScriptConfig()
|
2009-01-12 18:11:45 +01:00
|
|
|
{}
|
2010-08-01 00:16:34 +02:00
|
|
|
|
2023-04-16 20:14:22 +02:00
|
|
|
AIConfig(const AIConfig *config) :
|
|
|
|
ScriptConfig(config)
|
|
|
|
{}
|
2010-08-01 00:16:34 +02:00
|
|
|
|
2011-11-30 00:26:35 +01:00
|
|
|
class AIInfo *GetInfo() const;
|
2009-01-12 18:11:45 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* When ever the AI Scanner is reloaded, all infos become invalid. This
|
|
|
|
* function tells AIConfig about this.
|
2011-06-03 21:18:39 +02: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 13:29:44 +01:00
|
|
|
* @return \c true if the reset was successful, \c false if the AI was no longer
|
2009-01-12 18:11:45 +01:00
|
|
|
* found.
|
|
|
|
*/
|
2011-06-03 21:18:39 +02:00
|
|
|
bool ResetInfo(bool force_exact_match);
|
2009-01-12 18:11:45 +01:00
|
|
|
|
2011-11-30 00:26:35 +01:00
|
|
|
protected:
|
2023-05-05 09:53:34 +02:00
|
|
|
ScriptInfo *FindInfo(const std::string &name, int version, bool force_exact_match) override;
|
2009-01-12 18:11:45 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* AI_CONFIG_HPP */
|