/** * Make a bridge ramp for roads. * @param t the tile to make a bridge ramp * @param o the new owner of the bridge ramp * @param owner_road the new owner of the road on the bridge * @param owner_tram the new owner of the tram on the bridge * @param bridgetype the type of bridge this bridge ramp belongs to * @param d the direction this ramp must be facing * @param r the road type of the bridge */ public static void MakeRoadBridgeRamp(TileIndex t, Owner o, Owner owner_road, Owner owner_tram, BridgeType bridgetype, DiagDirection d, RoadTypes r) { MakeBridgeRamp(t, o, bridgetype, d, TransportType.TRANSPORT_ROAD, 0); SetRoadOwner(t, RoadType.ROADTYPE_ROAD, owner_road); if (owner_tram != Owner.OWNER_TOWN) { SetRoadOwner(t, RoadType.ROADTYPE_TRAM, owner_tram); } SetRoadTypes(t, r); }
/** * Generic part to make a bridge ramp for both roads and rails. * @param t the tile to make a bridge ramp * @param o the new owner of the bridge ramp * @param bridgetype the type of bridge this bridge ramp belongs to * @param d the direction this ramp must be facing * @param tt the transport type of the bridge * @param rt the road or rail type * @note this function should not be called directly. */ public static void MakeBridgeRamp(TileIndex t, Owner o, BridgeType bridgetype, DiagDirection d, TransportType tt, RailType rt) { TileMap.SetTileType(t, TileType.MP_TUNNELBRIDGE); TileMap.SetTileOwner(t, o); Map._m[t].m2 = 0; Map._m[t].m3 = (byte)rt; Map._m[t].m4 = 0; Map._m[t].m5 = (byte)(1 << 7 | (byte)tt << 2 | (byte)d); BitMath.SB(ref Map._me[t].m6, 2, 4, bridgetype); Map._me[t].m7 = 0; }
/** * Make a bridge ramp for rails. * @param t the tile to make a bridge ramp * @param o the new owner of the bridge ramp * @param bridgetype the type of bridge this bridge ramp belongs to * @param d the direction this ramp must be facing * @param r the rail type of the bridge */ public static void MakeRailBridgeRamp(TileIndex t, Owner o, BridgeType bridgetype, DiagDirection d, RailType r) { MakeBridgeRamp(t, o, bridgetype, d, TransportType.TRANSPORT_RAIL, r); }
CommandCost CheckBridgeAvailability(BridgeType bridge_type, uint bridge_len, DoCommandFlag flags = DC_NONE) => throw new NotImplementedException();
/** * Get the specification of a bridge type. * @param i The type of bridge to get the specification for. * @return The specification. */ //inline public static BridgeSpec GetBridgeSpec(BridgeType i) { Debug.Assert(i < _bridge.Length); return(_bridge[i]); }