public static void MakeRailDepot(this TileIndex t, Owner o, DepotID did, DiagDirection d, RailType r) { TileMap.SetTileType(t, TileType.MP_RAILWAY); TileMap.SetTileOwner(t, o); Map._m[t].m2 = did; Map._m[t].m3 = (byte)r; Map._m[t].m4 = 0; Map._m[t].m5 = (byte)((int)RailTileType.RAIL_TILE_DEPOT << 6 | (int)d); BitMath.SB(Map._me[t].m6, 2, 4, 0); Map._me[t].m7 = 0; }
/** * Make a road depot. * @param t Tile to make a level crossing. * @param owner New owner of the depot. * @param did New depot ID. * @param dir Direction of the depot exit. * @param rt Road type of the depot. */ public static void MakeRoadDepot(this TileIndex t, Owner owner, DepotID did, DiagDirection dir, RoadType rt) { TileMap.SetTileType(t, TileType.MP_ROAD); TileMap.SetTileOwner(t, owner); Map._m[t].m2 = did; Map._m[t].m3 = 0; Map._m[t].m4 = 0; Map._m[t].m5 = RoadTileType.ROAD_TILE_DEPOT << 6 | dir; Map._me[t].m6 = BitMath.SB(Map._me[t].m6, 2, 4, 0); Map._me[t].m7 = RoadTypeToRoadTypes(rt) << 6 | owner; SetRoadOwner(t, RoadType.ROADTYPE_TRAM, owner); }
/** * Make a ship depot section. * @param t Tile to place the ship depot section. * @param o Owner of the depot. * @param did Depot ID. * @param part Depot part (either #DEPOT_PART_NORTH or #DEPOT_PART_SOUTH). * @param a Axis of the depot. * @param original_water_class Original water class. */ /*inline*/ public static void MakeShipDepot(TileIndex t, Owner o, DepotID did, DepotPart part, Axis a, WaterClass original_water_class) { TileMap.SetTileType(t, TileType.MP_WATER); TileMap.SetTileOwner(t, o); SetWaterClass(t, original_water_class); Map._m[t].m2 = did; Map._m[t].m3 = 0; Map._m[t].m4 = 0; Map._m[t].m5 = (byte) ((int)WaterTileTypeBitLayout.WBL_TYPE_DEPOT << (int)WaterTileTypeBitLayout.WBL_TYPE_BEGIN | (int)part << (int)WaterTileTypeBitLayout.WBL_DEPOT_PART | (int)a << (int)WaterTileTypeBitLayout.WBL_DEPOT_AXIS); BitMath.SB(ref Map._me[t].m6, 2, 4, 0); Map._me[t].m7 = 0; }