1 /*
2  * This file is part of OpenTTD.
3  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6  */
7 
8 /** @file script_accounting.cpp Implementation of ScriptAccounting. */
9 
10 #include "../../stdafx.h"
11 #include "script_accounting.hpp"
12 
13 #include "../../safeguards.h"
14 
GetCosts()15 Money ScriptAccounting::GetCosts()
16 {
17 	return this->GetDoCommandCosts();
18 }
19 
ResetCosts()20 void ScriptAccounting::ResetCosts()
21 {
22 	this->SetDoCommandCosts(0);
23 }
24 
ScriptAccounting()25 ScriptAccounting::ScriptAccounting()
26 {
27 	this->last_costs = this->GetDoCommandCosts();
28 	this->SetDoCommandCosts(0);
29 }
30 
~ScriptAccounting()31 ScriptAccounting::~ScriptAccounting()
32 {
33 	this->SetDoCommandCosts(this->last_costs);
34 }
35