src/ai/api/ai_object.hpp
branchnoai
changeset 9450 d675836e865c
parent 9448 2a4c4340233d
child 9452 4c5eedbc3ba9
--- a/src/ai/api/ai_object.hpp	Sun Mar 18 14:23:26 2007 +0000
+++ b/src/ai/api/ai_object.hpp	Sun Mar 18 16:02:23 2007 +0000
@@ -8,6 +8,8 @@
 #include "../../stdafx.h"
 #include "../../functions.h"
 
+typedef bool (AIModeProc)(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
+
 /**
  * Uper-parent object of all API classes. You should never use this class in
  *   your AI, as it doesn't publish any public functions. It is used
@@ -15,6 +17,17 @@
  *   command processing, and command-validation checks.
  */
 class AIObject {
+private:
+	struct AIDoCommandStruct {
+		AIModeProc *mode;
+		uint delay;
+	};
+
+	/**
+	 * The current mode of the AI players.
+	 */
+	static AIDoCommandStruct *GetDoCommandStruct(PlayerID player);
+
 protected:
 	/**
 	 * Executes a raw DoCommand for the AI.
@@ -30,6 +43,26 @@
 	 * Checks if the result of a DoCommand went okay.
 	 */
 	bool CmdSucceeded(int32 res);
+
+	/**
+	 * Set the current mode of your AI to this proc.
+	 */
+	void SetDoCommandMode(AIModeProc *proc);
+
+	/**
+	 * Get the current mode your AI is currently under.
+	 */
+	AIModeProc *GetDoCommandMode();
+
+	/**
+	 * Set the delay of the DoCommand.
+	 */
+	void SetDoCommandDelay(uint ticks);
+
+	/**
+	 * Get the delay of the DoCommand.
+	 */
+	uint GetDoCommandDelay();
 };
 
 #endif /* AI_OBJECT_HPP */