--- a/src/ai/api/ai_object.hpp Mon Mar 19 10:08:18 2007 +0000
+++ b/src/ai/api/ai_object.hpp Mon Mar 19 12:23:45 2007 +0000
@@ -8,7 +8,7 @@
#include "../../stdafx.h"
#include "../../functions.h"
-typedef bool (AIModeProc)(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
+typedef bool (AIModeProc)(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc, int32 costs);
/**
* Uper-parent object of all API classes. You should never use this class in
@@ -20,6 +20,7 @@
private:
struct AIDoCommandStruct {
AIModeProc *mode;
+ AIObject *mode_instance;
uint delay;
int32 costs;
};
@@ -33,42 +34,47 @@
/**
* Executes a raw DoCommand for the AI.
*/
- bool DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
+ static bool DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
/**
* Sets the DoCommand costs counter to a value.
*/
- void SetDoCommandCosts(int32 value);
+ static void SetDoCommandCosts(int32 value);
/**
* Increase the current value of the DoCommand costs counter.
*/
- void IncreaseDoCommandCosts(int32 value);
+ static void IncreaseDoCommandCosts(int32 value);
/**
* Get the current DoCommand costs counter.
*/
- int32 GetDoCommandCosts();
+ static int32 GetDoCommandCosts();
/**
* Set the current mode of your AI to this proc.
*/
- void SetDoCommandMode(AIModeProc *proc);
+ static void SetDoCommandMode(AIModeProc *proc, AIObject *instance);
/**
* Get the current mode your AI is currently under.
*/
- AIModeProc *GetDoCommandMode();
+ static AIModeProc *GetDoCommandMode();
+
+ /**
+ * Get the instance of the current mode your AI is currently under.
+ */
+ static AIObject *GetDoCommandModeInstance();
/**
* Set the delay of the DoCommand.
*/
- void SetDoCommandDelay(uint ticks);
+ static void SetDoCommandDelay(uint ticks);
/**
* Get the delay of the DoCommand.
*/
- uint GetDoCommandDelay();
+ static uint GetDoCommandDelay();
public:
/**