Esempio n. 1
0
/**
 * Make the given tile a buoy tile.
 * @param t the tile to make a buoy
 * @param sid the station to which this tile belongs
 * @param wc the type of water on this tile
 */
        public static void MakeBuoy(this TileIndex t, StationID sid, WaterClass wc)
        {
            /* Make the owner of the buoy tile the same as the current owner of the
             * water tile. In this way, we can reset the owner of the water to its
             * original state when the buoy gets removed. */
            MakeStation(t, TileMap.GetTileOwner(t), sid, StationType.STATION_BUOY, 0, wc);
        }
Esempio n. 2
0
/**
 * Make the given tile a roadstop tile.
 * @param t the tile to make a roadstop
 * @param o the owner of the roadstop
 * @param sid the station to which this tile belongs
 * @param rst the type of roadstop to make this tile
 * @param rt the roadtypes on this tile
 * @param d the direction of the roadstop
 */
        public static void MakeRoadStop(this TileIndex t, Owner o, StationID sid, RoadStopType rst, RoadTypes rt,
                                        DiagDirection d)
        {
            MakeStation(t, o, sid,
                        (rst == RoadStopType.ROADSTOP_BUS ? StationType.STATION_BUS : StationType.STATION_TRUCK), d);
            t.SetRoadTypes(rt);
            t.SetRoadOwner(RoadType.ROADTYPE_ROAD, o);
            t.SetRoadOwner(RoadType.ROADTYPE_TRAM, o);
        }
Esempio n. 3
0
/**
 * Make the given tile a drivethrough roadstop tile.
 * @param t the tile to make a roadstop
 * @param station the owner of the roadstop
 * @param road the owner of the road
 * @param tram the owner of the tram
 * @param sid the station to which this tile belongs
 * @param rst the type of roadstop to make this tile
 * @param rt the roadtypes on this tile
 * @param a the direction of the roadstop
 */
        public static void MakeDriveThroughRoadStop(this TileIndex t, Owner station, Owner road, Owner tram,
                                                    StationID sid, RoadStopType rst, RoadTypes rt, Axis a)
        {
            MakeStation(t, station, sid,
                        (rst == RoadStopType.ROADSTOP_BUS ? StationType.STATION_BUS : StationType.STATION_TRUCK),
                        GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET + a);
            t.SetRoadTypes(rt);
            t.SetRoadOwner(RoadType.ROADTYPE_ROAD, road);
            t.SetRoadOwner(RoadType.ROADTYPE_TRAM, tram);
        }
Esempio n. 4
0
/**
 * Make the given tile a station tile.
 * @param t the tile to make a station tile
 * @param o the owner of the station
 * @param sid the station to which this tile belongs
 * @param st the type this station tile
 * @param section the StationGfx to be used for this tile
 * @param wc The water class of the station
 */
        public static void MakeStation(this TileIndex t, Owner o, StationID sid, StationType st, byte section,
                                       WaterClass wc = WaterClass.WATER_CLASS_INVALID)
        {
            TileMap.SetTileType(t, TileType.MP_STATION);
            TileMap.SetTileOwner(t, o);
            WaterMap.SetWaterClass(t, wc);
            Map._m[t].m2  = sid;
            Map._m[t].m3  = 0;
            Map._m[t].m4  = 0;
            Map._m[t].m5  = section;
            Map._me[t].m6 = BitMath.SB(Map._me[t].m6, 2, 1, 0);
            Map._me[t].m6 = BitMath.SB(Map._me[t].m6, 3, 3, st);
            Map._me[t].m7 = 0;
        }
Esempio n. 5
0
/**
 * Make the given tile an oilrig tile.
 * @param t the tile to make an oilrig
 * @param sid the station to which this tile belongs
 * @param wc the type of water on this tile
 */
        public static void MakeOilrig(this TileIndex t, StationID sid, WaterClass wc)
        {
            MakeStation(t, Owner.OWNER_NONE, sid, StationType.STATION_OILRIG, 0, wc);
        }
Esempio n. 6
0
/**
 * Make the given tile a dock tile.
 * @param t the tile to make a dock
 * @param o the owner of the dock
 * @param sid the station to which this tile belongs
 * @param d the direction of the dock
 * @param wc the type of water on this tile
 */
        public static void MakeDock(this TileIndex t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
        {
            MakeStation(t, o, sid, StationType.STATION_DOCK, d);
            MakeStation(t + Map.TileOffsByDiagDir(d), o, sid, StationType.STATION_DOCK,
                        GFX_DOCK_BASE_WATER_PART + d.DiagDirToAxis(), wc);
        }
Esempio n. 7
0
/**
 * Make the given tile an airport tile.
 * @param t the tile to make a airport
 * @param o the owner of the airport
 * @param sid the station to which this tile belongs
 * @param section the StationGfx to be used for this tile
 * @param wc the type of water on this tile
 */
        public static void MakeAirport(this TileIndex t, Owner o, StationID sid, byte section, WaterClass wc)
        {
            MakeStation(t, o, sid, StationType.STATION_AIRPORT, section, wc);
        }
Esempio n. 8
0
/**
 * Make the given tile a rail waypoint tile.
 * @param t the tile to make a rail waypoint
 * @param o the owner of the waypoint
 * @param sid the waypoint to which this tile belongs
 * @param a the axis of this tile
 * @param section the StationGfx to be used for this tile
 * @param rt the railtype of this tile
 */
        public static void MakeRailWaypoint(this TileIndex t, Owner o, StationID sid, Axis a, byte section, RailType rt)
        {
            MakeStation(t, o, sid, StationType.STATION_WAYPOINT, section + a);
            t.SetRailType(rt);
            SetRailStationReservation(t, false);
        }