src/ai/api/ai_error.hpp
author rubidium
Sun, 06 Apr 2008 12:26:40 +0000
branchnoai
changeset 9867 b7d9ffe24f81
parent 9866 efc38e1f559a
child 9868 3998f2e73dda
permissions -rw-r--r--
(svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
9844
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
     1
/* $Id$ */
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
     2
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
     3
/** @file ai_error.hpp Everything to query errors. */
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
     4
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
     5
#ifndef AI_ERROR_HPP
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
     6
#define AI_ERROR_HPP
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
     7
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
     8
#include "ai_object.hpp"
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
     9
#include <map>
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    10
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    11
/**
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    12
 * Class that handles all error related functions.
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    13
 */
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    14
class AIError : public AIObject {
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    15
public:
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    16
	static const char *GetClassName() { return "AIError"; }
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    17
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    18
	/**
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    19
	 * All categories errors can be divided in.
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    20
	 */
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    21
	enum ErrorCategories {
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    22
		ERR_CAT_NONE = 0, //!< Error messages not related to any category.
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    23
		ERR_CAT_GENERAL,  //!< Error messages related to general things.
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    24
		ERR_CAT_VEHICLE,  //!< Error messages related to building / maintaining vehicles.
9866
efc38e1f559a (svn r12559) [NoAI] -Add: SetLastError support for AIAirport.
rubidium
parents: 9865
diff changeset
    25
		ERR_CAT_STATION,  //!< Error messages related to building / maintaining stations.
9867
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9866
diff changeset
    26
		ERR_CAT_BRIDGE,   //!< Error messages related to building / removing bridges.
9844
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    27
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    28
		/**
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    29
		 * DO NOT USE! The error bitsize determines how many errors can be stored in
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    30
		 *  a category and what the offsets are of all categories.
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    31
		 */
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    32
		ERR_CAT_BIT_SIZE = 8,
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    33
	};
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    34
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    35
	/**
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    36
	 * General error messages (0x0100 - 0x0200).
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    37
	 */
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    38
	enum ErrorMessages {
9861
53fc03195e31 (svn r12544) [NoAI] -Codechange: do not force dependency on OTTD internal strings when defining errors.
rubidium
parents: 9844
diff changeset
    39
		/** Initial error value */
53fc03195e31 (svn r12544) [NoAI] -Codechange: do not force dependency on OTTD internal strings when defining errors.
rubidium
parents: 9844
diff changeset
    40
		ERR_NONE = ERR_CAT_NONE << ERR_CAT_BIT_SIZE,  // []
53fc03195e31 (svn r12544) [NoAI] -Codechange: do not force dependency on OTTD internal strings when defining errors.
rubidium
parents: 9844
diff changeset
    41
		/** If an error occured and the error wasn't mapped */
53fc03195e31 (svn r12544) [NoAI] -Codechange: do not force dependency on OTTD internal strings when defining errors.
rubidium
parents: 9844
diff changeset
    42
		ERR_UNKNOWN,                                  // []
9863
73647fe2e301 (svn r12552) [NoAI] -Change: do not force the use of StringIDs when setting errors.
rubidium
parents: 9861
diff changeset
    43
		/** If a precondition is not met */
73647fe2e301 (svn r12552) [NoAI] -Change: do not force the use of StringIDs when setting errors.
rubidium
parents: 9861
diff changeset
    44
		ERR_PRECONDITION_FAILED,                      // []
9844
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    45
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    46
		/** Base for general errors */
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    47
		ERR_GENERAL_BASE = ERR_CAT_GENERAL << ERR_CAT_BIT_SIZE,
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    48
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    49
		/** Not enough cash to perform the previous action */
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    50
		ERR_NOT_ENOUGH_CASH,                          // [STR_0003_NOT_ENOUGH_CASH_REQUIRES]
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    51
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    52
		/** Local authority won't allow the previous action */
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    53
		ERR_LOCAL_AUTHORITY_REFUSES,                  // [STR_2009_LOCAL_AUTHORITY_REFUSES]
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    54
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    55
		/** The piece of infrastructure you tried to build is already in place */
9867
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9866
diff changeset
    56
		ERR_ALREADY_BUILT,                            // [STR_1007_ALREADY_BUILT, STR_5007_MUST_DEMOLISH_BRIDGE_FIRST]
9844
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    57
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    58
		/** Area isn't clear, try to demolish the building on it */
9865
f241472f09dc (svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents: 9864
diff changeset
    59
		ERR_AREA_NOT_CLEAR,                           // [STR_2004_BUILDING_MUST_BE_DEMOLISHED, STR_5007_MUST_DEMOLISH_BRIDGE_FIRST, STR_300B_MUST_DEMOLISH_RAILROAD, STR_300E_MUST_DEMOLISH_AIRPORT_FIRST, STR_MUST_DEMOLISH_CARGO_TRAM_STATION, STR_3047_MUST_DEMOLISH_TRUCK_STATION, STR_MUST_DEMOLISH_PASSENGER_TRAM_STATION, STR_3046_MUST_DEMOLISH_BUS_STATION, STR_306A_BUOY_IN_THE_WAY, STR_304D_MUST_DEMOLISH_DOCK_FIRST, STR_4800_IN_THE_WAY, STR_5804_COMPANY_HEADQUARTERS_IN, STR_5800_OBJECT_IN_THE_WAY, STR_1801_MUST_REMOVE_ROAD_FIRST, STR_1008_MUST_REMOVE_RAILROAD_TRACK, STR_5007_MUST_DEMOLISH_BRIDGE_FIRST, STR_5006_MUST_DEMOLISH_TUNNEL_FIRST]
9844
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    60
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    61
		/** Area is owned by another company */
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    62
		ERR_AREA_IS_OWNED_BY_ANOTHER_COMPANY,         // [STR_1024_AREA_IS_OWNED_BY_ANOTHER]
9865
f241472f09dc (svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents: 9864
diff changeset
    63
f241472f09dc (svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents: 9864
diff changeset
    64
		/** The name given is not unique for the object type */
f241472f09dc (svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents: 9864
diff changeset
    65
		ERR_NAME_IS_NOT_UNIQUE,                       // [STR_NAME_MUST_BE_UNIQUE]
f241472f09dc (svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents: 9864
diff changeset
    66
f241472f09dc (svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents: 9864
diff changeset
    67
		/** The building you want to build requires flat land */
f241472f09dc (svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents: 9864
diff changeset
    68
		ERR_FLAT_LAND_REQUIRED,                       // [STR_0007_FLAT_LAND_REQUIRED]
9844
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    69
	};
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    70
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    71
	/**
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    72
	 * Check the membership of the last thrown error.
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    73
	 * @return The category the error belongs to.
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    74
	 * @note The last throw error can be aquired by calling GetLastError().
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    75
	 */
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    76
	static ErrorCategories GetErrorCategory();
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    77
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    78
	/**
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    79
	 * Get the last error.
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    80
	 * @return An ErrorMessages enum value.
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    81
	 */
9864
4a9b7b610b13 (svn r12554) [NoAI] -Codechange: add more typing information.
rubidium
parents: 9863
diff changeset
    82
	static AIErrorType GetLastError();
9844
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    83
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    84
	/**
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    85
	 * Get the last error in string format (for human readability).
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    86
	 * @return An ErrorMessage enum item, as string.
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    87
	 */
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    88
	static const char *GetLastErrorString();
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    89
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    90
	/**
9863
73647fe2e301 (svn r12552) [NoAI] -Change: do not force the use of StringIDs when setting errors.
rubidium
parents: 9861
diff changeset
    91
	 * Get the error based on the OpenTTD StringID.
73647fe2e301 (svn r12552) [NoAI] -Change: do not force the use of StringIDs when setting errors.
rubidium
parents: 9861
diff changeset
    92
	 * @note DO NOT INVOKE THIS METHOD YOURSELF!
73647fe2e301 (svn r12552) [NoAI] -Change: do not force the use of StringIDs when setting errors.
rubidium
parents: 9861
diff changeset
    93
	 * @param internal_string_id The string to convert.
73647fe2e301 (svn r12552) [NoAI] -Change: do not force the use of StringIDs when setting errors.
rubidium
parents: 9861
diff changeset
    94
	 * @return The NoAI equivalent error message.
73647fe2e301 (svn r12552) [NoAI] -Change: do not force the use of StringIDs when setting errors.
rubidium
parents: 9861
diff changeset
    95
	 */
9864
4a9b7b610b13 (svn r12554) [NoAI] -Codechange: add more typing information.
rubidium
parents: 9863
diff changeset
    96
	static AIErrorType StringToError(StringID internal_string_id);
9863
73647fe2e301 (svn r12552) [NoAI] -Change: do not force the use of StringIDs when setting errors.
rubidium
parents: 9861
diff changeset
    97
73647fe2e301 (svn r12552) [NoAI] -Change: do not force the use of StringIDs when setting errors.
rubidium
parents: 9861
diff changeset
    98
	/**
9844
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
    99
	 * Map an internal OpenTTD error message to it's NoAI equivalent.
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   100
	 * @note DO NOT INVOKE THIS METHOD YOURSELF! The calls are autogenerated.
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   101
	 * @param internal_string_id The OpenTTD StringID used for an error.
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   102
	 * @param ai_error_msg The NoAI equivalent error message.
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   103
	 */
9864
4a9b7b610b13 (svn r12554) [NoAI] -Codechange: add more typing information.
rubidium
parents: 9863
diff changeset
   104
	static void RegisterErrorMap(StringID internal_string_id, AIErrorType ai_error_msg);
9844
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   105
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   106
	/**
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   107
	 * Map an internal OpenTTD error message to it's NoAI equivalent.
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   108
	 * @note DO NOT INVOKE THIS METHOD YOURSELF! The calls are autogenerated.
9861
53fc03195e31 (svn r12544) [NoAI] -Codechange: do not force dependency on OTTD internal strings when defining errors.
rubidium
parents: 9844
diff changeset
   109
	 * @param ai_error_msg The NoAI error message representation.
9844
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   110
	 * @param message The string representation of this error message, used for debug purposes.
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   111
	 */
9864
4a9b7b610b13 (svn r12554) [NoAI] -Codechange: add more typing information.
rubidium
parents: 9863
diff changeset
   112
	static void RegisterErrorMapString(AIErrorType ai_error_msg, const char *message);
9844
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   113
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   114
private:
9864
4a9b7b610b13 (svn r12554) [NoAI] -Codechange: add more typing information.
rubidium
parents: 9863
diff changeset
   115
	typedef std::map<StringID, AIErrorType> AIErrorMap;
4a9b7b610b13 (svn r12554) [NoAI] -Codechange: add more typing information.
rubidium
parents: 9863
diff changeset
   116
	typedef std::map<AIErrorType, const char *> AIErrorMapString;
9844
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   117
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   118
	static AIErrorMap error_map;
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   119
	static AIErrorMapString error_map_string;
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   120
};
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   121
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff changeset
   122
#endif /* AI_ERROR_HPP */