Skip to content

Commit

Permalink
Forest adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeah69 committed Nov 8, 2020
1 parent a8b3976 commit 1432d88
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions MrMeeseeks/DataStructures/Forest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@ namespace MrMeeseeks.DataStructures
{
public class Forest<T> : TreeBase<T>
{
public static Forest<T> CreateFromTrees(IReadOnlyList<Tree<T>> trees) =>
new Forest<T>(trees);

public IReadOnlyList<Tree<T>> Trees { get; }

public Forest()
{
Trees = Children.ToReadOnlyList();
}

private Forest(IReadOnlyList<Tree<T>> trees)
{
Trees = trees;
}

public Forest<TResult> Select<TResult>(Func<T, IEnumerable<TResult>, TResult> resultSelector)
{
var forest = new Forest<TResult>();
Expand Down

0 comments on commit 1432d88

Please sign in to comment.