|
OpenTTD NoAI API
|
Everything to query errors. More...
Data Structures | |
| class | AIError |
| Class that handles all error related functions. More... | |
Defines | |
| #define | EnforcePrecondition(returnval, condition) |
| Helper to write precondition enforcers for the AI API in an abbreviated manner. | |
| #define | EnforcePreconditionCustomError(returnval, condition, error_code) |
| Helper to write precondition enforcers for the AI API in an abbreviated manner. | |
Everything to query errors.
| #define EnforcePrecondition | ( | returnval, | |
| condition | |||
| ) |
if (!(condition)) { \ AIObject::SetLastError(AIError::ERR_PRECONDITION_FAILED); \ return returnval; \ }
Helper to write precondition enforcers for the AI API in an abbreviated manner.
| returnval | The value to return on failure. |
| condition | The condition that must be obeyed. |
| #define EnforcePreconditionCustomError | ( | returnval, | |
| condition, | |||
| error_code | |||
| ) |
if (!(condition)) { \ AIObject::SetLastError(error_code); \ return returnval; \ }
Helper to write precondition enforcers for the AI API in an abbreviated manner.
| returnval | The value to return on failure. |
| condition | The condition that must be obeyed. |
| error_code | The error code passed to AIObject::SetLastError. |
1.7.5