public void ConnectEdgeWalls(GeneratingTileInfo other, Direction directionToOther) { var edges = this.edgeWalls[directionToOther]; var otherEdges = other.edgeWalls[directionToOther.Opposite()]; edges.ConnectWalls(otherEdges); }
public static bool OpenTileWall(this Tile <GeneratingTileInfo> tile, Direction direction, float width) { var other = tile.Neighbour(direction); if (!other.IsValid) { return(false); } var info = tile.Info; var info2 = other.Info; var oppositeDir = direction.Opposite(); info.OpenSides = info.OpenSides.And(direction); info2.OpenSides = info2.OpenSides.And(oppositeDir); info.CorridorWidths[(int)direction] = width; info2.CorridorWidths[(int)oppositeDir] = width; return(true); }