private static bool add_corridor(Endpoint ep, bool follow) { if (MapBuilder.fCorridorTiles.Count == 0) { return(false); } int num = Session.Random.Next() % MapBuilder.fCorridorTiles.Count; Tile item = MapBuilder.fCorridorTiles[num]; if (ep != null) { Pair <TileData, Direction> pair = MapBuilder.add_tile(item, ep, follow, true); if (pair == null) { return(false); } MapBuilder.fEndpoints.Add(MapBuilder.get_endpoint(item, pair.First, pair.Second)); } else { TileData tileDatum = MapBuilder.add_first_tile(item); Direction startingDirection = MapBuilder.get_starting_direction(MapBuilder.get_orientation(item, tileDatum)); MapBuilder.fEndpoints.Add(MapBuilder.get_endpoint(item, tileDatum, startingDirection)); } return(true); }
private static bool add_stairway(Endpoint ep) { List <Tile> item = MapBuilder.fTiles[TileCategory.Stairway]; if (item.Count == 0) { return(false); } int num = Session.Random.Next() % item.Count; Tile tile = item[num]; if (ep == null) { TileData tileDatum = MapBuilder.add_first_tile(tile); Direction startingDirection = MapBuilder.get_starting_direction(MapBuilder.get_orientation(tile, tileDatum)); MapBuilder.fEndpoints.Add(MapBuilder.get_endpoint(tile, tileDatum, startingDirection)); } else if (MapBuilder.add_tile(tile, ep, true, true) == null) { return(false); } return(true); }