#include <ai_accounting.hpp>
Public Member Functions | |
AIAccounting () | |
Creating instance of this class starts counting the costs of commands from zero. | |
~AIAccounting () | |
Destroying this instance reset the costs to the value it was in when the instance was created. | |
Money | GetCosts () |
Get the current value of the costs. | |
void | ResetCosts () |
Reset the costs to zero. | |
Static Public Member Functions | |
static const char * | GetClassName () |
Private Attributes | |
Money | last_costs |
Works in both Execute as in Test mode. Example: { local costs = AIAccounting(); BuildRoad(from_here, to_here); BuildRoad(from_there, to_there); print("Costs for route is: " + costs.GetCosts()); }
Definition at line 21 of file ai_accounting.hpp.
AIAccounting::AIAccounting | ( | ) |
Creating instance of this class starts counting the costs of commands from zero.
Definition at line 17 of file ai_accounting.cpp.
References AIObject::GetDoCommandCosts(), and AIObject::SetDoCommandCosts().
Money AIAccounting::GetCosts | ( | ) |
Get the current value of the costs.
Definition at line 7 of file ai_accounting.cpp.
References AIObject::GetDoCommandCosts().