daily update on 20230105 by nitload youmu
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using GLFWDotNet;
|
||||
using StgSharp.Geometries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Control
|
||||
{
|
||||
public static class Add
|
||||
{
|
||||
public static void Point(IGeometry geometry)
|
||||
{
|
||||
Point p = new Point();
|
||||
p.getXHandler+=geometry.SetPointArray;
|
||||
TimeLine._cache.pointContainer.Add(p);
|
||||
}
|
||||
|
||||
public static void Line(Point p, float vecX,float vecY)
|
||||
{
|
||||
Line l = new Line
|
||||
{
|
||||
endpoint = p,
|
||||
vecX = vecX,
|
||||
vecY = vecY
|
||||
};
|
||||
TimeLine._cache.geometryContainer.Add(l);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using StgSharp.Logic;
|
||||
using StgSharp.Geometries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Control
|
||||
{
|
||||
public static class Remove
|
||||
{
|
||||
public static void Point(Point p)
|
||||
{
|
||||
Logic.LinkedListNode<INode> _cache = p.ID;
|
||||
_cache.Previous.Next=_cache.Next;
|
||||
_cache.Next.Previous = _cache.Previous;
|
||||
_cache.Next = default(Logic.LinkedListNode<INode>);
|
||||
_cache.Previous = default(Logic.LinkedListNode<INode>);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,11 @@ namespace StgSharp.Control
|
||||
{
|
||||
public static class TimeLine
|
||||
{
|
||||
public static Pool _cache;
|
||||
|
||||
public static Counter<uint> tickCounter
|
||||
= new Counter<uint>(0,1,1);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ using System.Text;
|
||||
|
||||
namespace StgSharp.Entities
|
||||
{
|
||||
public interface IEntity
|
||||
public interface IEntity:INode
|
||||
{
|
||||
public Geometry CollisionShape { get; set; }
|
||||
public IGeometry CollisionShape { get; set; }
|
||||
|
||||
public Sensor CollisionSensor { get; set; }
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
using StgSharp.Logic;
|
||||
using StgSharp.Geometries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public class Circle : IGeometry
|
||||
{
|
||||
private Logic.LinkedListNode<INode> _id;
|
||||
internal Point _referencePoint;
|
||||
internal float _vecX;
|
||||
internal float _vecY;
|
||||
|
||||
public Point ReferencePoint
|
||||
{
|
||||
get { return _referencePoint; }
|
||||
}
|
||||
|
||||
public float vecX
|
||||
{
|
||||
get { return _vecX; }
|
||||
}
|
||||
|
||||
public float vecY
|
||||
{
|
||||
get { return _vecY; }
|
||||
}
|
||||
|
||||
public Logic.LinkedListNode<INode> ID
|
||||
{
|
||||
get { return _id; }
|
||||
}
|
||||
|
||||
float IGeometry.SetPointArray(Counter<uint> tickCounter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using StgSharp.Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
|
||||
|
||||
public interface IGeometry:INode
|
||||
{
|
||||
public Point ReferencePoint
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public float vecX
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public float SetPointArray(Counter<uint> tickCounter);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,44 @@
|
||||
using StgSharp.Logic;
|
||||
using StgSharp.Control;
|
||||
using StgSharp.Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public class Line:Geometry,INode
|
||||
public class Line:IGeometry
|
||||
{
|
||||
private Logic.LinkedListNode<INode> _id;
|
||||
internal Point _referencePoint;
|
||||
internal float _vecX;
|
||||
internal float _vecY;
|
||||
|
||||
|
||||
public void SetPointArray()
|
||||
public Point ReferencePoint
|
||||
{
|
||||
|
||||
get { return _referencePoint; }
|
||||
}
|
||||
|
||||
public float vecX
|
||||
{
|
||||
get { return _vecX; }
|
||||
}
|
||||
|
||||
internal float vecY
|
||||
{
|
||||
get { return _vecY; }
|
||||
}
|
||||
|
||||
public Logic.LinkedListNode<INode> ID
|
||||
{
|
||||
get { return _id; }
|
||||
}
|
||||
|
||||
public float SetPointArray(Counter<uint> tickCounter)
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+2
-7
@@ -5,15 +5,10 @@ using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public class Geometry:INode
|
||||
{
|
||||
public class Rectangle
|
||||
{
|
||||
|
||||
|
||||
public void SetPointArray()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public class Square:IGeometry
|
||||
{
|
||||
internal Point _referrencePoint;
|
||||
|
||||
public Point ReferrencePoint
|
||||
{
|
||||
get { return _referrencePoint; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using StgSharp.Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
|
||||
@@ -11,10 +12,16 @@ namespace StgSharp.Geometries
|
||||
{
|
||||
public class Point: INode
|
||||
{
|
||||
private Logic.LinkedListNode<INode> _id;
|
||||
|
||||
internal float x;
|
||||
internal float y;
|
||||
|
||||
public Logic.LinkedListNode<INode> ID
|
||||
{
|
||||
get { return _id; }
|
||||
}
|
||||
|
||||
public float X
|
||||
{
|
||||
get
|
||||
|
||||
@@ -6,6 +6,9 @@ namespace StgSharp.Logic
|
||||
{
|
||||
public interface INode
|
||||
{
|
||||
|
||||
public LinkedListNode<INode> ID
|
||||
{
|
||||
get ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Text;
|
||||
|
||||
namespace StgSharp.Logic
|
||||
{
|
||||
internal class LinkedListNode<T> where T : INode
|
||||
public class LinkedListNode<T> where T : INode
|
||||
{
|
||||
internal readonly T _this;
|
||||
internal LinkedListNode<T> _previous;
|
||||
|
||||
@@ -9,7 +9,11 @@ namespace StgSharp.Logic
|
||||
public class Pool
|
||||
{
|
||||
public LinkedList<Point> pointContainer;
|
||||
public LinkedList<Geometry> geometryContainer;
|
||||
public LinkedList<IGeometry> geometryContainer;
|
||||
public LinkedList<Sensor> sensorContainer;
|
||||
|
||||
|
||||
|
||||
|
||||
public Line leftBoader;
|
||||
public Line rightBoader;
|
||||
|
||||
@@ -4,8 +4,13 @@ using System.Text;
|
||||
|
||||
namespace StgSharp.Logic
|
||||
{
|
||||
public class Sensor
|
||||
public class Sensor : INode
|
||||
{
|
||||
private LinkedListNode<INode> _id;
|
||||
|
||||
LinkedListNode<INode> INode.ID
|
||||
{
|
||||
get { return _id; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user