src/ai/api/ai_settings.hpp
author truelight
Sun, 18 Mar 2007 16:02:23 +0000
branchnoai
changeset 9450 d675836e865c
child 9452 4c5eedbc3ba9
permissions -rw-r--r--
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
-Add: added AIExecMode and AITestMode which allows to switch the DoCommand mode
/* $Id$ */

/** @file ai_settings.hpp everything to change AI settings */

#ifndef AI_SETTINGS_HPP
#define AI_SETTINGS_HPP

#include "ai_object.hpp"

/**
 * Class that handles all AI settings related functions.
 * @note This isn't available from your AI.
 */
class AISettings : public AIObject {
public:
	/**
	 * Change the minimum amount of time the AI should be put in suspend mode
	 *   when you execute a command. Normally in SP this is 1, and in MP it is
	 *   what ever delay the server has been programmed to delay commands
	 *   (normally between 1 and 5). To give a more 'real' effect to your AI,
	 *   you can control that number here.
	 * @param ticks the minimum amount of ticks to wait.
	 * @pre ticks should be positive. Too big values will influence performance of the AI.
	 * @note If the number is lower then the MP setting, the MP setting wins.
	 */
	void SetCommandDelay(uint ticks);
};

#ifdef DEFINE_SQUIRREL_CLASS
void SQAISettingsRegister(Squirrel *engine) {
	DefSQClass <AISettings> SQAISettings("AISettings");
	SQAISettings.PreRegister(engine);
	SQAISettings.AddConstructor(engine);
	SQAISettings.DefSQFunction(engine, &AISettings::SetCommandDelay, "SetCommandDelay");
	SQAISettings.PostRegister(engine);
}
#endif /* SQUIRREL_CLASS */

#endif /* AI_SETTINGS_HPP */