(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.
This commit is contained in:
belugas
2009-02-05 03:41:42 +00:00
parent 63cc1bd21f
commit bf82545b4a
3 changed files with 33 additions and 9 deletions

View File

@@ -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 */