src/ai/api/ai_testmode.hpp
author truebrain
Mon, 31 Mar 2008 08:45:05 +0000
branchnoai
changeset 9839 ea94d60d13e7
parent 9829 80fbe02a4184
permissions -rw-r--r--
(svn r12505) [NoAI] -Documentation: still forgot some files ;) (minor stuff, capitals mostly)
9450
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
     1
/* $Id$ */
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
     2
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9629
diff changeset
     3
/** @file ai_testmode.hpp Switch the AI to Test Mode. */
9450
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
     4
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
     5
#ifndef AI_TESTMODE_HPP
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
     6
#define AI_TESTMODE_HPP
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
     7
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
     8
#include "ai_object.hpp"
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
     9
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    10
/**
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9629
diff changeset
    11
 * Class to switch current mode to Test Mode.
9450
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    12
 * If you create an instance of this class, the mode will be switched to
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    13
 *   Testing. The original mode is stored and recovered from when ever the
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    14
 *   instance is destroyed.
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    15
 * In Test mode all the commands you execute aren't really executed. The
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    16
 *   system only checks if it would be able to execute your requests, and what
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    17
 *   the cost would be.
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    18
 */
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    19
class AITestMode : public AIObject {
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9629
diff changeset
    20
public:
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9629
diff changeset
    21
	static const char *GetClassName() { return "AITestMode"; }
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9629
diff changeset
    22
9450
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    23
private:
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    24
	AIModeProc *last_mode;
9473
dcbcd1c4496d (svn r9318) [NoAI] -Add: added new param in ModeCallback: costs
truelight
parents: 9450
diff changeset
    25
	AIObject *last_instance;
9450
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    26
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    27
protected:
9475
58c20c0e394f (svn r9320) [NoAI] -Fix: added some doxygen comments to make doxygen happy
truelight
parents: 9473
diff changeset
    28
	/**
58c20c0e394f (svn r9320) [NoAI] -Fix: added some doxygen comments to make doxygen happy
truelight
parents: 9473
diff changeset
    29
	 * The callback proc for Testing mode.
58c20c0e394f (svn r9320) [NoAI] -Fix: added some doxygen comments to make doxygen happy
truelight
parents: 9473
diff changeset
    30
	 */
9629
66dde6412125 (svn r10350) [NoAI] -Sync with trunk r10194:10349
glx
parents: 9596
diff changeset
    31
	static bool ModeProc(TileIndex tile, uint32 p1, uint32 p2, uint procc, CommandCost costs);
9450
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    32
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    33
public:
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    34
	/**
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    35
	 * Creating instance of this class switches the build mode to Testing.
9839
ea94d60d13e7 (svn r12505) [NoAI] -Documentation: still forgot some files ;) (minor stuff, capitals mostly)
truebrain
parents: 9829
diff changeset
    36
	 * @note When the instance is destroyed, he restores the mode that was
9450
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    37
	 *   current when the instance was created!
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    38
	 */
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    39
	AITestMode();
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    40
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    41
	/**
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    42
	 * Destroying this instance reset the building mode to the mode it was
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    43
	 *   in when the instance was created.
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    44
	 */
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    45
	~AITestMode();
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    46
};
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    47
d675836e865c (svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff changeset
    48
#endif /* AI_TESTMODE_HPP */