diff --git a/源代码/.Net/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 b/源代码/.Net/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 index f57961da..985ced76 100644 Binary files a/源代码/.Net/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 and b/源代码/.Net/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 differ diff --git a/源代码/.Net/.vs/ProjectEvaluation/stgsharp.projects.v5.1 b/源代码/.Net/.vs/ProjectEvaluation/stgsharp.projects.v5.1 index 9b61b25a..4d940651 100644 Binary files a/源代码/.Net/.vs/ProjectEvaluation/stgsharp.projects.v5.1 and b/源代码/.Net/.vs/ProjectEvaluation/stgsharp.projects.v5.1 differ diff --git a/源代码/.Net/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 b/源代码/.Net/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 index 2ff2a754..6d6cec11 100644 Binary files a/源代码/.Net/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 and b/源代码/.Net/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 differ diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/3427851d-bb85-4067-9d05-16b999850d69.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/3427851d-bb85-4067-9d05-16b999850d69.vsidx deleted file mode 100644 index 7089875f..00000000 Binary files a/源代码/.Net/.vs/StgSharp/FileContentIndex/3427851d-bb85-4067-9d05-16b999850d69.vsidx and /dev/null differ diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/3cf199c0-21e7-4832-a1f0-0b59c23c806a.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/3cf199c0-21e7-4832-a1f0-0b59c23c806a.vsidx new file mode 100644 index 00000000..923d4982 Binary files /dev/null and b/源代码/.Net/.vs/StgSharp/FileContentIndex/3cf199c0-21e7-4832-a1f0-0b59c23c806a.vsidx differ diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/5827c9b3-f906-4171-97d3-fe981c49200b.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/5827c9b3-f906-4171-97d3-fe981c49200b.vsidx deleted file mode 100644 index 632c1cb4..00000000 Binary files a/源代码/.Net/.vs/StgSharp/FileContentIndex/5827c9b3-f906-4171-97d3-fe981c49200b.vsidx and /dev/null differ diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/8ea92006-8aef-498e-89a9-923bff14f2a7.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/8ea92006-8aef-498e-89a9-923bff14f2a7.vsidx new file mode 100644 index 00000000..142827d2 Binary files /dev/null and b/源代码/.Net/.vs/StgSharp/FileContentIndex/8ea92006-8aef-498e-89a9-923bff14f2a7.vsidx differ diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/93a07191-5cd0-4d5c-ab08-23d1b3fd6771.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/93a07191-5cd0-4d5c-ab08-23d1b3fd6771.vsidx new file mode 100644 index 00000000..db768bc6 Binary files /dev/null and b/源代码/.Net/.vs/StgSharp/FileContentIndex/93a07191-5cd0-4d5c-ab08-23d1b3fd6771.vsidx differ diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/ed45ff66-6b26-4cd1-9976-57033713d5a5.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/ed45ff66-6b26-4cd1-9976-57033713d5a5.vsidx deleted file mode 100644 index 2b591ea4..00000000 Binary files a/源代码/.Net/.vs/StgSharp/FileContentIndex/ed45ff66-6b26-4cd1-9976-57033713d5a5.vsidx and /dev/null differ diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/f0a2d2d1-435d-4cd9-9bc7-f9ef0656156e.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/f0a2d2d1-435d-4cd9-9bc7-f9ef0656156e.vsidx new file mode 100644 index 00000000..5da366a8 Binary files /dev/null and b/源代码/.Net/.vs/StgSharp/FileContentIndex/f0a2d2d1-435d-4cd9-9bc7-f9ef0656156e.vsidx differ diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/f1643188-5845-45e6-b42e-44af5ba3be6f.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/f1643188-5845-45e6-b42e-44af5ba3be6f.vsidx deleted file mode 100644 index 4c41251f..00000000 Binary files a/源代码/.Net/.vs/StgSharp/FileContentIndex/f1643188-5845-45e6-b42e-44af5ba3be6f.vsidx and /dev/null differ diff --git a/源代码/.Net/.vs/StgSharp/v17/.futdcache.v2 b/源代码/.Net/.vs/StgSharp/v17/.futdcache.v2 index dfbfdc68..345aff30 100644 Binary files a/源代码/.Net/.vs/StgSharp/v17/.futdcache.v2 and b/源代码/.Net/.vs/StgSharp/v17/.futdcache.v2 differ diff --git a/源代码/.Net/.vs/StgSharp/v17/.suo b/源代码/.Net/.vs/StgSharp/v17/.suo index 94e8a2fc..200404a0 100644 Binary files a/源代码/.Net/.vs/StgSharp/v17/.suo and b/源代码/.Net/.vs/StgSharp/v17/.suo differ diff --git a/源代码/.Net/StgSharp/Control/Add.cs b/源代码/.Net/StgSharp/Control/Add.cs new file mode 100644 index 00000000..5c280216 --- /dev/null +++ b/源代码/.Net/StgSharp/Control/Add.cs @@ -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); + } + } +} diff --git a/源代码/.Net/StgSharp/Control/Remove.cs b/源代码/.Net/StgSharp/Control/Remove.cs new file mode 100644 index 00000000..95b22083 --- /dev/null +++ b/源代码/.Net/StgSharp/Control/Remove.cs @@ -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 _cache = p.ID; + _cache.Previous.Next=_cache.Next; + _cache.Next.Previous = _cache.Previous; + _cache.Next = default(Logic.LinkedListNode); + _cache.Previous = default(Logic.LinkedListNode); + } + } +} diff --git a/源代码/.Net/StgSharp/Control/TimeLine.cs b/源代码/.Net/StgSharp/Control/TimeLine.cs index eda52b37..a0c71de6 100644 --- a/源代码/.Net/StgSharp/Control/TimeLine.cs +++ b/源代码/.Net/StgSharp/Control/TimeLine.cs @@ -7,9 +7,11 @@ namespace StgSharp.Control { public static class TimeLine { + public static Pool _cache; public static Counter tickCounter = new Counter(0,1,1); + } } diff --git a/源代码/.Net/StgSharp/Entities/IEntity.cs b/源代码/.Net/StgSharp/Entities/IEntity.cs index 06a34e0e..15ed7402 100644 --- a/源代码/.Net/StgSharp/Entities/IEntity.cs +++ b/源代码/.Net/StgSharp/Entities/IEntity.cs @@ -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; } diff --git a/源代码/.Net/StgSharp/Geometries/Circle.cs b/源代码/.Net/StgSharp/Geometries/Circle.cs new file mode 100644 index 00000000..e78a6fcf --- /dev/null +++ b/源代码/.Net/StgSharp/Geometries/Circle.cs @@ -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 _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 ID + { + get { return _id; } + } + + float IGeometry.SetPointArray(Counter tickCounter) + { + throw new NotImplementedException(); + } + } +} diff --git a/源代码/.Net/StgSharp/Geometries/Class1.cs b/源代码/.Net/StgSharp/Geometries/GetLocationHandler.cs similarity index 100% rename from 源代码/.Net/StgSharp/Geometries/Class1.cs rename to 源代码/.Net/StgSharp/Geometries/GetLocationHandler.cs diff --git a/源代码/.Net/StgSharp/Geometries/IGeometry.cs b/源代码/.Net/StgSharp/Geometries/IGeometry.cs new file mode 100644 index 00000000..5de4d2ce --- /dev/null +++ b/源代码/.Net/StgSharp/Geometries/IGeometry.cs @@ -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 tickCounter); + } +} diff --git a/源代码/.Net/StgSharp/Geometries/Line.cs b/源代码/.Net/StgSharp/Geometries/Line.cs index 3b33e8ee..613c0b40 100644 --- a/源代码/.Net/StgSharp/Geometries/Line.cs +++ b/源代码/.Net/StgSharp/Geometries/Line.cs @@ -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 _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 ID + { + get { return _id; } + } + + public float SetPointArray(Counter tickCounter) + { + return 0.0f; + } + + + } } diff --git a/源代码/.Net/StgSharp/Geometries/Geometry.cs b/源代码/.Net/StgSharp/Geometries/Rectangle.cs similarity index 55% rename from 源代码/.Net/StgSharp/Geometries/Geometry.cs rename to 源代码/.Net/StgSharp/Geometries/Rectangle.cs index 4bbf951f..c4555f78 100644 --- a/源代码/.Net/StgSharp/Geometries/Geometry.cs +++ b/源代码/.Net/StgSharp/Geometries/Rectangle.cs @@ -5,15 +5,10 @@ using System.Text; namespace StgSharp.Geometries { - public class Geometry:INode - { + public class Rectangle + { - public void SetPointArray() - { - - } - } } diff --git a/源代码/.Net/StgSharp/Geometries/Square.cs b/源代码/.Net/StgSharp/Geometries/Square.cs new file mode 100644 index 00000000..b7517ba2 --- /dev/null +++ b/源代码/.Net/StgSharp/Geometries/Square.cs @@ -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; } + } + } +} diff --git a/源代码/.Net/StgSharp/Geometries/point.cs b/源代码/.Net/StgSharp/Geometries/point.cs index b039c43d..e5146644 100644 --- a/源代码/.Net/StgSharp/Geometries/point.cs +++ b/源代码/.Net/StgSharp/Geometries/point.cs @@ -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 _id; internal float x; internal float y; + public Logic.LinkedListNode ID + { + get { return _id; } + } + public float X { get diff --git a/源代码/.Net/StgSharp/Logic/INode.cs b/源代码/.Net/StgSharp/Logic/INode.cs index fa562f65..3cda1719 100644 --- a/源代码/.Net/StgSharp/Logic/INode.cs +++ b/源代码/.Net/StgSharp/Logic/INode.cs @@ -6,6 +6,9 @@ namespace StgSharp.Logic { public interface INode { - + public LinkedListNode ID + { + get ; + } } } diff --git a/源代码/.Net/StgSharp/Logic/LinkedListNode.cs b/源代码/.Net/StgSharp/Logic/LinkedListNode.cs index 5a0aaa58..e8e471af 100644 --- a/源代码/.Net/StgSharp/Logic/LinkedListNode.cs +++ b/源代码/.Net/StgSharp/Logic/LinkedListNode.cs @@ -4,7 +4,7 @@ using System.Text; namespace StgSharp.Logic { - internal class LinkedListNode where T : INode + public class LinkedListNode where T : INode { internal readonly T _this; internal LinkedListNode _previous; diff --git a/源代码/.Net/StgSharp/Logic/Pool.cs b/源代码/.Net/StgSharp/Logic/Pool.cs index 92b64db3..b0d436df 100644 --- a/源代码/.Net/StgSharp/Logic/Pool.cs +++ b/源代码/.Net/StgSharp/Logic/Pool.cs @@ -9,7 +9,11 @@ namespace StgSharp.Logic public class Pool { public LinkedList pointContainer; - public LinkedList geometryContainer; + public LinkedList geometryContainer; + public LinkedList sensorContainer; + + + public Line leftBoader; public Line rightBoader; diff --git a/源代码/.Net/StgSharp/Logic/Sensor.cs b/源代码/.Net/StgSharp/Logic/Sensor.cs index 19f7a87e..0bf0ed00 100644 --- a/源代码/.Net/StgSharp/Logic/Sensor.cs +++ b/源代码/.Net/StgSharp/Logic/Sensor.cs @@ -4,8 +4,13 @@ using System.Text; namespace StgSharp.Logic { - public class Sensor + public class Sensor : INode { + private LinkedListNode _id; + LinkedListNode INode.ID + { + get { return _id; } + } } } diff --git a/源代码/.Net/StgSharpDebug/Program.cs b/源代码/.Net/StgSharpDebug/Program.cs index 49acdbd4..e536f2f7 100644 --- a/源代码/.Net/StgSharpDebug/Program.cs +++ b/源代码/.Net/StgSharpDebug/Program.cs @@ -1,4 +1,5 @@ using StgSharp; +using StgSharp.Geometries; using StgSharp.Logic; using System;