# tunnelbridge_map.h

Go to the documentation of this file.

    00001 /* $Id: tunnelbridge_map.h 12056 2008-02-04 15:26:35Z frosch $ */
    00002
    00005 #ifndef TUNNELBRIDGE_MAP_H
    00006 #define TUNNELBRIDGE_MAP_H
    00007
    00008 #include "direction_func.h"
    00009 #include "core/bitmath_func.hpp"
    00010 #include "tile_map.h"
    00011 #include "bridge_map.h"
    00012 #include "tunnel_map.h"
    00013
    00014
    00024 static inline DiagDirection GetTunnelBridgeDirection(TileIndex t)
    00025 {
    00026   assert(IsTileType(t, MP_TUNNELBRIDGE));
    00027   return (DiagDirection)GB(_m[t].m5, 0, 2);
    00028 }
    00029
    00037 static inline TransportType GetTunnelBridgeTransportType(TileIndex t)
    00038 {
    00039   assert(IsTileType(t, MP_TUNNELBRIDGE));
    00040   return (TransportType)GB(_m[t].m5, 2, 2);
    00041 }
    00042
    00050 static inline bool HasTunnelBridgeSnowOrDesert(TileIndex t)
    00051 {
    00052   assert(IsTileType(t, MP_TUNNELBRIDGE));
    00053   return HasBit(_m[t].m4, 7);
    00054 }
    00055
    00064 static inline void SetTunnelBridgeSnowOrDesert(TileIndex t, bool snow_or_desert)
    00065 {
    00066   assert(IsTileType(t, MP_TUNNELBRIDGE));
    00067   SB(_m[t].m4, 7, 1, snow_or_desert);
    00068 }
    00069
    00076 static inline TileIndex GetOtherTunnelBridgeEnd(TileIndex t)
    00077 {
    00078   assert(IsTileType(t, MP_TUNNELBRIDGE));
    00079   return IsTunnel(t) ? GetOtherTunnelEnd(t) : GetOtherBridgeEnd(t);
    00080 }
    00081
    00082 #endif /* TUNNELBRIDGE_MAP_H */