Changeset - r23675:0f5cbce0ed2a
[Not reviewed]
master
0 3 0
Charles Pigott - 5 years ago 2019-04-22 08:28:09
charlespigott@googlemail.com
Codechange: Remove SourceTypeByte type
3 files changed with 4 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/cargo_type.h
Show inline comments
 
@@ -145,12 +145,11 @@ public:
 

	
 

	
 
/** Types of cargo source and destination */
 
enum SourceType {
 
enum SourceType : byte {
 
	ST_INDUSTRY,     ///< Source/destination is an industry
 
	ST_TOWN,         ///< Source/destination is a town
 
	ST_HEADQUARTERS, ///< Source/destination are company headquarters
 
};
 
typedef SimpleTinyEnumT<SourceType, byte> SourceTypeByte; ///< The SourceType packed into a byte for savegame purposes.
 

	
 
typedef uint16 SourceID; ///< Contains either industry ID, town ID or company ID (or INVALID_SOURCE)
 
static const SourceID INVALID_SOURCE = 0xFFFF; ///< Invalid/unknown index of source
src/cargopacket.h
Show inline comments
 
@@ -46,7 +46,7 @@ private:
 
	Money feeder_share;         ///< Value of feeder pickup to be paid for on delivery of cargo.
 
	uint16 count;               ///< The amount of cargo in this packet.
 
	byte days_in_transit;       ///< Amount of days this packet has been in transit.
 
	SourceTypeByte source_type; ///< Type of \c source_id.
 
	SourceType source_type; ///< Type of \c source_id.
 
	SourceID source_id;         ///< Index of source, INVALID_SOURCE if unknown/invalid.
 
	StationID source;           ///< The station where the cargo came from first.
 
	TileIndex source_xy;        ///< The origin of the cargo (first station in feeder chain).
src/subsidy_base.h
Show inline comments
 
@@ -25,8 +25,8 @@ struct Subsidy : SubsidyPool::PoolItem<&
 
	CargoID cargo_type;      ///< Cargo type involved in this subsidy, CT_INVALID for invalid subsidy
 
	byte remaining;          ///< Remaining months when this subsidy is valid
 
	CompanyID awarded;       ///< Subsidy is awarded to this company; INVALID_COMPANY if it's not awarded to anyone
 
	SourceTypeByte src_type; ///< Source of subsidised path (ST_INDUSTRY or ST_TOWN)
 
	SourceTypeByte dst_type; ///< Destination of subsidised path (ST_INDUSTRY or ST_TOWN)
 
	SourceType src_type; ///< Source of subsidised path (ST_INDUSTRY or ST_TOWN)
 
	SourceType dst_type; ///< Destination of subsidised path (ST_INDUSTRY or ST_TOWN)
 
	SourceID src;            ///< Index of source. Either TownID or IndustryID
 
	SourceID dst;            ///< Index of destination. Either TownID or IndustryID
 

	
0 comments (0 inline, 0 general)