# road_type.h

Go to the documentation of this file.

    00001 /* $Id: road_type.h 17248 2009-08-21 20:21:05Z rubidium $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
    00006  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
    00008  */
    00009
    00012 #ifndef ROAD_TYPE_H
    00013 #define ROAD_TYPE_H
    00014
    00015 #include "core/enum_type.hpp"
    00016
    00022 enum RoadType {
    00023   ROADTYPE_BEGIN = 0,
    00024   ROADTYPE_ROAD = 0,
    00025   ROADTYPE_TRAM = 1,
    00026   ROADTYPE_END,
    00027   INVALID_ROADTYPE = 0xFF
    00028 };
    00029 DECLARE_POSTFIX_INCREMENT(RoadType);
    00030
    00035 enum RoadTypes {
    00036   ROADTYPES_NONE     = 0,
    00037   ROADTYPES_ROAD     = 1 << ROADTYPE_ROAD,
    00038   ROADTYPES_TRAM     = 1 << ROADTYPE_TRAM,
    00039   ROADTYPES_ALL      = ROADTYPES_ROAD | ROADTYPES_TRAM,
    00040   ROADTYPES_END,
    00041   INVALID_ROADTYPES  = 0xFF
    00042 };
    00043 DECLARE_ENUM_AS_BIT_SET(RoadTypes);
    00044 typedef SimpleTinyEnumT<RoadTypes, byte> RoadTypesByte;
    00045
    00046
    00053 enum RoadBits {
    00054   ROAD_NONE = 0U,
    00055   ROAD_NW   = 1U,
    00056   ROAD_SW   = 2U,
    00057   ROAD_SE   = 4U,
    00058   ROAD_NE   = 8U,
    00059   ROAD_X    = ROAD_SW | ROAD_NE,
    00060   ROAD_Y    = ROAD_NW | ROAD_SE,
    00061
    00062   ROAD_N    = ROAD_NE | ROAD_NW,
    00063   ROAD_E    = ROAD_NE | ROAD_SE,
    00064   ROAD_S    = ROAD_SE | ROAD_SW,
    00065   ROAD_W    = ROAD_NW | ROAD_SW,
    00066
    00067   ROAD_ALL  = ROAD_X  | ROAD_Y
    00068 };
    00069 DECLARE_ENUM_AS_BIT_SET(RoadBits);
    00070
    00071 #endif /* ROAD_TYPE_H */