src/ai/api/ai_object.hpp
author truelight
Sun, 18 Mar 2007 00:00:51 +0000
branchnoai
changeset 9448 2a4c4340233d
parent 9441 03da911c8d5f
child 9450 d675836e865c
permissions -rw-r--r--
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
/* $Id$ */

/** @file ai_object.hpp declaration of class for AIObject class */

#ifndef AI_OBJECT_HPP
#define AI_OBJECT_HPP

#include "../../stdafx.h"
#include "../../functions.h"

/**
 * 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
 *   internally to have a common place to handle general things, like internal
 *   command processing, and command-validation checks.
 */
class AIObject {
protected:
	/**
	 * Executes a raw DoCommand for the AI.
	 */
	int32 DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);

	/**
	 * 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 */