diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/20b583c6-561d-47c9-abd3-60cfdfd314d1.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/20b583c6-561d-47c9-abd3-60cfdfd314d1.vsidx new file mode 100644 index 00000000..9bd1696c Binary files /dev/null and b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/20b583c6-561d-47c9-abd3-60cfdfd314d1.vsidx differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/40130cdf-f93d-4097-8cf2-c07e1598b0d7.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/40130cdf-f93d-4097-8cf2-c07e1598b0d7.vsidx new file mode 100644 index 00000000..6d2872fe Binary files /dev/null and b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/40130cdf-f93d-4097-8cf2-c07e1598b0d7.vsidx differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/5be5b462-1a57-402f-a15d-82b87f7c09fc.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/5be5b462-1a57-402f-a15d-82b87f7c09fc.vsidx deleted file mode 100644 index c7787de9..00000000 Binary files a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/5be5b462-1a57-402f-a15d-82b87f7c09fc.vsidx and /dev/null differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/92ba690c-5f44-444d-bb81-4379c01f4547.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/92ba690c-5f44-444d-bb81-4379c01f4547.vsidx deleted file mode 100644 index b4b6bb61..00000000 Binary files a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/92ba690c-5f44-444d-bb81-4379c01f4547.vsidx and /dev/null differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/b4eca872-6df6-4a95-b000-221909269f00.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/b4eca872-6df6-4a95-b000-221909269f00.vsidx deleted file mode 100644 index 07a8d32a..00000000 Binary files a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/b4eca872-6df6-4a95-b000-221909269f00.vsidx and /dev/null differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/c3349a48-f366-423d-b1a9-68f6aaf78344.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/c3349a48-f366-423d-b1a9-68f6aaf78344.vsidx new file mode 100644 index 00000000..36157ed4 Binary files /dev/null and b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/c3349a48-f366-423d-b1a9-68f6aaf78344.vsidx differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/eff92f75-a0c7-41cc-ac66-1caf4ccfb5a5.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/eff92f75-a0c7-41cc-ac66-1caf4ccfb5a5.vsidx deleted file mode 100644 index 1a97c057..00000000 Binary files a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/eff92f75-a0c7-41cc-ac66-1caf4ccfb5a5.vsidx and /dev/null differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/f938f46e-6705-4ee8-8715-39f9bdc49ecd.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/f938f46e-6705-4ee8-8715-39f9bdc49ecd.vsidx new file mode 100644 index 00000000..5d9be583 Binary files /dev/null and b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/f938f46e-6705-4ee8-8715-39f9bdc49ecd.vsidx differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/v17/.suo b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/v17/.suo index c9ffc468..2da4e1de 100644 Binary files a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/v17/.suo and b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/v17/.suo differ diff --git a/源代码/.Net Framework/Stg_Sharp/Debug/Program.cs b/源代码/.Net Framework/Stg_Sharp/Debug/Program.cs index fa9bc153..632a49d5 100644 --- a/源代码/.Net Framework/Stg_Sharp/Debug/Program.cs +++ b/源代码/.Net Framework/Stg_Sharp/Debug/Program.cs @@ -1,6 +1,7 @@ using StgSharp; using System; using System.Collections.Generic; +using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -11,6 +12,7 @@ namespace Debug { static void Main(string[] args) { + } } diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Control/Bind.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Control/Bind.cs index f36e8af8..f3105e82 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Control/Bind.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Control/Bind.cs @@ -25,23 +25,11 @@ namespace StgSharp.Control /// 被限定的圆 public void Complex(Point p, Circle c) { - c.ComplexBind += this.ac; + c._bindPoint = p; } - public void ac(Point p,Circle c) - { - float r = (float)Math.Sqrt - ((p.X - c.Center.X) * (p.X - c.Center.X) - - (p.Y - c.Center.Y) * (p.Y - c.Center.Y)); - c.Radius= r; - } - public void Complex(Point p, Line l) { - - } - public void al(Point p, Line l) - { - + l.EndingPoint = p; } } } diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Entity/Bullet.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Entity/Bullet.cs index 0f92e26e..ca5bd67b 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Entity/Bullet.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Entity/Bullet.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace StgSharp.Entity { - internal unsafe class Bullet : LinkedTarget + internal unsafe class Bullet : LinkedObject { //子弹的缩放比例 diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Circle.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Circle.cs index b2391b9f..25ad834a 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Circle.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Circle.cs @@ -7,16 +7,18 @@ using System.Threading.Tasks; namespace StgSharp.Geometry { - public unsafe class Circle : GeometryI + public unsafe class Circle :LinkedObject, IGeometry { - private Point _center; + private IPoint _center; - public Point Center + public IPoint Center { get { return _center; } set { _center = value; } } + internal IPoint _bindPoint; + private float _radius; public float Radius { @@ -78,7 +80,7 @@ namespace StgSharp.Geometry /// 圆心 /// 半径 /// 游戏刻计数器 - public Circle(Point center, float radius,Counter counter) + public Circle(IPoint center, float radius,Counter counter) { this._center = center; this._radius = radius; @@ -97,7 +99,7 @@ namespace StgSharp.Geometry /// 游戏刻计数器 /// 半径的时间函数 /// 角速度时间函数 - public Circle(Point center, float radius, Counter counter, float[] rFunc, float[] roFunc) + public Circle(IPoint center, float radius, Counter counter, float[] rFunc, float[] roFunc) { this._center = center; this._radius = radius; @@ -109,6 +111,17 @@ namespace StgSharp.Geometry this.RotateFunc = roFunc; } + /// + /// 通过两个点创建一个完全定义的圆实例 + /// + /// 作为圆心的点 + /// 在圆周上的点 + public Circle(IPoint c,IPoint b) + { + this._center = c; + this. _bindPoint = b; + } + public void SetMotion(float[] rFunc, float[] roFunc) { if (rFunc!=null) @@ -131,36 +144,60 @@ namespace StgSharp.Geometry } } - public override void OnRender() - { - float a = 0; - float tick = tickCounter.Value - beginTick; - for (int i = 0; i < 9; i++) - { - a += _rotateFunc[i]; - a *= tick; - } - _angle=a+ _rotateFunc[9]; - - float b = 0; - for (int i = 0; i < 9; i++) - { - b += _radiusFunc[i]; - b*= tick; - } - _radius=b+ _radiusFunc[9]; - } /// /// 将圆心绑定到一个新的点上; /// - /// - public override void Bind(Point p) + /// 想要绑定的圆心 + public void Bind(IPoint p) { _center = p; } //需要一个将点绑定在圆周上 + + public void OnRender() + { + + float a = 0; + float tick = tickCounter.Value - beginTick; + + if (_rotateFunc!=null) + { + for (int i = 0; i < 9; i++) + { + a += _rotateFunc[i]; + a *= tick; + } + _angle = a + _rotateFunc[9]; + } + + if (_bindPoint!=null) + { + float r = (float) + Math.Sqrt((_bindPoint.X - _center.X) * (_bindPoint.X - _center.X) + + (_bindPoint.Y - _center.Y) * (_bindPoint.Y - _center.Y)); + _radius= r; + } + else if (_radiusFunc!=null) + { + float b = 0; + for (int i = 0; i < 9; i++) + { + b += _radiusFunc[i]; + b *= tick; + } + _radius=b+ _radiusFunc[9]; + + } + + + + + + + } + } } diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/ComplexOperationHandler.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/ComplexOperationHandler.cs new file mode 100644 index 00000000..ce2d731c --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/ComplexOperationHandler.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Geometry +{ + public delegate void ComplexOperationHandler(); +} diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/GeometryI.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/GeometryI.cs deleted file mode 100644 index 1daeca31..00000000 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/GeometryI.cs +++ /dev/null @@ -1,58 +0,0 @@ -using StgSharp.Logic; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Geometry -{ - public class GeometryI : LinkedTarget - { - public new LinkedTarget Previous - { - get { return this.Previous; } - set - { - if (value is GeometryI) - { - _previous = value; - } - } - } - - public new LinkedTarget Next - { - get { return this.Next; } - set - { - if (value is GeometryI) - { - _next = value; - } - } - } - - public delegate void ComplexBindHandler(Point sender, Circle sender2); - - protected ComplexBindHandler complexBindHandler; - - internal event ComplexBindHandler ComplexBind - { - add { this.complexBindHandler += value; } - remove { this.complexBindHandler -= value; } - } - - - - public virtual void OnRender() - { - - } - public virtual void Bind(Point p) - { - - } - } - -} diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/IGeometry.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/IGeometry.cs new file mode 100644 index 00000000..e5f61fb2 --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/IGeometry.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Geometry +{ + internal interface IGeometry + { + + + void Bind(IPoint p); + + void OnRender(); + + event ComplexOperationHandler ComplexOperation; + } + +} diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/IPoint.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/IPoint.cs new file mode 100644 index 00000000..bbec7b98 --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/IPoint.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Geometry +{ + public interface IPoint + { + float X { get; set; } + + float Y { get; set; } + + float Angle { get; set; } + + void OnRender(); + } +} diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Line.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Line.cs index 1ad325d3..8313c628 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Line.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Line.cs @@ -7,19 +7,19 @@ using System.Threading.Tasks; namespace StgSharp.Geometry { - public class Line:GeometryI + public class Line:LinkedObject,IGeometry { - private Point _beginPoint; + private IPoint _beginPoint; - public Point BeginPoint + public IPoint BeginPoint { get { return _beginPoint; } set { _beginPoint = value; } } - private Point _endingPoint; + private IPoint _endingPoint; - public Point EndingPoint + public IPoint EndingPoint { get { return _endingPoint; } set { _endingPoint = value; } @@ -33,10 +33,17 @@ namespace StgSharp.Geometry set { _length = value; } } + public ComplexOperationHandler complexOperationHandler; + + public event ComplexOperationHandler ComplexOperation + { + add { complexOperationHandler += value; } + remove { complexOperationHandler -= value; } + } public Line() { - _beginPoint = new Point(); + } /// @@ -44,7 +51,7 @@ namespace StgSharp.Geometry /// /// /// - public Line(Point begin, Point end) + public Line(IPoint begin, IPoint end) { _beginPoint = begin; _endingPoint = end; @@ -66,7 +73,7 @@ namespace StgSharp.Geometry } - public override void OnRender() + public void OnRender() { _length = (float) Math.Sqrt((_endingPoint.X - _beginPoint.X) * (_endingPoint.X - _beginPoint.X) @@ -74,8 +81,12 @@ namespace StgSharp.Geometry } + public void Bind(IPoint p) + { + _beginPoint = p; + } - public override void Bind(Point p) + public void Bind(IPoint p,IPoint q) { _beginPoint = p; } diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Point.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Point.cs deleted file mode 100644 index 954b746d..00000000 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Point.cs +++ /dev/null @@ -1,48 +0,0 @@ -using StgSharp.Logic; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Geometry -{ - /// - /// 不直接使用该类型的实例 - /// - public class Point : LinkedTarget - { - protected float _x; - - public float X - { - get { return _x; } - set { _x = value; } - } - - protected float _y; - - public float Y - { - get { return _y; } - set { _y = value; } - } - - public new LinkedTarget Next - { - get { return this.Next; } - set - { - if (value is Point) - { - this.Next = value; - } - } - } - - public virtual void OnRender() - { - - } - } -} diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointCommon.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointCommon.cs index c1f9ea70..0d0db97f 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointCommon.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointCommon.cs @@ -7,11 +7,35 @@ using System.Threading.Tasks; namespace StgSharp.Geometry { - internal class PointCommon:Point + internal class PointCommon : LinkedObject, IPoint { private readonly float x0; private readonly float y0; + protected float _x; + protected float _y; + + public float X + { + get { return _x; } + set { _x = value; } + } + + public float Y + { + get { return _y; } + set { _y = value; } + } + + private float angle0; + private float _angle; + + public float Angle + { + get { return _angle; } + set { _angle = value; } + } + private float[] _xVelocity = new float[10]; public float[] XVelocity @@ -70,7 +94,7 @@ namespace StgSharp.Geometry } - public override void OnRender() + public void OnRender() { uint tick=_tickCounter.Value-beginTick; diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointOnCircle.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointOnCircle.cs index cbf26dd0..eff1ce75 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointOnCircle.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointOnCircle.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace StgSharp.Geometry { - public unsafe class PointOnCircle : Point + public unsafe class PointOnCircle :LinkedObject, IPoint { private Circle _bindedItem; @@ -17,6 +17,22 @@ namespace StgSharp.Geometry set { _bindedItem = value; } } + protected float _x; + + public float X + { + get { return _x; } + set { _x = value; } + } + + protected float _y; + + public float Y + { + get { return _y; } + set { _y = value; } + } + private float _angle0; private float _angle; @@ -40,7 +56,7 @@ namespace StgSharp.Geometry } - public override void OnRender() + public void OnRender() { _angle = _angle0 + _bindedItem.Angle; this._x = (float)(_bindedItem.Center.X + _bindedItem.Radius * Math.Cos(_angle)); diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointOnLine.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointOnLine.cs index 1aeb8732..54d09531 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointOnLine.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointOnLine.cs @@ -1,4 +1,5 @@ -using System; +using StgSharp.Logic; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,24 +7,40 @@ using System.Threading.Tasks; namespace StgSharp.Geometry { - public class PointOnLine : Point + public class PointOnLine : LinkedObject, IPoint { - private Point _beginPoint; + private IPoint _beginPoint; - public Point BeginPoint + public IPoint BeginPoint { get { return _beginPoint; } set { _beginPoint = value; } } - private Point _endPoint; + private IPoint _endPoint; - public Point EndPoint + public IPoint EndPoint { get { return _endPoint; } set { _endPoint = value; } } + protected float _x; + + public float X + { + get { return _x; } + set { _x = value; } + } + + protected float _y; + + public float Y + { + get { return _y; } + set { _y = value; } + } + private float _angle; public float Angle @@ -35,7 +52,7 @@ namespace StgSharp.Geometry private float rate; - public PointOnLine(Point beginPoint, Point endPoint, float rate, int number) + public PointOnLine(IPoint beginPoint, IPoint endPoint, float rate, int number) { _beginPoint = beginPoint; _endPoint = endPoint; @@ -47,7 +64,7 @@ namespace StgSharp.Geometry this._x = beginPoint.X + rate * (endPoint.X - beginPoint.X); } - public override void OnRender() + public void OnRender() { _angle = (float)(Math.Atan2(_endPoint.Y - _beginPoint.Y, _endPoint.X - _beginPoint.Y)); diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/EntityContainer.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/EntityContainer.cs index 318d0e40..af960189 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/EntityContainer.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/EntityContainer.cs @@ -6,19 +6,18 @@ using System.Threading.Tasks; namespace StgSharp.Logic { - internal class EntityContainer + internal class EntityContainer:LinkedList,IContainer { - private Counter _limit; + private int _limit; private float _leftBorder; private float _rightBorder; private float _topBorder; private float _bottomBorder; - private LinkedList _container; - public LinkedList Container + public int Limit { - get { return _container; } - set { _container = value; } + get { return _limit; } + set { _limit = value; } } public float LeftBorder @@ -42,27 +41,12 @@ namespace StgSharp.Logic set { _bottomBorder = value; } } - public EntityContainer(Counter counter) + public EntityContainer() { - this._limit = counter; - this.Container = new LinkedList(_limit); - } - - public void Add(LinkedTarget t) - { - if (true) //对target类型进行判断,应当只是实体 - { - _container.Add(t); - } - } - - public void RemoveAt(int id) - { - _container.Remove(id); } //Move an entity from one container to another one - public void Move(LinkedTarget target, EntityContainer targetContainer) + public void Move(LinkedObject target, EntityContainer targetContainer) { target.Previous = target.Next; target.Next = target.Previous; @@ -79,10 +63,7 @@ namespace StgSharp.Logic //碰撞判定 } - public void ReportCapacity() - { - Console.WriteLine(_limit.Value); - } + } } diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/GeometryContainer.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/GeometryContainer.cs index 7f21fdcd..644b9253 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/GeometryContainer.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/GeometryContainer.cs @@ -54,7 +54,7 @@ namespace StgSharp.Logic } - public void Add(LinkedTarget t) + public void Add(LinkedObject t) { Container.Add(t); } diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/IContainer.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/IContainer.cs new file mode 100644 index 00000000..272de3d4 --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/IContainer.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Logic +{ + internal interface IContainer + { + float LeftBorder { get; set; } + + float RightBorder { get; set; } + + float TopBorder { get; set; } + + float BottomBorder { get; set; } + + int Limit { get; set; } + + } +} diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedList.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedList.cs index 7abdcae4..9f360571 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedList.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedList.cs @@ -8,23 +8,23 @@ namespace StgSharp.Logic { public class LinkedList { - protected LinkedTarget _heading; - protected LinkedTarget _ending; - private LinkedTarget _cache; + protected LinkedObject _heading; + protected LinkedObject _ending; + private LinkedObject _cache; private Counter _amountCounter; - public LinkedTarget Heading + public LinkedObject Heading { get { return _heading; } set { _heading = value; } } - public LinkedTarget Ending + public LinkedObject Ending { get { return _ending; } set { _ending = value; } } - public LinkedTarget Cache + public LinkedObject Cache { get { return _cache; } set { _cache = value; } @@ -36,16 +36,16 @@ namespace StgSharp.Logic } //构造器 - public LinkedList(Counter counter) + public LinkedList() { - this._amountCounter = counter; + this._amountCounter = new Counter(); _amountCounter.Value = 0; _ending = null; _heading = null; } - public void Add(LinkedTarget target) + public void Add(LinkedObject target) { if (_ending != null) { @@ -85,7 +85,7 @@ namespace StgSharp.Logic /// 快速删除链表中已知名称的一个实例。由于不能判别实例是否存在于链表中故安全性较低。在对安全性有要求的情况下应当使用Remove_s方法。 /// /// - public void Remove(LinkedTarget target) + public void Remove(LinkedObject target) { target.Previous = target.Next; target.Next = target.Previous; @@ -99,7 +99,7 @@ namespace StgSharp.Logic /// /// /// - public void Remove_s(LinkedTarget target) + public void Remove_s(LinkedObject target) { bool a = true; _cache = _heading; diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedTarget.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedObject.cs similarity index 75% rename from 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedTarget.cs rename to 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedObject.cs index a0492ed4..ac3141e4 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedTarget.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedObject.cs @@ -7,11 +7,11 @@ using System.Threading.Tasks; namespace StgSharp.Logic { - public class LinkedTarget + public class LinkedObject { - protected LinkedTarget _previous; + protected LinkedObject _previous; - public LinkedTarget Previous + public LinkedObject Previous { get { return _previous; } set @@ -24,9 +24,9 @@ namespace StgSharp.Logic } } - protected LinkedTarget _next; + protected LinkedObject _next; - public LinkedTarget Next + public LinkedObject Next { get { return _next; } set diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/PointContainer.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/PointContainer.cs new file mode 100644 index 00000000..584261aa --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/PointContainer.cs @@ -0,0 +1,66 @@ +using StgSharp.Geometry; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Logic +{ + internal class PointContainer : LinkedList + { + private Counter _limit; + private float _leftBorder; + private float _rightBorder; + private float _topBorder; + private float _bottomBorder; + private LinkedList _container; + + public float LeftBorder + { + get { return _leftBorder; } + set { _leftBorder = value; } + } + public float RightBorder + { + get { return _rightBorder; } + set { _rightBorder = value; } + } + public float TopBorder + { + get { return _topBorder; } + set { _topBorder = value; } + } + public float BottomBorder + { + get { return _bottomBorder; } + set { _bottomBorder = value; } + } + + public LinkedList Container + { + get { return _container; } + set { _container = value; } + } + + + public void Add(LinkedObject t) + { + if (true) //对target类型进行判断,应当只是实体 + { + _container.Add(t); + } + } + + public void RemoveAt(int id) + { + _container.Remove(id); + } + + public PointContainer(Counter counter) + { + this._limit = counter; + this.Container = new LinkedList(_limit); + } + } +} diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp.csproj b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp.csproj index 06f25d11..bf61f00d 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp.csproj +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp.csproj @@ -49,7 +49,12 @@ + + + + + @@ -58,17 +63,14 @@ - - - - - - + + + diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/UI/Option.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/UI/Option.cs new file mode 100644 index 00000000..c9a32d0b --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/UI/Option.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.UI +{ + public class Option + { + + public SelectEventHandler selectEventHandler; + + public event SelectEventHandler SelectEvent + { + add { this.selectEventHandler += value; } + remove { this.selectEventHandler -= value; } + } + public void HighLight() + { + + } + + public void LowLight() + { + + } + + } + + public delegate void SelectEventHandler(); + +} diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index 42d7f297..9efe3ff6 100644 Binary files a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ