/** * 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); }
/** * Make a water lock. * @param t Tile to place the water lock section. * @param o Owner of the lock. * @param d Direction of the water lock. * @param wc_lower Original water class of the lower part. * @param wc_upper Original water class of the upper part. * @param wc_middle Original water class of the middle part. */ /*inline*/ public static void MakeLock(TileIndex t, Owner o, DiagDirection d, WaterClass wc_lower, WaterClass wc_upper, WaterClass wc_middle) { TileIndexDiff delta = Map.TileOffsByDiagDir(d); /* Keep the current waterclass and owner for the tiles. * It allows to restore them after the lock is deleted */ MakeLockTile(t, o, LockPart.LOCK_PART_MIDDLE, d, wc_middle); MakeLockTile((uint)(t - delta), IsWaterTile((uint)(t - delta)) ? TileMap.GetTileOwner((uint)(t - delta)) : o, LockPart.LOCK_PART_LOWER, d, wc_lower); MakeLockTile((uint)(t + delta), IsWaterTile((uint)(t + delta)) ? TileMap.GetTileOwner((uint)(t + delta)) : o, LockPart.LOCK_PART_UPPER, d, wc_upper); }