daily update on 20230120 by nitload youmu, struct of project fixed, math lib created

This commit is contained in:
Nitload
2023-01-20 00:45:19 +08:00
parent e9116ca11b
commit c14b7ae7f8
50 changed files with 202 additions and 159 deletions
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;
namespace StgSharp.Logic
namespace StgSharp
{
public class ContainerNode<T> where T : INode
{
@@ -11,6 +11,8 @@ namespace StgSharp.Logic
internal ContainerNode<T> _next;
internal ContainerNode<T> _side;
public virtual ContainerNode<T> Previous
{
get { return _previous; }
@@ -37,6 +39,7 @@ namespace StgSharp.Logic
public ContainerNode(T t)
{
_this = t;
t.setID<T>(this);
}
}
}
+1 -1
View File
@@ -3,7 +3,7 @@ using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp.Logic
namespace StgSharp
{
public class Counter<T>where T:struct, IConvertible, IFormattable, IComparable
{
+1 -1
View File
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;
namespace StgSharp.Logic
namespace StgSharp
{
public class Dictionary<T> where T : Enum ,INode
{
+3 -2
View File
@@ -2,11 +2,12 @@
using System.Collections.Generic;
using System.Text;
namespace StgSharp.Logic
namespace StgSharp
{
public interface INode
{
internal ContainerNode<INode> ID { get; }
internal void setID<T>(ContainerNode<T> id) where T:INode;
}
}
+7 -7
View File
@@ -2,19 +2,19 @@
using System.Collections.Generic;
using System.Text;
namespace StgSharp.Logic
namespace StgSharp
{
public class LinkedList<T> where T: INode
{
internal ContainerNode<T> _head;
internal ContainerNode<T> _first;
internal ContainerNode<T> _tail;
private ContainerNode<T> _cache;
public T Head
public T First
{
get { return _head._this; }
set { _head = new ContainerNode<T>(value); }
get { return _first._this; }
set { _first = new ContainerNode<T>(value); }
}
public T Tail
@@ -26,9 +26,9 @@ namespace StgSharp.Logic
public void Add(T t)
{
if (_head != default(ContainerNode<T>))
if (_first != default(ContainerNode<T>))
{
Head = t;
First = t;
}
else
{
+6 -8
View File
@@ -1,17 +1,15 @@
using StgSharp.Control;
using StgSharp.Geometries;
using StgSharp.Logic;
using StgSharp;
using System;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Text;
namespace StgSharp.Logic
namespace StgSharp
{
public class Pool
{
public LinkedList<Point> pointContainer;
public LinkedList<IGeometrySimple> geometryContainer;
public LinkedList<IGeometry> geometryContainer;
public LinkedList<Sensor> sensorContainer;
public Line leftBoader;
@@ -22,13 +20,13 @@ namespace StgSharp.Logic
public void OnRender()
{
ContainerNode<Point> idCache = pointContainer._head;
ContainerNode<Point> idCache = pointContainer._first;
Point p;
do
{
p = idCache._this;
p._x = p.getXHandler.Invoke(TimeLine.tickCounter);
p._y = p.getYHandler.Invoke(TimeLine.tickCounter);
p._x = p.getXHandler.Invoke(Control.TimeLine.tickCounter);
p._y = p.getYHandler.Invoke(Control.TimeLine.tickCounter);
idCache = idCache._next;
} while (idCache != default(ContainerNode<Point>));
+17 -3
View File
@@ -2,13 +2,27 @@
using System.Collections.Generic;
using System.Text;
namespace StgSharp.Logic
namespace StgSharp
{
public class Sensor : INode
{
private ContainerNode<Sensor> _id;
private ContainerNode<INode> _id;
ContainerNode<INode> INode.ID
{
get { return _id; }
}
void INode.setID<T>(ContainerNode<T> id)
{
if (id == null)
{
_id = id as ContainerNode<INode>;
}
else
{
throw new ArgumentNullException("Cannot set id teice!");
}
}
}
}