Daily update on 20230413 by nitload youmu

This commit is contained in:
Nitload
2023-04-13 01:37:16 +08:00
parent 2e1b0fe351
commit de494a35e6
45 changed files with 294 additions and 206 deletions
+13 -2
View File
@@ -5,11 +5,22 @@ using System.Text;
namespace StgSharp
{
public interface INode<T> where T : INode<T>
public abstract class INode<T> where T : INode<T>
{
protected ContainerNode<T> _id;
internal ContainerNode<T> ID { get; }
internal void setID(ContainerNode<T> id);
internal void setID(ContainerNode<T> id)
{
if (_id!=null)
{
throw new ArgumentException("Cannot set ID twice");
}
else
{
_id = id;
}
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ using System.Text;
namespace StgSharp
{
public class Counter<T>where T:struct, IConvertible, IFormattable, IComparable
public class Counter<T> where T:struct, IConvertible, IFormattable, IComparable
{
internal readonly dynamic _defualtValue;
internal readonly dynamic _defualtAddValue;
-14
View File
@@ -35,8 +35,6 @@ namespace StgSharp
set { _tail = new ContainerNode<T>(value); }
}
ContainerNode<LinkedList<T>> INode<LinkedList<T>>.ID => _id;
public void Add(T t)
{
if (_first != default(ContainerNode<T>))
@@ -70,17 +68,5 @@ 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;
}
}
}
}
+4 -17
View File
@@ -13,9 +13,9 @@ namespace StgSharp
{
internal LinkedList<Point> pointContainer;
internal LinkedList<IGeometry> geometryContainer;
internal LinkedList<Entity> _bulletContainer;
internal LinkedList<Entity> _awardContainer;
internal LinkedList<Entity> _enemyContainer;
internal LinkedList<IEntity> _bulletContainer;
internal LinkedList<IEntity> _awardContainer;
internal LinkedList<IEntity> _enemyContainer;
internal Line leftBoader;
internal Line rightBoader;
@@ -45,9 +45,6 @@ namespace StgSharp
}
ContainerNode<Pool> INode<Pool>.ID => _id;
public void OnRender()
{
foreach (Enemy e in _enemyContainer)
@@ -56,17 +53,7 @@ namespace StgSharp
}
}
void INode<Pool>.setID(ContainerNode<Pool> id)
{
if (_id == default)
{
_id = id;
}
else
{
throw new ArgumentException("Cannot set ID twicee!");
}
}
}
}