summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-01-18 22:31:06 +0000
committerrubidium <rubidium@openttd.org>2011-01-18 22:31:06 +0000
commit7efd7e19ed046a4a0c03077f27930291ba5b9725 (patch)
tree9e08703cd992ede72e5165044b69750b1385510f /src/industry_cmd.cpp
parent6c9078fd30097b38537a60fbecb9828da69c3517 (diff)
downloadopenttd-7efd7e19ed046a4a0c03077f27930291ba5b9725.tar.xz
(svn r21845) -Codechange: move documentation towards the code to make it more likely to be updates [d-m].
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 398b3f1c3..782e93e73 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -2644,6 +2644,10 @@ void InitializeIndustries()
_industry_builder.Reset();
}
+/**
+ * Is an industry with the spec a raw industry?
+ * @return true if it should be handled as a raw industry
+ */
bool IndustrySpec::IsRawIndustry() const
{
/* Lumber mills are extractive/organic, but can always be built like a non-raw industry */
@@ -2651,6 +2655,10 @@ bool IndustrySpec::IsRawIndustry() const
(this->behaviour & INDUSTRYBEH_CUT_TREES) == 0;
}
+/**
+ * Get the cost for constructing this industry
+ * @return the cost (inflation corrected etc)
+ */
Money IndustrySpec::GetConstructionCost() const
{
/* Building raw industries like secondary uses different price base */
@@ -2658,11 +2666,21 @@ Money IndustrySpec::GetConstructionCost() const
PR_BUILD_INDUSTRY_RAW : PR_BUILD_INDUSTRY] * this->cost_multiplier) >> 8;
}
+/**
+ * Get the cost for removing this industry
+ * Take note that the cost will always be zero for non-grf industries.
+ * Only if the grf author did specified a cost will it be applicable.
+ * @return the cost (inflation corrected etc)
+ */
Money IndustrySpec::GetRemovalCost() const
{
return (_price[PR_CLEAR_INDUSTRY] * this->removal_cost_multiplier) >> 8;
}
+/**
+ * Determines whether this industrytype uses smooth economy or whether it uses standard/newgrf production changes.
+ * @return true if smooth economy is used.
+ */
bool IndustrySpec::UsesSmoothEconomy() const
{
return _settings_game.economy.smooth_economy &&