# rail_type.h

Go to the documentation of this file.

    00001 /* $Id: rail_type.h 11827 2008-01-13 00:28:01Z rubidium $ */
    00002
    00005 #ifndef RAIL_TYPE_H
    00006 #define RAIL_TYPE_H
    00007
    00008 #include "core/enum_type.hpp"
    00009
    00015 enum RailType {
    00016   RAILTYPE_BEGIN    = 0,
    00017   RAILTYPE_RAIL     = 0,
    00018   RAILTYPE_ELECTRIC = 1,
    00019   RAILTYPE_MONO     = 2,
    00020   RAILTYPE_MAGLEV   = 3,
    00021   RAILTYPE_END,
    00022   INVALID_RAILTYPE  = 0xFF
    00023 };
    00024
    00026 DECLARE_POSTFIX_INCREMENT(RailType);
    00028 template <> struct EnumPropsT<RailType> : MakeEnumPropsT<RailType, byte, RAILTYPE_BEGIN, RAILTYPE_END, INVALID_RAILTYPE> {};
    00029 typedef TinyEnumT<RailType> RailTypeByte;
    00030
    00034 enum RailTypes {
    00035   RAILTYPES_NONE     = 0,
    00036   RAILTYPES_RAIL     = 1 << RAILTYPE_RAIL,
    00037   RAILTYPES_ELECTRIC = 1 << RAILTYPE_ELECTRIC,
    00038   RAILTYPES_MONO     = 1 << RAILTYPE_MONO,
    00039   RAILTYPES_MAGLEV   = 1 << RAILTYPE_MAGLEV,
    00040   RAILTYPES_ALL      = RAILTYPES_RAIL | RAILTYPES_ELECTRIC | RAILTYPES_MONO | RAILTYPES_MAGLEV,
    00041   RAILTYPES_END,
    00042   INVALID_RAILTYPES  = 0xFF
    00043 };
    00044 DECLARE_ENUM_AS_BIT_SET(RailTypes);
    00045 template <> struct EnumPropsT<RailTypes> : MakeEnumPropsT<RailTypes, byte, RAILTYPES_NONE, RAILTYPES_END, INVALID_RAILTYPES> {};
    00046 typedef TinyEnumT<RailTypes> RailTypesByte;
    00047
    00048 #endif /* RAIL_TYPE_H */