daily update on 20230320 by nitload youmu
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user