1
/* $Id: ai_gamesettings.hpp 15410 2009-02-08 12:25:13Z rubidium $ */
3
/** @file ai_gamesettings.hpp Everything to read game settings. */
5
#ifndef AI_GAMESETTINGS_HPP
6
#define AI_GAMESETTINGS_HPP
8
#include "ai_object.hpp"
9
#include "ai_vehicle.hpp"
12
* Class that handles all game settings related functions.
14
* @note AIGameSettings::IsValid and AIGameSettings::GetValue are functions
15
* that rely on the settings as OpenTTD stores them in savegame and
16
* openttd.cfg. No guarantees can be given on the long term validity,
17
* consistency and stability of the names, values and value ranges.
18
* Using these settings can be dangerous and could cause issues in
19
* future versions. To make sure that a setting still exists in the
20
* current version you have to run AIGameSettings::IsValid before
23
* @note The names of the setting for AIGameSettings::IsValid and
24
* AIGameSettings::GetValue are the same ones as those that are shown by
25
* the list_settings command in the in-game console. Settings that are
26
* string based are NOT supported and AIGAmeSettings::IsValid will return
27
* false for them. These settings will not be supported either because
28
* they have no relevance for the AI (default client names, server IPs,
31
class AIGameSettings : public AIObject {
33
static const char *GetClassName() { return "AIGameSettings"; }
36
* Is the given game setting a valid setting for this instance of OpenTTD?
37
* @param setting The setting to check for existence.
38
* @warning Results of this function are not governed by the API. This means
39
* that a setting that previously existed can be gone or has
41
* @note Results achieved in the past offer no gurantee for the future.
42
* @return True if and only if the setting is valid.
44
static bool IsValid(const char *setting);
47
* Gets the value of the game setting.
48
* @param setting The setting to get the value of.
49
* @pre IsValid(setting).
50
* @warning Results of this function are not governed by the API. This means
51
* that the value of settings may be out of the expected range. It
52
* also means that a setting that previously existed can be gone or
53
* has changed it's name/characteristics.
54
* @note Results achieved in the past offer no gurantee for the future.
55
* @return The value for the setting.
57
static int32 GetValue(const char *setting);
60
* Checks whether the given vehicle-type is disabled for AIs.
61
* @param vehicle_type The vehicle-type to check.
62
* @return True if the vehicle-type is disabled.
64
static bool IsDisabledVehicleType(AIVehicle::VehicleType vehicle_type);
67
#endif /* AI_GAMESETTINGS_HPP */