(svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved

This commit is contained in:
smatz
2008-04-06 14:50:37 +00:00
parent 935b562074
commit 54630d0735
2 changed files with 40 additions and 57 deletions

View File

@@ -668,52 +668,3 @@ callb_err:
ClearStorageChanges(false);
return false;
}
CommandCost CommandCost::AddCost(CommandCost ret)
{
this->AddCost(ret.cost);
if (this->success && !ret.success) {
this->message = ret.message;
this->success = false;
}
return *this;
}
CommandCost CommandCost::AddCost(Money cost)
{
this->cost += cost;
return *this;
}
CommandCost CommandCost::MultiplyCost(int factor)
{
this->cost *= factor;
return *this;
}
Money CommandCost::GetCost() const
{
return this->cost;
}
ExpensesType CommandCost::GetExpensesType() const
{
return this->expense_type;
}
void CommandCost::SetGlobalErrorMessage() const
{
extern StringID _error_message;
if (this->message != INVALID_STRING_ID) _error_message = this->message;
}
bool CommandCost::Succeeded() const
{
return this->success;
}
bool CommandCost::Failed() const
{
return !this->success;
}