src/ai/api/ai_object.hpp
branchnoai
changeset 9864 4a9b7b610b13
parent 9863 73647fe2e301
child 9873 b1ab23560ecb
equal deleted inserted replaced
9863:73647fe2e301 9864:4a9b7b610b13
    19 /* Life becomes easier when we can tell about a function it needs the VM, but
    19 /* Life becomes easier when we can tell about a function it needs the VM, but
    20  *  without really including 'squirrel.h'. */
    20  *  without really including 'squirrel.h'. */
    21 typedef void *HSQUIRRELVM;
    21 typedef void *HSQUIRRELVM;
    22 typedef int SQInteger;
    22 typedef int SQInteger;
    23 #endif
    23 #endif
       
    24 
       
    25 /**
       
    26  * The type (an alias) for all errors the AI API knows.
       
    27  */
       
    28 typedef uint AIErrorType;
    24 
    29 
    25 /**
    30 /**
    26  * The callback function for Mode-classes.
    31  * The callback function for Mode-classes.
    27  */
    32  */
    28 typedef bool (AIModeProc)(TileIndex tile, uint32 p1, uint32 p2, uint procc, CommandCost costs);
    33 typedef bool (AIModeProc)(TileIndex tile, uint32 p1, uint32 p2, uint procc, CommandCost costs);
    76 
    81 
    77 	/**
    82 	/**
    78 	 * Set the DoCommand last error.
    83 	 * Set the DoCommand last error.
    79 	 * @note last_error is an ERR_* from a ErrorMessages enum.
    84 	 * @note last_error is an ERR_* from a ErrorMessages enum.
    80 	 */
    85 	 */
    81 	static void SetLastError(uint last_error);
    86 	static void SetLastError(AIErrorType last_error);
    82 
    87 
    83 	/**
    88 	/**
    84 	 * Get the DoCommand last error.
    89 	 * Get the DoCommand last error.
    85 	 */
    90 	 */
    86 	static uint GetLastError();
    91 	static AIErrorType GetLastError();
    87 
    92 
    88 	/**
    93 	/**
    89 	 * Set the current mode of your AI to this proc.
    94 	 * Set the current mode of your AI to this proc.
    90 	 */
    95 	 */
    91 	static void SetDoCommandMode(AIModeProc *proc, AIObject *instance);
    96 	static void SetDoCommandMode(AIModeProc *proc, AIObject *instance);