(svn r17107) -Codechange: store type of subsidy source and destination in the Subsidy struct instead of determining it every time it's needed

This commit is contained in:
smatz
2009-08-07 22:23:34 +00:00
parent 39e145e586
commit 74d3382b94
13 changed files with 157 additions and 171 deletions

View File

@@ -5,6 +5,8 @@
#ifndef CARGO_TYPE_H
#define CARGO_TYPE_H
#include "core/enum_type.hpp"
typedef byte CargoID;
/** Available types of cargo */
@@ -82,4 +84,16 @@ public:
}
};
/** Types of subsidy source and destination */
enum SourceType {
ST_INDUSTRY, ///< Source/destination is an industry
ST_TOWN, ///< Source/destination is a town
ST_STATION, ///< Source/destination is a station
};
typedef SimpleTinyEnumT<SourceType, byte> SourceTypeByte;
typedef uint16 SourceID; ///< Contains either industry ID, town ID or station ID (or INVALID_SOURCE)
static const SourceID INVALID_SOURCE = 0xFFFF; ///< Invalid/unknown index of source
#endif /* CARGO_TYPE_H */