daily update on 20230104 by nitload youmu
This commit is contained in:
@@ -8,7 +8,7 @@ namespace StgSharp.Entities
|
||||
{
|
||||
public interface IEntity
|
||||
{
|
||||
public IGeometry CollisionShape { get; set; }
|
||||
public Geometry CollisionShape { get; set; }
|
||||
|
||||
public Sensor CollisionSensor { get; set; }
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using StgSharp.Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public interface IGeometry
|
||||
public class Geometry:INode
|
||||
{
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using StgSharp.Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
internal class Line:IGeometry
|
||||
public class Line:Geometry,INode
|
||||
{
|
||||
|
||||
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
using GLFWDotNet;
|
||||
using StgSharp.Control;
|
||||
using StgSharp.Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public class Point
|
||||
public class Point: INode
|
||||
{
|
||||
public float x;
|
||||
public float y;
|
||||
|
||||
internal float x;
|
||||
internal float y;
|
||||
|
||||
public float X
|
||||
{
|
||||
@@ -19,8 +22,18 @@ namespace StgSharp.Geometries
|
||||
return getXHandler(TimeLine.tickCounter);
|
||||
}
|
||||
}
|
||||
public float Y
|
||||
{
|
||||
get
|
||||
{
|
||||
return getYHandler(TimeLine.tickCounter);
|
||||
}
|
||||
}
|
||||
|
||||
public GetLocationHandler getXHandler;
|
||||
public GetLocationHandler getYHandler;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Logic
|
||||
{
|
||||
public interface INode
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,57 @@ using System.Text;
|
||||
|
||||
namespace StgSharp.Logic
|
||||
{
|
||||
public class LinkedList<T> where T:
|
||||
public class LinkedList<T> where T: INode
|
||||
{
|
||||
private LinkedListNode<T> _head;
|
||||
private LinkedListNode<T> _tail;
|
||||
|
||||
private LinkedListNode<T> _cache;
|
||||
|
||||
public T Head
|
||||
{
|
||||
get { return _head._this; }
|
||||
set { _head = new LinkedListNode<T>(value); }
|
||||
}
|
||||
|
||||
public T Tail
|
||||
{
|
||||
get { return _tail._this; }
|
||||
set { _tail = new LinkedListNode<T>(value); }
|
||||
}
|
||||
|
||||
|
||||
public void Add(T t)
|
||||
{
|
||||
if (_head != default(LinkedListNode<T>))
|
||||
{
|
||||
Head = t;
|
||||
}
|
||||
else
|
||||
{
|
||||
_cache = new LinkedListNode<T>(t);
|
||||
_tail._next = _cache;
|
||||
_cache._previous = _tail;
|
||||
_tail = _cache;
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveTail()
|
||||
{
|
||||
if (_tail==default(LinkedListNode<T>))
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_cache = _tail;
|
||||
_tail = _cache._previous;
|
||||
_cache._previous = default(LinkedListNode<T>);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Logic
|
||||
{
|
||||
internal class LinkedListNode<T> where T : INode
|
||||
{
|
||||
internal readonly T _this;
|
||||
internal LinkedListNode<T> _previous;
|
||||
internal LinkedListNode<T> _next;
|
||||
|
||||
public virtual LinkedListNode<T> Previous
|
||||
{
|
||||
get { return _previous; }
|
||||
set { _previous = value; }
|
||||
}
|
||||
|
||||
public LinkedListNode<T> Next
|
||||
{
|
||||
get { return _next; }
|
||||
set { _next = value; }
|
||||
}
|
||||
|
||||
public LinkedListNode(T t)
|
||||
{
|
||||
_this = t;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Logic
|
||||
{
|
||||
public class LinkedObject
|
||||
{
|
||||
internal LinkedObject _previous;
|
||||
internal LinkedObject _next;
|
||||
|
||||
public LinkedObject Previous
|
||||
{
|
||||
get { return _previous; }
|
||||
set { _previous = value; }
|
||||
}
|
||||
|
||||
public LinkedObject Next
|
||||
{
|
||||
get { return _next; }
|
||||
set { _next = value; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using StgSharp.Geometries;
|
||||
using StgSharp.Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
@@ -6,6 +8,14 @@ namespace StgSharp.Logic
|
||||
{
|
||||
public class Pool
|
||||
{
|
||||
public LinkedList<Point> pointContainer;
|
||||
public LinkedList<Geometry> geometryContainer;
|
||||
|
||||
public Line leftBoader;
|
||||
public Line rightBoader;
|
||||
public Line topBoader;
|
||||
public Line bottomBoader;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user