daily update on 20230329 by nitload youmu

This commit is contained in:
Nitload
2023-03-29 00:51:31 +08:00
parent eedab82f6e
commit 8641b24206
33 changed files with 195 additions and 106 deletions
+15 -2
View File
@@ -6,12 +6,12 @@ using System.Text;
namespace StgSharp
{
public class LinkedList<T>:IEnumerable where T: INode<T>
public class LinkedList<T>:IEnumerable,INode<LinkedList<T>> where T: INode<T>
{
internal readonly ContainerNode<T> _heading;
internal ContainerNode<T> _first;
internal ContainerNode<T> _tail;
private ContainerNode<LinkedList<T>> _id;
private ContainerNode<T> _cache;
public LinkedList()
@@ -35,6 +35,7 @@ namespace StgSharp
set { _tail = new ContainerNode<T>(value); }
}
ContainerNode<LinkedList<T>> INode<LinkedList<T>>.ID => _id;
public void Add(T t)
{
@@ -69,5 +70,17 @@ namespace StgSharp
{
return new LinkedListEnumrator<T>(this);
}
void INode<LinkedList<T>>.setID(ContainerNode<LinkedList<T>> id)
{
if (_id == null)
{
throw new ArgumentException("Cannot set ID twice");
}
else
{
_id = id;
}
}
}
}