src/ai/api/ai_object.hpp
branchnoai
changeset 9427 ef0c109c5661
parent 9416 432e904ce0e1
child 9441 03da911c8d5f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ai/api/ai_object.hpp	Thu Mar 15 22:28:14 2007 +0000
@@ -0,0 +1,35 @@
+/* $Id$ */
+
+/** @file ai_object.hpp declaration of class for AIObject class */
+
+#ifndef AI_OBJECT_HPP
+#define AI_OBJECT_HPP
+
+#include "../../stdafx.h"    // Needed for functions.h
+#include "../../functions.h" // Needed for command.h
+#include "../../command.h"   // Needed for CommandCallback
+
+class AIObject {
+protected:
+	/**
+	 * Executes a raw DoCommandCc for the AI.
+	 */
+	int32 DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc, CommandCallback *callback);
+
+	/**
+	 * Executes a raw DoCommand for the AI.
+	 */
+	int32 DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc) { return this->DoCommandCc(tile, p1, p2, flags, procc, NULL); }
+
+	/**
+	 * Checks if the result of a DoCommand went wrong.
+	 */
+	bool CmdFailed(int32 res);
+
+	/**
+	 * Checks if the result of a DoCommand went okay.
+	 */
+	bool CmdSucceeded(int32 res);
+};
+
+#endif /* AI_OBJECT_HPP */