summaryrefslogtreecommitdiff
path: root/src/unmovable.h
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2009-02-05 03:41:42 +0000
committerbelugas <belugas@openttd.org>2009-02-05 03:41:42 +0000
commitbf82545b4ab37399f89d50b497c0d5c8f7519c77 (patch)
tree7fc0cfc3838384f419b9b5b9902bd9bead9de669 /src/unmovable.h
parent63cc1bd21f90a6099824178d59e402eb19eeffae (diff)
downloadopenttd-bf82545b4ab37399f89d50b497c0d5c8f7519c77.tar.xz
(svn r15350) -Codechange: Create a spec array to hold the data definitions of unmovables objects.
Note that this is the very basic spec, it will be populated a bit more, later.
Diffstat (limited to 'src/unmovable.h')
-rw-r--r--src/unmovable.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/unmovable.h b/src/unmovable.h
index ebcaa7513..f640a2ece 100644
--- a/src/unmovable.h
+++ b/src/unmovable.h
@@ -5,6 +5,27 @@
#ifndef UNMOVABLE_H
#define UNMOVABLE_H
+#include "unmovable_map.h"
+#include "economy_type.h"
+#include "economy_func.h"
+
void UpdateCompanyHQ(Company *c, uint score);
+struct UnmovableSpec {
+ StringID name;
+ uint8 buy_cost_multiplier;
+ uint8 sell_cost_multiplier;
+
+ Money GetRemovalCost() const { return (_price.clear_roughland * this->sell_cost_multiplier); }
+ Money GetBuildingCost() const { return (_price.clear_roughland * this->buy_cost_multiplier); }
+
+};
+
+extern const UnmovableSpec _original_unmovable[];
+
+static inline const UnmovableSpec *GetUnmovableSpec(UnmovableType type)
+{
+ return &_original_unmovable[type];
+}
+
#endif /* UNMOVABLE_H */