diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/036c8229-47cd-4869-a4e3-2448484bc3b8.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/036c8229-47cd-4869-a4e3-2448484bc3b8.vsidx new file mode 100644 index 00000000..b0193c7a Binary files /dev/null and b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/036c8229-47cd-4869-a4e3-2448484bc3b8.vsidx differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/2d5a8c36-0209-4815-980a-d960ae4deba0.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/2d5a8c36-0209-4815-980a-d960ae4deba0.vsidx new file mode 100644 index 00000000..3ffb3704 Binary files /dev/null and b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/2d5a8c36-0209-4815-980a-d960ae4deba0.vsidx differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/37862aaf-7963-4b66-b0aa-e3ffda460a63.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/37862aaf-7963-4b66-b0aa-e3ffda460a63.vsidx deleted file mode 100644 index 2ec8ea54..00000000 Binary files a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/37862aaf-7963-4b66-b0aa-e3ffda460a63.vsidx and /dev/null differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/577f8c37-a5fa-4a93-87c0-a6860d58f36b.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/81908c4e-7db5-4028-9c89-293eb359142a.vsidx similarity index 79% rename from 源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/577f8c37-a5fa-4a93-87c0-a6860d58f36b.vsidx rename to 源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/81908c4e-7db5-4028-9c89-293eb359142a.vsidx index df06c99c..a82688d9 100644 Binary files a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/577f8c37-a5fa-4a93-87c0-a6860d58f36b.vsidx and b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/81908c4e-7db5-4028-9c89-293eb359142a.vsidx differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/9009fd99-4fdf-4078-a32c-93335add580c.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/9009fd99-4fdf-4078-a32c-93335add580c.vsidx new file mode 100644 index 00000000..f2e4b3bd Binary files /dev/null and b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/9009fd99-4fdf-4078-a32c-93335add580c.vsidx differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/f2f93b21-8591-40a7-a6c4-11714f0da262.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/f2f93b21-8591-40a7-a6c4-11714f0da262.vsidx deleted file mode 100644 index 31968671..00000000 Binary files a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/f2f93b21-8591-40a7-a6c4-11714f0da262.vsidx and /dev/null differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/f389c742-04a1-4898-86ab-34659070e2f6.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/f389c742-04a1-4898-86ab-34659070e2f6.vsidx deleted file mode 100644 index 159699af..00000000 Binary files a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/f389c742-04a1-4898-86ab-34659070e2f6.vsidx and /dev/null differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/v17/.suo b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/v17/.suo index 9628677a..d2100f93 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/Stg_Sharp/Entity/Bullet.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Entity/Bullet.cs index b6765cfa..29f15bad 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Entity/Bullet.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Entity/Bullet.cs @@ -33,6 +33,14 @@ namespace StgSharp.Entity set { _y = value; } } + private float _radius; + + public float Radius + { + get { return _radius; } + set { _radius = value; } + } + public Bullet() { diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/FreeCurve.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/FreeCurve.cs new file mode 100644 index 00000000..6e2e8732 --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/FreeCurve.cs @@ -0,0 +1,70 @@ +using StgSharp.Logic; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Geometry +{ + internal class FreeCurve : LinkedObject, IGeometry + { + + private IPoint _center; + private float[] _xExpression; + private float[] _yExpression; + + public float[] XExpression + { + get { return _xExpression; } + set { _xExpression = value; } + } + + public float[] YExpression + { + get { return _yExpression; } + set { _yExpression = value; } + + } + + public IPoint Center + { + get { return _center; } + set { _center = value; } + } + + public event ComplexOperationHandler ComplexOperation; + + + + public FreeCurve(IPoint c, float[] x, float[] y) + { + if (x.Length==10) + { + _xExpression = x; + } + else + { + throw new Exception("Parameters are too many or too few!"); + } + + if (y.Length==10) + { + _yExpression = y; + } + else + { + throw new Exception("Parameters are too many or too few!"); + } + } + + public void Bind(IPoint p) + { + _center = p; + } + + public void OnRender() + { + } + } +} diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedList.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedList.cs index d621bced..dfb2a24d 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedList.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedList.cs @@ -13,13 +13,13 @@ namespace StgSharp.Logic protected LinkedObject _cache; protected Counter _amountCounter; - public LinkedObject Heading + public virtual LinkedObject Heading { get { return _heading; } set { _heading = value; } } - public LinkedObject Ending + public virtual LinkedObject Ending { get { return _ending; } set { _ending = value; } @@ -44,7 +44,7 @@ namespace StgSharp.Logic } - public void Add(LinkedObject target) + public virtual void Add(LinkedObject target) { if (_ending != null) { diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Pool/BulletContainer.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Pool/BulletContainer.cs new file mode 100644 index 00000000..4e54c95f --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Pool/BulletContainer.cs @@ -0,0 +1,110 @@ +using StgSharp.Entity; +using StgSharp.Logic; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Pool +{ + internal class BulletContainer : LinkedList, IContainer + { + private int _limit; + protected float _leftBorder; + protected float _rightBorder; + protected float _topBorder; + protected float _bottomBorder; + + public int Limit + { + get { return _limit; } + set { _limit = value; } + } + + 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 static IContainer _top; + public static IContainer _bottom; + public static IContainer _left; + public static IContainer _right; + + public IContainer Top + { + get { return _top; } + set { } + } + public IContainer Bottom + { + get { return _bottom; } + set { } + } + public IContainer Left + { + get { return _left; } + set { } + } + public IContainer Right + { + get { return _right; } + set { } + } + + public BulletContainer(float top, float bottom, float left, float right) + { + _topBorder = top; + _bottomBorder = bottom; + _leftBorder = left; + _rightBorder = right; + this._amountCounter = new Counter(); + _amountCounter.Value = 0; + _heading = null; + } + + public BulletContainer(IContainer t, IContainer b, IContainer l, IContainer r) + { + _top = t; + _topBorder = t.BottomBorder; + + _bottom = b; + _bottomBorder = b.TopBorder; + + _left = l; + _leftBorder = l.RightBorder; + + _right = r; + _rightBorder = r.LeftBorder; + } + + //What should a container do on each rendering frame + //This method should be overriden + public void OnRender() + { + //坐标刷新 + //边界判定 + //碰撞判定 + } + + + + } +} diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Pool/BulletPool.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Pool/BulletPool.cs index 14dc20da..88fbe3be 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Pool/BulletPool.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Pool/BulletPool.cs @@ -40,15 +40,15 @@ namespace StgSharp.Pool //用一个实体容器存放各种各样的实体,太不安全了, //写这种代码的人是个大SB。 - static EntityContainer mainContainer; - static EntityContainer grazeContainer; + static BulletContainer mainContainer; + static BulletContainer grazeContainer; public BulletPool(Collector t, Collector b, Collector l, Collector r) { - mainContainer = new EntityContainer(1000,-1000,-600,600); + mainContainer = new BulletContainer(1000,-1000,-600,600); - grazeContainer = new EntityContainer(1000,400,-150,150); + grazeContainer = new BulletContainer(1000,400,-150,150); mainContainer.Top = _topCollector; mainContainer.Bottom = _bottomCollector; @@ -70,7 +70,21 @@ namespace StgSharp.Pool public static void OnRender() { - cache = mainContainer.Heading; + Bullet end=mainContainer.Ending as Bullet; + cache = mainContainer.Heading as Bullet; + do + { + if (cache.X - cache.Radius < grazeContainer.LeftBorder + || cache.X + cache.Radius < grazeContainer.RightBorder + || cache.Y - cache.Radius < grazeContainer.TopBorder + || cache.Y + cache.Radius < grazeContainer.RightBorder) + { + grazeContainer.Add(cache); + } + + cache = cache.Next as Bullet; + + } while (cache == end); } } } diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Pool/EntityContainer.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Pool/EntityContainer.cs index 7ff08ea9..2e73a6f8 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Pool/EntityContainer.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Pool/EntityContainer.cs @@ -12,10 +12,10 @@ namespace StgSharp.Logic { private int _limit; - private float _leftBorder; - private float _rightBorder; - private float _topBorder; - private float _bottomBorder; + protected float _leftBorder; + protected float _rightBorder; + protected float _topBorder; + protected float _bottomBorder; public int Limit { diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp.csproj b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp.csproj index c8bbf50e..45c3b241 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp.csproj +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp.csproj @@ -52,10 +52,12 @@ + + diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/obj/Debug/StgSharp.csproj.CoreCompileInputs.cache b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/obj/Debug/StgSharp.csproj.CoreCompileInputs.cache index 75cd509d..3f0568ff 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/obj/Debug/StgSharp.csproj.CoreCompileInputs.cache +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/obj/Debug/StgSharp.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -369e445224268321375e14dd582eb844e5d534bd +76f5eaf647d5cdb61f503c89649a3cd3e872f683