src/ai/api/ai_object.hpp
branchnoai
changeset 9452 4c5eedbc3ba9
parent 9450 d675836e865c
child 9454 ee6a65b37b82
equal deleted inserted replaced
9451:7629656423cc 9452:4c5eedbc3ba9
    19 class AIObject {
    19 class AIObject {
    20 private:
    20 private:
    21 	struct AIDoCommandStruct {
    21 	struct AIDoCommandStruct {
    22 		AIModeProc *mode;
    22 		AIModeProc *mode;
    23 		uint delay;
    23 		uint delay;
       
    24 		int32 costs;
    24 	};
    25 	};
    25 
    26 
    26 	/**
    27 	/**
    27 	 * The current mode of the AI players.
    28 	 * The current mode of the AI players.
    28 	 */
    29 	 */
    30 
    31 
    31 protected:
    32 protected:
    32 	/**
    33 	/**
    33 	 * Executes a raw DoCommand for the AI.
    34 	 * Executes a raw DoCommand for the AI.
    34 	 */
    35 	 */
    35 	int32 DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
    36 	bool DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
    36 
    37 
    37 	/**
    38 	/**
    38 	 * Checks if the result of a DoCommand went wrong.
    39 	 * Sets the DoCommand costs counter to a value.
    39 	 */
    40 	 */
    40 	bool CmdFailed(int32 res);
    41 	void SetDoCommandCosts(int32 value);
    41 
    42 
    42 	/**
    43 	/**
    43 	 * Checks if the result of a DoCommand went okay.
    44 	 * Increase the current value of the DoCommand costs counter.
    44 	 */
    45 	 */
    45 	bool CmdSucceeded(int32 res);
    46 	void IncreaseDoCommandCosts(int32 value);
       
    47 
       
    48 	/**
       
    49 	 * Get the current DoCommand costs counter.
       
    50 	 */
       
    51 	int32 GetDoCommandCosts();
    46 
    52 
    47 	/**
    53 	/**
    48 	 * Set the current mode of your AI to this proc.
    54 	 * Set the current mode of your AI to this proc.
    49 	 */
    55 	 */
    50 	void SetDoCommandMode(AIModeProc *proc);
    56 	void SetDoCommandMode(AIModeProc *proc);