src/rail_type.h
changeset 8732 b18f578f7c16
parent 8597 87f03bc9c8e4
child 8759 eae56497cf83
equal deleted inserted replaced
8731:a2cab8a23491 8732:b18f578f7c16
    18 	RAILTYPE_MAGLEV   = 3,          ///< Maglev
    18 	RAILTYPE_MAGLEV   = 3,          ///< Maglev
    19 	RAILTYPE_END,                   ///< Used for iterations
    19 	RAILTYPE_END,                   ///< Used for iterations
    20 	INVALID_RAILTYPE  = 0xFF        ///< Flag for invalid railtype
    20 	INVALID_RAILTYPE  = 0xFF        ///< Flag for invalid railtype
    21 };
    21 };
    22 
    22 
    23 typedef byte RailTypeMask;
       
    24 
       
    25 /** Allow incrementing of Track variables */
    23 /** Allow incrementing of Track variables */
    26 DECLARE_POSTFIX_INCREMENT(RailType);
    24 DECLARE_POSTFIX_INCREMENT(RailType);
    27 /** Define basic enum properties */
    25 /** Define basic enum properties */
    28 template <> struct EnumPropsT<RailType> : MakeEnumPropsT<RailType, byte, RAILTYPE_BEGIN, RAILTYPE_END, INVALID_RAILTYPE> {};
    26 template <> struct EnumPropsT<RailType> : MakeEnumPropsT<RailType, byte, RAILTYPE_BEGIN, RAILTYPE_END, INVALID_RAILTYPE> {};
    29 typedef TinyEnumT<RailType> RailTypeByte;
    27 typedef TinyEnumT<RailType> RailTypeByte;
    30 
    28 
       
    29 /**
       
    30  * The different roadtypes we support, but then a bitmask of them
       
    31  */
       
    32 enum RailTypes {
       
    33 	RAILTYPES_NONE     = 0,                      ///< No rail types
       
    34 	RAILTYPES_RAIL     = 1 << RAILTYPE_RAIL,     ///< Non-electrified rails
       
    35 	RAILTYPES_ELECTRIC = 1 << RAILTYPE_ELECTRIC, ///< Electrified rails
       
    36 	RAILTYPES_MONO     = 1 << RAILTYPE_MONO,     ///< Monorail!
       
    37 	RAILTYPES_MAGLEV   = 1 << RAILTYPE_MAGLEV,   ///< Ever fast maglev
       
    38 	RAILTYPES_ALL      = RAILTYPES_RAIL | RAILTYPES_ELECTRIC | RAILTYPES_MONO | RAILTYPES_MAGLEV, ///< All of them
       
    39 	RAILTYPES_END,                               ///< Used for iterations?
       
    40 	INVALID_RAILTYPES  = 0xFF                    ///< Invalid railtypes
       
    41 };
       
    42 DECLARE_ENUM_AS_BIT_SET(RailTypes);
       
    43 template <> struct EnumPropsT<RailTypes> : MakeEnumPropsT<RailTypes, byte, RAILTYPES_NONE, RAILTYPES_END, INVALID_RAILTYPES> {};
       
    44 typedef TinyEnumT<RailTypes> RailTypesByte;
       
    45 
    31 #endif /* RAIL_TYPE_H */
    46 #endif /* RAIL_TYPE_H */