summaryrefslogtreecommitdiff
path: root/src/ai/ai_instance.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ai/ai_instance.hpp')
-rw-r--r--src/ai/ai_instance.hpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/ai/ai_instance.hpp b/src/ai/ai_instance.hpp
index 9a427c8c6..718531feb 100644
--- a/src/ai/ai_instance.hpp
+++ b/src/ai/ai_instance.hpp
@@ -24,6 +24,11 @@ typedef void (AISuspendCallbackProc)(class AIInstance *instance);
*/
class AI_VMSuspend {
public:
+ /**
+ * Create the suspend exception.
+ * @param time The amount of ticks to suspend.
+ * @param callback The callback to call when the AI may resume again.
+ */
AI_VMSuspend(int time, AISuspendCallbackProc *callback) :
time(time),
callback(callback)
@@ -51,20 +56,33 @@ private:
*/
class AI_FatalError {
public:
+ /**
+ * Creates a "fatal error" exception.
+ * @param msg The message describing the cause of the fatal error.
+ */
AI_FatalError(const char *msg) :
msg(msg)
{}
+ /**
+ * The error message associated with the fatal error.
+ * @return The error message.
+ */
const char *GetErrorMessage() { return msg; }
private:
- const char *msg;
+ const char *msg; ///< The error message.
};
/** Runtime information about an AI like a pointer to the squirrel vm and the current state. */
class AIInstance {
public:
friend class AIObject;
+
+ /**
+ * Create a new AI.
+ * @param info The AI to create the instance of.
+ */
AIInstance(class AIInfo *info);
~AIInstance();