diff --git a/源代码/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 b/源代码/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 index 1ac23e38..d7b6d101 100644 Binary files a/源代码/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 and b/源代码/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 differ diff --git a/源代码/.vs/ProjectEvaluation/stgsharp.projects.v5.1 b/源代码/.vs/ProjectEvaluation/stgsharp.projects.v5.1 index 72fb88c6..685b9364 100644 Binary files a/源代码/.vs/ProjectEvaluation/stgsharp.projects.v5.1 and b/源代码/.vs/ProjectEvaluation/stgsharp.projects.v5.1 differ diff --git a/源代码/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 b/源代码/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 index 708c8969..2664bdf8 100644 Binary files a/源代码/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 and b/源代码/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/12961a9e-625b-48af-90fb-190d694fcee2.vsidx b/源代码/.vs/StgSharp/FileContentIndex/12961a9e-625b-48af-90fb-190d694fcee2.vsidx new file mode 100644 index 00000000..7b0eb67b Binary files /dev/null and b/源代码/.vs/StgSharp/FileContentIndex/12961a9e-625b-48af-90fb-190d694fcee2.vsidx differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/1f45626e-0176-45da-866b-999efdf3738b.vsidx b/源代码/.vs/StgSharp/FileContentIndex/1f45626e-0176-45da-866b-999efdf3738b.vsidx deleted file mode 100644 index 694d8894..00000000 Binary files a/源代码/.vs/StgSharp/FileContentIndex/1f45626e-0176-45da-866b-999efdf3738b.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/32d69581-1b2a-4d08-8003-ac6d51618cea.vsidx b/源代码/.vs/StgSharp/FileContentIndex/32d69581-1b2a-4d08-8003-ac6d51618cea.vsidx deleted file mode 100644 index 4307d285..00000000 Binary files a/源代码/.vs/StgSharp/FileContentIndex/32d69581-1b2a-4d08-8003-ac6d51618cea.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/3488b161-c7ce-4dc8-bfad-b772e6a57ce5.vsidx b/源代码/.vs/StgSharp/FileContentIndex/3488b161-c7ce-4dc8-bfad-b772e6a57ce5.vsidx deleted file mode 100644 index cb6a25d9..00000000 Binary files a/源代码/.vs/StgSharp/FileContentIndex/3488b161-c7ce-4dc8-bfad-b772e6a57ce5.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/438f1b21-351e-47d7-86cb-9063fd7b77a9.vsidx b/源代码/.vs/StgSharp/FileContentIndex/438f1b21-351e-47d7-86cb-9063fd7b77a9.vsidx deleted file mode 100644 index 75611b5b..00000000 Binary files a/源代码/.vs/StgSharp/FileContentIndex/438f1b21-351e-47d7-86cb-9063fd7b77a9.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/47849885-9aae-49c8-90d5-668cc4247e7f.vsidx b/源代码/.vs/StgSharp/FileContentIndex/47849885-9aae-49c8-90d5-668cc4247e7f.vsidx deleted file mode 100644 index 75611b5b..00000000 Binary files a/源代码/.vs/StgSharp/FileContentIndex/47849885-9aae-49c8-90d5-668cc4247e7f.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/8c46f541-a4cf-46d3-b2a8-2f40f1b2e67c.vsidx b/源代码/.vs/StgSharp/FileContentIndex/8c46f541-a4cf-46d3-b2a8-2f40f1b2e67c.vsidx new file mode 100644 index 00000000..3e3eccb4 Binary files /dev/null and b/源代码/.vs/StgSharp/FileContentIndex/8c46f541-a4cf-46d3-b2a8-2f40f1b2e67c.vsidx differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/9b20b0a9-5af0-4638-b058-3e9efdfbc098.vsidx b/源代码/.vs/StgSharp/FileContentIndex/9b20b0a9-5af0-4638-b058-3e9efdfbc098.vsidx deleted file mode 100644 index 5ec76c03..00000000 Binary files a/源代码/.vs/StgSharp/FileContentIndex/9b20b0a9-5af0-4638-b058-3e9efdfbc098.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/cdbe2d69-4165-4606-8c91-89e3b02224d4.vsidx b/源代码/.vs/StgSharp/FileContentIndex/cdbe2d69-4165-4606-8c91-89e3b02224d4.vsidx deleted file mode 100644 index b84a565b..00000000 Binary files a/源代码/.vs/StgSharp/FileContentIndex/cdbe2d69-4165-4606-8c91-89e3b02224d4.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/d8b0acee-d46b-468b-afa2-a3e2da04e8da.vsidx b/源代码/.vs/StgSharp/FileContentIndex/d8b0acee-d46b-468b-afa2-a3e2da04e8da.vsidx new file mode 100644 index 00000000..dedd23ae Binary files /dev/null and b/源代码/.vs/StgSharp/FileContentIndex/d8b0acee-d46b-468b-afa2-a3e2da04e8da.vsidx differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/d953ca0a-20b8-40f9-81c2-50cf0b8f2210.vsidx b/源代码/.vs/StgSharp/FileContentIndex/d953ca0a-20b8-40f9-81c2-50cf0b8f2210.vsidx new file mode 100644 index 00000000..abe056a3 Binary files /dev/null and b/源代码/.vs/StgSharp/FileContentIndex/d953ca0a-20b8-40f9-81c2-50cf0b8f2210.vsidx differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/f1fbb622-e9e7-4e3c-a18b-1b162e910e6b.vsidx b/源代码/.vs/StgSharp/FileContentIndex/f1fbb622-e9e7-4e3c-a18b-1b162e910e6b.vsidx deleted file mode 100644 index cb6a25d9..00000000 Binary files a/源代码/.vs/StgSharp/FileContentIndex/f1fbb622-e9e7-4e3c-a18b-1b162e910e6b.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharp/v17/.futdcache.v2 b/源代码/.vs/StgSharp/v17/.futdcache.v2 index 4982d4e2..8048ca64 100644 Binary files a/源代码/.vs/StgSharp/v17/.futdcache.v2 and b/源代码/.vs/StgSharp/v17/.futdcache.v2 differ diff --git a/源代码/.vs/StgSharp/v17/.suo b/源代码/.vs/StgSharp/v17/.suo index a2b5341f..5e54cb0b 100644 Binary files a/源代码/.vs/StgSharp/v17/.suo and b/源代码/.vs/StgSharp/v17/.suo differ diff --git a/源代码/StgSharp/Control/TimelineBlock.cs b/源代码/StgSharp/Control/TimelineBlock.cs index ccea6866..937fc288 100644 --- a/源代码/StgSharp/Control/TimelineBlock.cs +++ b/源代码/StgSharp/Control/TimelineBlock.cs @@ -6,8 +6,6 @@ namespace StgSharp.Control { public abstract class TimelineBlock : INode { - - private ContainerNode _id; public abstract void OnUpdating(); diff --git a/源代码/StgSharp/Entities/BehaviorArgs.cs b/源代码/StgSharp/Entities/BehaviorArgs.cs new file mode 100644 index 00000000..8dd8221c --- /dev/null +++ b/源代码/StgSharp/Entities/BehaviorArgs.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Entities +{ + public abstract class BehaviorArgs + { + + } +} diff --git a/源代码/StgSharp/Entities/EliteEnemy.cs b/源代码/StgSharp/Entities/EliteEnemy.cs index 18d0cd04..6f531d04 100644 --- a/源代码/StgSharp/Entities/EliteEnemy.cs +++ b/源代码/StgSharp/Entities/EliteEnemy.cs @@ -9,7 +9,7 @@ namespace StgSharp.Entities public bool _selectalbe; internal Launcher _awardLauncher; - internal LinkedList< Launcher> _commonBulletLauncher; + internal LinkedList> _commonBulletLauncher; internal Launcher _dieBulletLauncher; public Launcher AwardLauncher { get; set; } @@ -18,8 +18,8 @@ namespace StgSharp.Entities internal void InternalDieOperation(Pool home) { - _dieBulletLauncher.Launch(Control.GameTimeLine.tickCounter, home._bulletContainer); - _awardLauncher.Launch(Control.GameTimeLine.tickCounter, home._awardContainer); + _dieBulletLauncher.Launch(); + _awardLauncher.Launch(); this._id.Remove(); } @@ -28,7 +28,7 @@ namespace StgSharp.Entities this.OnUpdate(); foreach (Launcher launcher in CommonBulletLauncher) { - launcher.Launch(Control.GameTimeLine.tickCounter, Control.GameTimeLine._currentPool._bulletContainer); + launcher.Launch(); } this.OnRender(); } diff --git a/源代码/StgSharp/Entities/Enemy.cs b/源代码/StgSharp/Entities/Enemy.cs index 3982a15c..f0da2a6a 100644 --- a/源代码/StgSharp/Entities/Enemy.cs +++ b/源代码/StgSharp/Entities/Enemy.cs @@ -18,19 +18,14 @@ namespace StgSharp.Entities internal void InternalDieOperation(Pool home) { - _dieBulletLauncher.Launch(Control.GameTimeLine.tickCounter, home._bulletContainer); - _awardLauncher.Launch(Control.GameTimeLine.tickCounter, home._awardContainer); + _dieBulletLauncher.Launch(); + _awardLauncher.Launch(); this._id.Remove(); } - public override void OnRender() + internal override void OnRenderFrame() { - throw new NotImplementedException(); - } - - public override void OnUpdate() - { - throw new NotImplementedException(); + CommonBulletLauncher.Launch(); } } } diff --git a/源代码/StgSharp/Entities/Launcher.cs b/源代码/StgSharp/Entities/Launcher.cs index dd6f82f6..74240cf1 100644 --- a/源代码/StgSharp/Entities/Launcher.cs +++ b/源代码/StgSharp/Entities/Launcher.cs @@ -23,7 +23,7 @@ namespace StgSharp set { _bulletSample = value; } } - internal virtual void Launch(Counter outerTickCounter, LinkedList container) + internal virtual void Launch( ) { } diff --git a/源代码/StgSharp/Entities/Partical.cs b/源代码/StgSharp/Entities/Partical.cs index f78463b6..25c33765 100644 --- a/源代码/StgSharp/Entities/Partical.cs +++ b/源代码/StgSharp/Entities/Partical.cs @@ -7,12 +7,7 @@ namespace StgSharp { public class Partical : IEntity { - public override void OnRender() - { - throw new NotImplementedException(); - } - - public override void OnUpdate() + internal override void OnRenderFrame() { throw new NotImplementedException(); } diff --git a/源代码/StgSharp/Geometries/Circle.cs b/源代码/StgSharp/Geometries/Circle.cs index 87ce2813..82afcce0 100644 --- a/源代码/StgSharp/Geometries/Circle.cs +++ b/源代码/StgSharp/Geometries/Circle.cs @@ -38,19 +38,19 @@ namespace StgSharp.Geometries _center._position = _baseCenter._position + MoveCenter(tick); } - internal override void CalcVec02(vec2d vec, uint tick) + internal override void CalcVec02(vec3d vec, uint tick) { _radiusVec._position = vec + UpdateRadius(tick); } - internal override void CalcVec03(vec2d vec, uint tick) + internal override void CalcVec03(vec3d vec, uint tick) { throw new NotImplementedException(); } - public virtual vec2d MoveCenter(uint tick) => default; + public virtual vec3d MoveCenter(uint tick) => default; - public virtual vec2d UpdateRadius(uint tick) => default; + public virtual vec3d UpdateRadius(uint tick) => default; @@ -83,5 +83,9 @@ namespace StgSharp.Geometries } } + public override Line[] GetAllSides() + { + throw new NotImplementedException(); + } } } diff --git a/源代码/StgSharp/Geometries/IGeometry.cs b/源代码/StgSharp/Geometries/IGeometry.cs index bff80b89..9e461742 100644 --- a/源代码/StgSharp/Geometries/IGeometry.cs +++ b/源代码/StgSharp/Geometries/IGeometry.cs @@ -34,6 +34,9 @@ namespace StgSharp.Geometries public abstract RenderMode renderMode { get; } public abstract float SetArrayX(); public abstract float SetArrayY(); + + public abstract Line[] GetAllSides(); + } diff --git a/源代码/StgSharp/Geometries/Line.cs b/源代码/StgSharp/Geometries/Line.cs index 2927c6aa..c60cff5b 100644 --- a/源代码/StgSharp/Geometries/Line.cs +++ b/源代码/StgSharp/Geometries/Line.cs @@ -80,5 +80,10 @@ namespace StgSharp.Geometries break; } } + + public override Line[] GetAllSides() + { + throw new NotImplementedException(); + } } } diff --git a/源代码/StgSharp/Geometries/Parallelogram.cs b/源代码/StgSharp/Geometries/Parallelogram.cs new file mode 100644 index 00000000..da38b0e5 --- /dev/null +++ b/源代码/StgSharp/Geometries/Parallelogram.cs @@ -0,0 +1,91 @@ +using StgSharp.Math; +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Geometries +{ + internal class Parallelogram : IGeometry + { + internal Point _basePoint; + internal Point _center; + internal Point _centerToCorner1; + internal Point _centerToCorner2; + internal RenderMode _renderMode; + internal readonly uint bornTick; + + public override sealed Point BasePoint => _basePoint; + public override sealed Point RefPoint => _center; + + public override sealed Point RefVec01 => _centerToCorner1; + + public override sealed Point RefVec02 => _centerToCorner2; + + public override RenderMode renderMode => _renderMode; + + public Parallelogram(uint bornTime) : base(bornTime) + { + bornTick = bornTime; + } + + public Parallelogram(Counter tickCounter) : base(tickCounter) + { + bornTick = tickCounter._value; + } + + internal override sealed void OnRender(uint tick) + { + tick -= bornTick; + CalcVec01(tick); + switch (renderMode) + { + case RenderMode.BasePoint: + CalcVec02(_basePoint._position, tick); + CalcVec03(_basePoint._position, tick); + break; + case RenderMode.RefPoint: + CalcVec02(_center._position, tick); + CalcVec03(_center._position, tick); + break; + default: + break; + } + } + + public override sealed float SetArrayX() + { + throw new NotImplementedException(); + } + + public override sealed float SetArrayY() + { + throw new NotImplementedException(); + } + + internal override void CalcVec01(uint tick) + { + _center._position = _basePoint._position + MovCenter(tick); + } + + internal override void CalcVec02(vec3d vec, uint tick) + { + _centerToCorner1._position = vec + UpdateCTC1(tick); + } + + internal override void CalcVec03(vec3d vec, uint tick) + { + _centerToCorner2._position = vec + UpdateCTC2(tick); + } + + public virtual vec3d MovCenter(uint tick) => default(vec3d); + + public virtual vec3d UpdateCTC1(uint tick) => default(vec3d); + + public virtual vec3d UpdateCTC2(uint tick) => default(vec3d); + + public override Line[] GetAllSides() + { + throw new NotImplementedException(); + } + } +} diff --git a/源代码/StgSharp/Geometries/Rectangle.cs b/源代码/StgSharp/Geometries/Rectangle.cs index fc474822..54767524 100644 --- a/源代码/StgSharp/Geometries/Rectangle.cs +++ b/源代码/StgSharp/Geometries/Rectangle.cs @@ -67,11 +67,24 @@ namespace StgSharp.Geometries _center._position = _basePoint._position + MovCenter(tick); } + /// + /// 计算长方形第一条对角线的一半的矢量表示 + /// + /// 作为参考的矢量,根据计算模式可以分为参考原点 + /// 和参考中心点两种 + /// 当前游戏刻 internal override void CalcVec02(vec3d vec, uint tick) { _centerToCorner1._position = vec + UpdateCTC1(tick); } + /// + /// 计算长方形第二条对角线一半的矢量表示 + /// + /// 作为参考的矢量,根据计算模式可以分为参考原点 + /// 和参考中心点两种 + /// 当前游戏刻 + /// 计算出的第二条对角线长与第一条不相等 internal override void CalcVec03(vec3d vec, uint tick) { _centerToCorner2._position = vec + UpdateCTC2(tick); @@ -83,10 +96,25 @@ namespace StgSharp.Geometries } } + /// + /// 计算中心点相对于参考原点的位移 + /// + /// 当前游戏刻 + /// public virtual vec3d MovCenter(uint tick)=>default(vec3d); + /// + /// 计算一个顶点相对于 + /// + /// + /// public virtual vec3d UpdateCTC1(uint tick) => default(vec3d); public virtual vec3d UpdateCTC2(uint tick) => default(vec3d); + + public override Line[] GetAllSides() + { + throw new NotImplementedException(); + } } } diff --git a/源代码/StgSharp/Graphic/Class1.cs b/源代码/StgSharp/Graphic/Class1.cs new file mode 100644 index 00000000..92811fa5 --- /dev/null +++ b/源代码/StgSharp/Graphic/Class1.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Graphic +{ + internal class Class1 + { + } +} diff --git a/源代码/StgSharp/Logic/LinkedList.cs b/源代码/StgSharp/Logic/LinkedList.cs index 90feac54..adcb1681 100644 --- a/源代码/StgSharp/Logic/LinkedList.cs +++ b/源代码/StgSharp/Logic/LinkedList.cs @@ -6,12 +6,11 @@ using System.Text; namespace StgSharp { - public class LinkedList:IEnumerable,INode> where T: INode + public class LinkedList:INode>,IEnumerable where T: INode { internal readonly ContainerNode _heading; internal ContainerNode _first; internal ContainerNode _tail; - private ContainerNode> _id; private ContainerNode _cache; public LinkedList() diff --git a/源代码/StgSharp/Logic/Pool.cs b/源代码/StgSharp/Logic/Pool.cs index 6cfbf12a..6201aac7 100644 --- a/源代码/StgSharp/Logic/Pool.cs +++ b/源代码/StgSharp/Logic/Pool.cs @@ -1,5 +1,5 @@ using Steamworks; -using StgSharp; +using StgSharp.Math; using StgSharp.Entities; using StgSharp.Geometries; using System; @@ -29,8 +29,6 @@ namespace StgSharp internal Sensor Sensor; - private ContainerNode _id; - public Pool(Line left, Line right, Line top, Line bottom) @@ -42,7 +40,11 @@ namespace StgSharp } public Pool( Geometries.Rectangle area) { - + if (Calc.Abs(area._centerToCorner1.X) == Calc.Abs(area._centerToCorner2.X) + && Calc.Abs(area._centerToCorner1.Y) == Calc.Abs(area._centerToCorner2.Y)) + { + + } } public void OnRender() diff --git a/源代码/StgSharp/Math/BasicOps.cs b/源代码/StgSharp/Math/BasicOps.cs index 5461fbe5..0e74cc2d 100644 --- a/源代码/StgSharp/Math/BasicOps.cs +++ b/源代码/StgSharp/Math/BasicOps.cs @@ -14,11 +14,14 @@ namespace StgSharp.Math uint* a = (uint*)&x; *a &= 0b_0111_1111_1111_1111_1111_1111_1111_1111; return *(float*)a; - - - } + public static unsafe int Abs(int x) + { + uint* a = (uint*)&x; + *a &= 0b_0111_1111_1111_1111_1111_1111_1111_1111; + return *(int*)a; + } }