~ubuntu-branches/debian/squeeze/openttd/squeeze

« back to all changes in this revision

Viewing changes to src/ai/api/ai_gamesettings.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Matthijs Kooijman, Jordi Mallach
  • Date: 2009-04-15 18:22:10 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090415182210-22ktb8kdbp2tf3bm
[ Matthijs Kooijman ]
* New upstream release.
* Remove Debian specific desktop file, upstream provides one now. 
* Add debian/watch file.

[ Jordi Mallach ]
* Bump Standards-Version to 3.8.1, with no changes required.
* Move to debhelper compat 7. Bump Build-Depends accordingly.
* Use dh_prep.
* Add "set -e" to config script.
* Remove a few extra doc files that get installed by upstream Makefile.
* Add more complete copyright information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: ai_gamesettings.hpp 15410 2009-02-08 12:25:13Z rubidium $ */
 
2
 
 
3
/** @file ai_gamesettings.hpp Everything to read game settings. */
 
4
 
 
5
#ifndef AI_GAMESETTINGS_HPP
 
6
#define AI_GAMESETTINGS_HPP
 
7
 
 
8
#include "ai_object.hpp"
 
9
#include "ai_vehicle.hpp"
 
10
 
 
11
/**
 
12
 * Class that handles all game settings related functions.
 
13
 *
 
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
 
21
 *       accessing it.
 
22
 *
 
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,
 
29
 *       etc.).
 
30
 */
 
31
class AIGameSettings : public AIObject {
 
32
public:
 
33
        static const char *GetClassName() { return "AIGameSettings"; }
 
34
 
 
35
        /**
 
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
 
40
         *          changed it's name.
 
41
         * @note Results achieved in the past offer no gurantee for the future.
 
42
         * @return True if and only if the setting is valid.
 
43
         */
 
44
        static bool IsValid(const char *setting);
 
45
 
 
46
        /**
 
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.
 
56
         */
 
57
        static int32 GetValue(const char *setting);
 
58
 
 
59
        /**
 
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.
 
63
         */
 
64
        static bool IsDisabledVehicleType(AIVehicle::VehicleType vehicle_type);
 
65
};
 
66
 
 
67
#endif /* AI_GAMESETTINGS_HPP */