daily update on 20230320 by nitload youmu

This commit is contained in:
Nitload
2023-03-20 01:45:49 +08:00
parent 167e33a3dd
commit db2ca36fd7
100 changed files with 1211 additions and 746 deletions
+21 -8
View File
@@ -1,25 +1,37 @@
using System;
using StgSharp.Logic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
namespace StgSharp
{
public class LinkedList<T> where T: INode
public class LinkedList<T>:IEnumerable where T: INode
{
internal readonly ContainerNode<T> _heading;
internal ContainerNode<T> _first;
internal ContainerNode<T> _tail;
private ContainerNode<T> _cache;
public LinkedList()
{
_heading = new ContainerNode<T>(default(T));
}
public T First
{
get { return _first._this; }
set { _first = new ContainerNode<T>(value); }
get { return _first._value; }
set
{
_first = new ContainerNode<T>(value);
_heading._next = _first;
}
}
public T Tail
{
get { return _tail._this; }
get { return _tail._value; }
set { _tail = new ContainerNode<T>(value); }
}
@@ -53,8 +65,9 @@ namespace StgSharp
}
}
IEnumerator IEnumerable.GetEnumerator()
{
return new LinkedListEnumrator<T>(this);
}
}
}