(svn r24008) -Cleanup/doc: try not to mention (No)AI in script APIs

This commit is contained in:
rubidium
2012-03-04 16:54:12 +00:00
parent e6a828def1
commit 22637f139f
22 changed files with 69 additions and 69 deletions

View File

@@ -16,7 +16,7 @@
#include <map>
/**
* Helper to write precondition enforcers for the AI API in an abbreviated manner.
* Helper to write precondition enforcers for the script API in an abbreviated manner.
* @param returnval The value to return on failure.
* @param condition The condition that must be obeyed.
*/
@@ -27,7 +27,7 @@
}
/**
* Helper to write precondition enforcers for the AI API in an abbreviated manner.
* Helper to write precondition enforcers for the script API in an abbreviated manner.
* @param returnval The value to return on failure.
* @param condition The condition that must be obeyed.
* @param error_code The error code passed to ScriptObject::SetLastError.
@@ -83,7 +83,7 @@ public:
ERR_PRECONDITION_STRING_TOO_LONG, // []
/** The company you use is invalid */
ERR_PRECONDITION_INVALID_COMPANY, // []
/** An error returned by a NewGRF. No possibility to get the exact error in an AI readable format */
/** An error returned by a NewGRF. No possibility to get the exact error in an script readable format */
ERR_NEWGRF_SUPPLIED_ERROR, // []
/** Base for general errors */
@@ -149,31 +149,31 @@ public:
* Get the error based on the OpenTTD StringID.
* @api -all
* @param internal_string_id The string to convert.
* @return The NoAI equivalent error message.
* @return The script equivalent error message.
*/
static ScriptErrorType StringToError(StringID internal_string_id);
/**
* Map an internal OpenTTD error message to its NoAI equivalent.
* Map an internal OpenTTD error message to its script equivalent.
* @api -all
* @param internal_string_id The OpenTTD StringID used for an error.
* @param ai_error_msg The NoAI equivalent error message.
* @param ai_error_msg The script equivalent error message.
*/
static void RegisterErrorMap(StringID internal_string_id, ScriptErrorType ai_error_msg);
/**
* Map an internal OpenTTD error message to its NoAI equivalent.
* Map an internal OpenTTD error message to its script equivalent.
* @api -all
* @param ai_error_msg The NoAI error message representation.
* @param ai_error_msg The script error message representation.
* @param message The string representation of this error message, used for debug purposes.
*/
static void RegisterErrorMapString(ScriptErrorType ai_error_msg, const char *message);
private:
typedef std::map<StringID, ScriptErrorType> ScriptErrorMap; ///< The type for mapping between error (internal OpenTTD) StringID to the AI error type.
typedef std::map<StringID, ScriptErrorType> ScriptErrorMap; ///< The type for mapping between error (internal OpenTTD) StringID to the script error type.
typedef std::map<ScriptErrorType, const char *> ScriptErrorMapString; ///< The type for mapping between error type and textual representation.
static ScriptErrorMap error_map; ///< The mapping between error (internal OpenTTD) StringID to the AI error type.
static ScriptErrorMap error_map; ///< The mapping between error (internal OpenTTD) StringID to the script error type.
static ScriptErrorMapString error_map_string; ///< The mapping between error type and textual representation.
};