示例#1
0
/**
 * Get the direction of a dock.
 * @param t Tile to query
 * @pre IsDock(t)
 * @pre \a t is the land part of the dock
 * @return The direction of the dock on tile \a t.
 */
        public static DiagDirection GetDockDirection(this TileIndex t)
        {
            StationGfx gfx = GetStationGfx(t);

            Debug.Assert(IsDock(t) && gfx < GFX_DOCK_BASE_WATER_PART);
            return((DiagDirection)(gfx));
        }
示例#2
0
/**
 * Gets the direction the road stop entrance points towards.
 * @param t the tile of the road stop
 * @pre IsRoadStopTile(t)
 * @return the direction of the entrance
 */
        public static DiagDirection GetRoadStopDir(this TileIndex t)
        {
            StationGfx gfx = GetStationGfx(t);

            Debug.Assert(IsRoadStopTile(t));
            if (gfx < GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET)
            {
                return((DiagDirection)(gfx));
            }
            else
            {
                return((DiagDirection)(gfx - GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET));
            }
        }
示例#3
0
/**
 * Set the station graphics of this tile
 * @param t the tile to update
 * @param gfx the new graphics
 * @pre TileMap.IsTileType(t, TileType.MP_STATION)
 */
        public static void SetStationGfx(this TileIndex t, StationGfx gfx)
        {
            Debug.Assert(TileMap.IsTileType(t, TileType.MP_STATION));
            Map._m[t].m5 = gfx;
        }