summaryrefslogtreecommitdiff
path: root/src/ai/ai_instance.hpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-07-31 22:16:34 +0000
committeryexo <yexo@openttd.org>2010-07-31 22:16:34 +0000
commit6d4900ed7c1631c40aec59cab9c11881107456a5 (patch)
tree7e3bc6a621693ec52811f4bf50de8756f5db30dc /src/ai/ai_instance.hpp
parent5b20472ccbae53f70e7528ecb7322c92690cffef (diff)
downloadopenttd-6d4900ed7c1631c40aec59cab9c11881107456a5.tar.xz
(svn r20271) -Doc: add doxygen comments to several items under src/ai/
Diffstat (limited to 'src/ai/ai_instance.hpp')
-rw-r--r--src/ai/ai_instance.hpp34
1 files changed, 22 insertions, 12 deletions
diff --git a/src/ai/ai_instance.hpp b/src/ai/ai_instance.hpp
index f046aa86c..8d838f057 100644
--- a/src/ai/ai_instance.hpp
+++ b/src/ai/ai_instance.hpp
@@ -29,12 +29,21 @@ public:
callback(callback)
{}
+ /**
+ * Get the amount ot ticks the AI should be suspended.
+ * @return The amount of AI ticks to suspend the AI.
+ */
int GetSuspendTime() { return time; }
+
+ /**
+ * Get the callback to call when the AI can run again.
+ * @return The callback function to run.
+ */
AISuspendCallbackProc *GetSuspendCallback() { return callback; }
private:
- int time;
- AISuspendCallbackProc *callback;
+ int time; //!< Amount of ticks to suspend the AI.
+ AISuspendCallbackProc *callback; //!< Callback function to call when the AI can run again.
};
/**
@@ -52,6 +61,7 @@ private:
const char *msg;
};
+/** Runtime information about an AI like a pointer to the squirrel vm and the current state. */
class AIInstance {
public:
friend class AIObject;
@@ -145,16 +155,16 @@ public:
*/
void Suspend();
private:
- class AIController *controller;
- class AIStorage *storage;
- class Squirrel *engine;
- SQObject *instance;
-
- bool is_started;
- bool is_dead;
- bool is_save_data_on_stack;
- int suspend;
- AISuspendCallbackProc *callback;
+ class AIController *controller; //!< The AI main class.
+ class AIStorage *storage; //!< Some global information for each running AI.
+ class Squirrel *engine; //!< A wrapper around the squirrel vm.
+ SQObject *instance; //!< Squirrel-pointer to the AI main class.
+
+ bool is_started; //!< Is the AIs constructor executed?
+ bool is_dead; //!< True if the AI has been stopped.
+ bool is_save_data_on_stack; //!< Is the save data still on the squirrel stack?
+ int suspend; //!< The amount of ticks to suspend this AI before it's allowed to continue.
+ AISuspendCallbackProc *callback; //!< Callback that should be called in the next tick the AI runs.
/**
* Register all API functions to the VM.