diff options
Diffstat (limited to 'src/ai/ai_instance.hpp')
-rw-r--r-- | src/ai/ai_instance.hpp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/src/ai/ai_instance.hpp b/src/ai/ai_instance.hpp index 65884dc71..b0b32b3b5 100644 --- a/src/ai/ai_instance.hpp +++ b/src/ai/ai_instance.hpp @@ -81,12 +81,17 @@ public: /** * Create a new AI. - * @param info The AI to create the instance of. */ - AIInstance(class AIInfo *info); + AIInstance(); ~AIInstance(); /** + * Initialize the AI and prepare it for its first run. + * @param info The AI to create the instance of. + */ + void Initialize(class AIInfo *info); + + /** * An AI in multiplayer waits for the server to handle his DoCommand. * It keeps waiting for this until this function is called. */ @@ -105,7 +110,12 @@ public: /** * Get the storage of this AI. */ - static class AIStorage *GetStorage(); + class AIStorage *GetStorage(); + + /** + * Get the log pointer of this AI. + */ + void *GetLogPointer(); /** * Return a true/false reply for a DoCommand. @@ -173,6 +183,22 @@ public: * @return The number of operations to execute. */ SQInteger GetOpsTillSuspend(); + + /** + * DoCommand callback function for all commands executed by AIs. + * @param result The result of the command. + * @param tile The tile on which the command was executed. + * @param p1 p1 as given to DoCommandPInternal. + * @param p2 p2 as given to DoCommandPInternal. + */ + void DoCommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2); + + /** + * Insert an event for this AI. + * @param event The event to insert. + */ + void InsertEvent(class AIEvent *event); + private: class AIController *controller; ///< The AI main class. class AIStorage *storage; ///< Some global information for each running AI. |