Skip to content

Commit b8419d3

Browse files
author
Oren (electricessence)
committed
Added IElement interface.
This is for the conviencnce of constraining nodes that won't have children.
1 parent 273add9 commit b8419d3

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

IElement.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using System;
2+
namespace Open.Hierarchy
3+
{
4+
public interface IElement<T>
5+
{
6+
T Value { get; set; }
7+
}
8+
}

Node.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Open.Hierarchy
88
{
9-
public sealed partial class Node<T> : INode<Node<T>>
9+
public sealed partial class Node<T> : INode<Node<T>>, IElement<T>
1010
{
1111
public Node<T>? Parent { get; private set; }
1212
object? IChild.Parent => Parent;

0 commit comments

Comments
 (0)