# slope_type.h

Go to the documentation of this file.

    00001 /* $Id: slope_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
    00016 #ifndef SLOPE_TYPE_H
    00017 #define SLOPE_TYPE_H
    00018
    00019 #include "core/enum_type.hpp"
    00020
    00024 enum Corner {
    00025   CORNER_W = 0,
    00026   CORNER_S = 1,
    00027   CORNER_E = 2,
    00028   CORNER_N = 3,
    00029   CORNER_END,
    00030   CORNER_INVALID = 0xFF
    00031 };
    00032
    00033
    00050 enum Slope {
    00051   SLOPE_FLAT     = 0x00,
    00052   SLOPE_W        = 0x01,
    00053   SLOPE_S        = 0x02,
    00054   SLOPE_E        = 0x04,
    00055   SLOPE_N        = 0x08,
    00056   SLOPE_STEEP    = 0x10,
    00057   SLOPE_NW       = SLOPE_N | SLOPE_W,
    00058   SLOPE_SW       = SLOPE_S | SLOPE_W,
    00059   SLOPE_SE       = SLOPE_S | SLOPE_E,
    00060   SLOPE_NE       = SLOPE_N | SLOPE_E,
    00061   SLOPE_EW       = SLOPE_E | SLOPE_W,
    00062   SLOPE_NS       = SLOPE_N | SLOPE_S,
    00063   SLOPE_ELEVATED = SLOPE_N | SLOPE_E | SLOPE_S | SLOPE_W,
    00064   SLOPE_NWS      = SLOPE_N | SLOPE_W | SLOPE_S,
    00065   SLOPE_WSE      = SLOPE_W | SLOPE_S | SLOPE_E,
    00066   SLOPE_SEN      = SLOPE_S | SLOPE_E | SLOPE_N,
    00067   SLOPE_ENW      = SLOPE_E | SLOPE_N | SLOPE_W,
    00068   SLOPE_STEEP_W  = SLOPE_STEEP | SLOPE_NWS,
    00069   SLOPE_STEEP_S  = SLOPE_STEEP | SLOPE_WSE,
    00070   SLOPE_STEEP_E  = SLOPE_STEEP | SLOPE_SEN,
    00071   SLOPE_STEEP_N  = SLOPE_STEEP | SLOPE_ENW,
    00072
    00073   SLOPE_HALFTILE = 0x20,
    00074   SLOPE_HALFTILE_MASK = 0xE0,
    00075   SLOPE_HALFTILE_W = SLOPE_HALFTILE | (CORNER_W << 6),
    00076   SLOPE_HALFTILE_S = SLOPE_HALFTILE | (CORNER_S << 6),
    00077   SLOPE_HALFTILE_E = SLOPE_HALFTILE | (CORNER_E << 6),
    00078   SLOPE_HALFTILE_N = SLOPE_HALFTILE | (CORNER_N << 6),
    00079 };
    00080 DECLARE_ENUM_AS_BIT_SET(Slope)
    00081
    00082
    00083
    00086 enum Foundation {
    00087   FOUNDATION_NONE,
    00088   FOUNDATION_LEVELED,
    00089   FOUNDATION_INCLINED_X,
    00090   FOUNDATION_INCLINED_Y,
    00091   FOUNDATION_STEEP_LOWER,
    00092
    00093   /* Halftile foundations */
    00094   FOUNDATION_STEEP_BOTH,
    00095   FOUNDATION_HALFTILE_W,
    00096   FOUNDATION_HALFTILE_S,
    00097   FOUNDATION_HALFTILE_E,
    00098   FOUNDATION_HALFTILE_N,
    00099
    00100   /* Special anti-zig-zag foundations for single horizontal/vertical track */
    00101   FOUNDATION_RAIL_W,
    00102   FOUNDATION_RAIL_S,
    00103   FOUNDATION_RAIL_E,
    00104   FOUNDATION_RAIL_N,
    00105
    00106   FOUNDATION_INVALID = 0xFF
    00107 };
    00108
    00109 #endif /* SLOPE_TYPE_H */