summaryrefslogtreecommitdiff
path: root/src/industrytype.h
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2019-10-04 21:26:44 +0200
committerCharles Pigott <charlespigott@googlemail.com>2019-10-19 17:16:25 +0100
commit53f8d0b815a7be57fb6489d95e67b9002ade14d7 (patch)
tree0b712b7ddfb763497414d03475839b5185227acb /src/industrytype.h
parente5f175562907efed0c958db76ca61145b838dc63 (diff)
downloadopenttd-53f8d0b815a7be57fb6489d95e67b9002ade14d7.tar.xz
Codechange: Use std::vector for industry tile layouts
Diffstat (limited to 'src/industrytype.h')
-rw-r--r--src/industrytype.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/industrytype.h b/src/industrytype.h
index 8f1357b67..c17bf795e 100644
--- a/src/industrytype.h
+++ b/src/industrytype.h
@@ -13,6 +13,7 @@
#define INDUSTRYTYPE_H
#include <array>
+#include <vector>
#include "map_type.h"
#include "slope_type.h"
#include "industry_type.h"
@@ -23,7 +24,6 @@
enum IndustryCleanupType {
CLEAN_RANDOMSOUNDS, ///< Free the dynamically allocated sounds table
- CLEAN_TILELAYOUT, ///< Free the dynamically allocated tile layout structure
};
/** Available types of industry lifetimes. */
@@ -93,17 +93,20 @@ enum IndustryTileSpecialFlags {
};
DECLARE_ENUM_AS_BIT_SET(IndustryTileSpecialFlags)
-struct IndustryTileTable {
+/** Definition of one tile in an industry tile layout */
+struct IndustryTileLayoutTile {
TileIndexDiffC ti;
IndustryGfx gfx;
};
+/** A complete tile layout for an industry is a list of tiles */
+using IndustryTileLayout = std::vector<IndustryTileLayoutTile>;
+
/**
* Defines the data structure for constructing industry.
*/
struct IndustrySpec {
- const IndustryTileTable * const *table; ///< List of the tiles composing the industry
- byte num_table; ///< Number of elements in the table
+ std::vector<IndustryTileLayout> layouts; ///< List of possible tile layouts for the industry
uint8 cost_multiplier; ///< Base construction cost multiplier.
uint32 removal_cost_multiplier; ///< Base removal cost multiplier.
uint32 prospecting_chance; ///< Chance prospecting succeeds
@@ -143,6 +146,8 @@ struct IndustrySpec {
Money GetConstructionCost() const;
Money GetRemovalCost() const;
bool UsesSmoothEconomy() const;
+
+ ~IndustrySpec();
};
/**