diff --git a/源代码/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 b/源代码/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 index 9bda3bdd..1ac23e38 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 c21c9ce2..72fb88c6 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 84b44ff9..708c8969 100644 Binary files a/源代码/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 and b/源代码/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/1f45626e-0176-45da-866b-999efdf3738b.vsidx b/源代码/.vs/StgSharp/FileContentIndex/1f45626e-0176-45da-866b-999efdf3738b.vsidx new file mode 100644 index 00000000..694d8894 Binary files /dev/null and b/源代码/.vs/StgSharp/FileContentIndex/1f45626e-0176-45da-866b-999efdf3738b.vsidx differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/347e07b5-95cd-493f-81ad-c643a63a33f0.vsidx b/源代码/.vs/StgSharp/FileContentIndex/438f1b21-351e-47d7-86cb-9063fd7b77a9.vsidx similarity index 59% rename from 源代码/.vs/StgSharp/FileContentIndex/347e07b5-95cd-493f-81ad-c643a63a33f0.vsidx rename to 源代码/.vs/StgSharp/FileContentIndex/438f1b21-351e-47d7-86cb-9063fd7b77a9.vsidx index 5bb1d6da..75611b5b 100644 Binary files a/源代码/.vs/StgSharp/FileContentIndex/347e07b5-95cd-493f-81ad-c643a63a33f0.vsidx and b/源代码/.vs/StgSharp/FileContentIndex/438f1b21-351e-47d7-86cb-9063fd7b77a9.vsidx differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/9b20b0a9-5af0-4638-b058-3e9efdfbc098.vsidx b/源代码/.vs/StgSharp/FileContentIndex/9b20b0a9-5af0-4638-b058-3e9efdfbc098.vsidx new file mode 100644 index 00000000..5ec76c03 Binary files /dev/null and b/源代码/.vs/StgSharp/FileContentIndex/9b20b0a9-5af0-4638-b058-3e9efdfbc098.vsidx differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/a190c7c7-f1cc-43ab-9814-65e0b97d1099.vsidx b/源代码/.vs/StgSharp/FileContentIndex/a190c7c7-f1cc-43ab-9814-65e0b97d1099.vsidx deleted file mode 100644 index c079e132..00000000 Binary files a/源代码/.vs/StgSharp/FileContentIndex/a190c7c7-f1cc-43ab-9814-65e0b97d1099.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/b5462bc1-07d5-4e14-8f89-34b3328bbc0d.vsidx b/源代码/.vs/StgSharp/FileContentIndex/b5462bc1-07d5-4e14-8f89-34b3328bbc0d.vsidx deleted file mode 100644 index e44e247c..00000000 Binary files a/源代码/.vs/StgSharp/FileContentIndex/b5462bc1-07d5-4e14-8f89-34b3328bbc0d.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/ca982ac3-0dbd-4638-9423-3571768c2dcd.vsidx b/源代码/.vs/StgSharp/FileContentIndex/ca982ac3-0dbd-4638-9423-3571768c2dcd.vsidx deleted file mode 100644 index e1817843..00000000 Binary files a/源代码/.vs/StgSharp/FileContentIndex/ca982ac3-0dbd-4638-9423-3571768c2dcd.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharp/FileContentIndex/f1fbb622-e9e7-4e3c-a18b-1b162e910e6b.vsidx b/源代码/.vs/StgSharp/FileContentIndex/f1fbb622-e9e7-4e3c-a18b-1b162e910e6b.vsidx new file mode 100644 index 00000000..cb6a25d9 Binary files /dev/null and b/源代码/.vs/StgSharp/FileContentIndex/f1fbb622-e9e7-4e3c-a18b-1b162e910e6b.vsidx differ diff --git a/源代码/.vs/StgSharp/v17/.futdcache.v2 b/源代码/.vs/StgSharp/v17/.futdcache.v2 index 4c57a3e5..4982d4e2 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 064a6a5d..a2b5341f 100644 Binary files a/源代码/.vs/StgSharp/v17/.suo and b/源代码/.vs/StgSharp/v17/.suo differ diff --git a/源代码/StgSharp/Control/Add.cs b/源代码/StgSharp/Control/Add.cs index 42578d97..96b72d75 100644 --- a/源代码/StgSharp/Control/Add.cs +++ b/源代码/StgSharp/Control/Add.cs @@ -19,5 +19,10 @@ namespace StgSharp.Control GameTimeLine._currentPool.geometryContainer.Add(geo); } } + + public static void Geometry(IGeometry geometry) + { + GameTimeLine._currentPool.geometryContainer.Add(geometry); + } } } diff --git a/源代码/StgSharp/Control/BlockOperation.cs b/源代码/StgSharp/Control/BlockOperation.cs deleted file mode 100644 index 4f789d75..00000000 --- a/源代码/StgSharp/Control/BlockOperation.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace StgSharp.Control -{ - public abstract class BlockOperation : INode - { - - private ContainerNode _id; - - - ContainerNode INode.ID => _id; - - void INode.setID(ContainerNode id) - { - if (_id == default) - { - _id = id; - } - else - { - throw new InvalidOperationException("Cannot set ID twice!"); - } - } - - - public abstract void OnUpdating(); - - } -} diff --git a/源代码/StgSharp/Control/TimeLine.cs b/源代码/StgSharp/Control/GameTimeLine.cs similarity index 83% rename from 源代码/StgSharp/Control/TimeLine.cs rename to 源代码/StgSharp/Control/GameTimeLine.cs index fe8d7bc9..65a1b53c 100644 --- a/源代码/StgSharp/Control/TimeLine.cs +++ b/源代码/StgSharp/Control/GameTimeLine.cs @@ -9,9 +9,8 @@ namespace StgSharp.Control { internal static Pool _currentPool; internal static LinkedList allPool; - public static Counter tickCounter - = new Counter(0,1,1); - internal static BlockOperation currentOperation; + public static Counter tickCounter = new Counter(0,1,1); + internal static TimelineBlock currentOperation; private static bool isPaused; internal static void OnRender() diff --git a/源代码/StgSharp/Control/TimelineBlock.cs b/源代码/StgSharp/Control/TimelineBlock.cs new file mode 100644 index 00000000..ccea6866 --- /dev/null +++ b/源代码/StgSharp/Control/TimelineBlock.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Control +{ + public abstract class TimelineBlock : INode + { + + private ContainerNode _id; + + public abstract void OnUpdating(); + + } +} diff --git a/源代码/StgSharp/Entities/EliteEnemy.cs b/源代码/StgSharp/Entities/EliteEnemy.cs new file mode 100644 index 00000000..18d0cd04 --- /dev/null +++ b/源代码/StgSharp/Entities/EliteEnemy.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Entities +{ + public class EliteEnemy:IEntity + { + public bool _selectalbe; + + internal Launcher _awardLauncher; + internal LinkedList< Launcher> _commonBulletLauncher; + internal Launcher _dieBulletLauncher; + + public Launcher AwardLauncher { get; set; } + public LinkedList> CommonBulletLauncher { get; set; } + public Launcher DieBulletLauncher { get; set; } + + internal void InternalDieOperation(Pool home) + { + _dieBulletLauncher.Launch(Control.GameTimeLine.tickCounter, home._bulletContainer); + _awardLauncher.Launch(Control.GameTimeLine.tickCounter, home._awardContainer); + this._id.Remove(); + } + + internal override void OnRenderFrame() + { + this.OnUpdate(); + foreach (Launcher launcher in CommonBulletLauncher) + { + launcher.Launch(Control.GameTimeLine.tickCounter, Control.GameTimeLine._currentPool._bulletContainer); + } + this.OnRender(); + } + + public virtual void OnRender() => new NotImplementedException(); + + public virtual void OnUpdate() => new NotImplementedException(); + } +} diff --git a/源代码/StgSharp/Entities/Enemy.cs b/源代码/StgSharp/Entities/Enemy.cs index ebe5a1d4..3982a15c 100644 --- a/源代码/StgSharp/Entities/Enemy.cs +++ b/源代码/StgSharp/Entities/Enemy.cs @@ -4,16 +4,17 @@ using System.Text; namespace StgSharp.Entities { - public class Enemy : Entity + public class Enemy : IEntity { public bool _selectalbe; - public Launcher _awardLauncher; - public Launcher _commonBulletLauncher; - public Launcher _dieBulletLauncher; - - + internal Launcher _awardLauncher; + internal Launcher _commonBulletLauncher; + internal Launcher _dieBulletLauncher; + public Launcher AwardLauncher { get; set; } + public Launcher CommonBulletLauncher { get; set; } + public Launcher DieBulletLauncher { get; set; } internal void InternalDieOperation(Pool home) { @@ -22,7 +23,14 @@ namespace StgSharp.Entities this._id.Remove(); } - + public override void OnRender() + { + throw new NotImplementedException(); + } + public override void OnUpdate() + { + throw new NotImplementedException(); + } } } diff --git a/源代码/StgSharp/Entities/EntityPartical.cs b/源代码/StgSharp/Entities/EntityPartical.cs index 758b6864..4ea2bd50 100644 --- a/源代码/StgSharp/Entities/EntityPartical.cs +++ b/源代码/StgSharp/Entities/EntityPartical.cs @@ -4,8 +4,8 @@ using System.Text; namespace StgSharp.Entities { - public class EntityPartical : Entity + public abstract class EntityPartical : IEntity { - + } } diff --git a/源代码/StgSharp/Entities/Entity.cs b/源代码/StgSharp/Entities/IEntity.cs similarity index 64% rename from 源代码/StgSharp/Entities/Entity.cs rename to 源代码/StgSharp/Entities/IEntity.cs index 3d2ee6c0..221c64d8 100644 --- a/源代码/StgSharp/Entities/Entity.cs +++ b/源代码/StgSharp/Entities/IEntity.cs @@ -6,23 +6,22 @@ using System.Text; namespace StgSharp { - public class Entity:INode + public abstract class IEntity:INode { internal Point _pos; - internal IGeometry _collisionBox; + internal LinkedList _collisionBox; internal Sensor _collisionSensor; - internal ContainerNode _id; - internal String _texture; + internal string _texture; internal Point _position; internal Point _basePoint; internal GetLocationHandler _movHandler; + protected uint _bornTick; - public IGeometry CollisionBox + public LinkedList CollisionBox { get { return _collisionBox; } set { _collisionBox = value; } } - /// /// A sensor used for cheking out if a bullet hit a player or something else @@ -50,32 +49,12 @@ namespace StgSharp /// public float Y { get; set; } - ContainerNode INode.ID - { - get { return _id; } - } - public void SetLocation(Point p) { _pos = p; } - void INode.setID(ContainerNode id) - { - if (id == null) - { - _id = id; - } - else - { - throw new ArgumentException("Cannot set id twice!"); - } - } - - public void OnRender() - { - _position._position = _movHandler.Invoke(_basePoint._position, Control.GameTimeLine.tickCounter); - } + internal abstract void OnRenderFrame(); } } diff --git a/源代码/StgSharp/Entities/Launcher.cs b/源代码/StgSharp/Entities/Launcher.cs index e390d766..dd6f82f6 100644 --- a/源代码/StgSharp/Entities/Launcher.cs +++ b/源代码/StgSharp/Entities/Launcher.cs @@ -6,14 +6,13 @@ using System.Text; namespace StgSharp { - public class Launcher:INode> where T : Entity + public class Launcher:INode> where T : IEntity { /* *用于发射其他的实体,主要是子弹 和 掉落物 */ internal vec2d _center; //发射器的参考位置,运动轨迹的方程应当基于这个参考点构建 - private ContainerNode> _id; internal Counter _internalParameter; //发射器的内部计时器 internal EntityPartical _bulletSample; //发射的子弹类型 internal uint[] launchtick; //发射子弹的内部计时 @@ -24,27 +23,12 @@ namespace StgSharp set { _bulletSample = value; } } - internal void Launch(Counter outerTickCounter, LinkedList container) + internal virtual void Launch(Counter outerTickCounter, LinkedList container) { } - ContainerNode> INode>.ID - { - get { return _id; } - } - - void INode>.setID(ContainerNode> id) - { - if (_id == default(ContainerNode>)) - { - throw new ArgumentException(); - } - else - { - _id = id; - } - } + } } diff --git a/源代码/StgSharp/Entities/Partical.cs b/源代码/StgSharp/Entities/Partical.cs index 2f13949b..f78463b6 100644 --- a/源代码/StgSharp/Entities/Partical.cs +++ b/源代码/StgSharp/Entities/Partical.cs @@ -5,8 +5,16 @@ using System.Text; namespace StgSharp { - public class Partical : Entity + public class Partical : IEntity { + public override void OnRender() + { + throw new NotImplementedException(); + } + public override void OnUpdate() + { + throw new NotImplementedException(); + } } } diff --git a/源代码/StgSharp/Entities/Player.cs b/源代码/StgSharp/Entities/Player.cs index 2e881018..ab6a184f 100644 --- a/源代码/StgSharp/Entities/Player.cs +++ b/源代码/StgSharp/Entities/Player.cs @@ -6,7 +6,7 @@ using System.Text; namespace StgSharp { - public class Player : Entity + public abstract class Player : IEntity { internal float _velocity; diff --git a/源代码/StgSharp/Geometries/Arc.cs b/源代码/StgSharp/Geometries/Arc.cs index d5ed5e71..a3d18d9c 100644 --- a/源代码/StgSharp/Geometries/Arc.cs +++ b/源代码/StgSharp/Geometries/Arc.cs @@ -43,21 +43,21 @@ namespace StgSharp.Geometries _center._position = _basePoint._position + MoveCenter(tick); } - internal sealed override void CalcVec02(vec2d vec, uint tick) + internal sealed override void CalcVec02(vec3d vec, uint tick) { _radius._position = vec + UpdateRadius(tick); } - internal sealed override void CalcVec03(StgSharp.Math.vec2d vec, uint tick) + internal sealed override void CalcVec03(vec3d vec, uint tick) { _angle._position = vec + UpdateAngle(tick); } - 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; - public virtual vec2d UpdateAngle(uint tick) => default; + public virtual vec3d UpdateAngle(uint tick) => default; internal override void OnRender(uint tick) { diff --git a/源代码/StgSharp/Geometries/IGeometry.cs b/源代码/StgSharp/Geometries/IGeometry.cs index c0c0c73b..bff80b89 100644 --- a/源代码/StgSharp/Geometries/IGeometry.cs +++ b/源代码/StgSharp/Geometries/IGeometry.cs @@ -8,7 +8,6 @@ namespace StgSharp.Geometries { public abstract class IGeometry:INode { - internal ContainerNode _id; private readonly uint bornTick; public abstract Point BasePoint { get; } @@ -28,27 +27,13 @@ namespace StgSharp.Geometries } internal abstract void CalcVec01(uint tick); - internal abstract void CalcVec02(vec2d vec, uint tick); - internal abstract void CalcVec03(vec2d vec, uint tick); + internal abstract void CalcVec02(vec3d vec, uint tick); + internal abstract void CalcVec03(vec3d vec, uint tick); internal abstract void OnRender(uint tick); public abstract RenderMode renderMode { get; } public abstract float SetArrayX(); public abstract float SetArrayY(); - - ContainerNode INode.ID => _id; - - void INode.setID(ContainerNode id) - { - if (_id != default) - { - throw new ArgumentException("Cannot set id twice"); - } - else - { - _id = id; - } - } } diff --git a/源代码/StgSharp/Geometries/IGeometryCombination.cs b/源代码/StgSharp/Geometries/IGeometryCombination.cs index 61885d1e..0557f512 100644 --- a/源代码/StgSharp/Geometries/IGeometryCombination.cs +++ b/源代码/StgSharp/Geometries/IGeometryCombination.cs @@ -6,6 +6,23 @@ namespace StgSharp.Geometries { public abstract class IGeometryCombination:LinkedList { + internal readonly uint _bornTick; + internal abstract void toSimpleGeometry(); + + public IGeometryCombination(uint bornTime) + { + _bornTick = bornTime; + } + + public IGeometryCombination(Counter timer) + { + _bornTick = timer._value; + } + + public IGeometryCombination() + { + + } } } diff --git a/源代码/StgSharp/Geometries/Line.cs b/源代码/StgSharp/Geometries/Line.cs index e53266ed..2927c6aa 100644 --- a/源代码/StgSharp/Geometries/Line.cs +++ b/源代码/StgSharp/Geometries/Line.cs @@ -50,19 +50,19 @@ namespace StgSharp.Geometries _beginPoint._position = _basePoint._position + MoveBeginPoint(tick); } - internal sealed override void CalcVec02(vec2d vec, uint tick) + internal sealed override void CalcVec02(vec3d vec, uint tick) { _endPoint._position = vec + MoveEndPoint(tick); } - internal sealed override void CalcVec03(vec2d vec, uint tick) + internal sealed override void CalcVec03(vec3d vec, uint tick) { throw new ArgumentException("Lines do not need the third parameter to define!"); } - public virtual vec2d MoveBeginPoint(uint tick) => default; + public virtual vec3d MoveBeginPoint(uint tick) => default; - public virtual vec2d MoveEndPoint(uint tick) => default; + public virtual vec3d MoveEndPoint(uint tick) => default; internal override void OnRender(uint tick) { diff --git a/源代码/StgSharp/Geometries/Point.cs b/源代码/StgSharp/Geometries/Point.cs index 148d9e10..bcb4dcdd 100644 --- a/源代码/StgSharp/Geometries/Point.cs +++ b/源代码/StgSharp/Geometries/Point.cs @@ -11,17 +11,8 @@ namespace StgSharp.Geometries { public class Point: INode { - internal StgSharp.ContainerNode _id; - internal vec2d _position; - - internal GetLocationHandler getXHandler; - internal GetLocationHandler getYHandler; - - ContainerNode INode.ID - { - get { return this._id; } - } + internal vec3d _position; public float X { @@ -33,21 +24,7 @@ namespace StgSharp.Geometries get { return this._position.Y; } } - void INode.setID(ContainerNode id) - { - if (id == null) - { - _id = id; - } - else - { - throw new ArgumentException("Cannot set id twice!"); - } - } + public void Update() => new NotImplementedException(); - public void OnRender() - { - this.getXHandler.Invoke(this._position, Control.GameTimeLine.tickCounter); - } } } diff --git a/源代码/StgSharp/Geometries/Polygon.cs b/源代码/StgSharp/Geometries/Polygon.cs new file mode 100644 index 00000000..044b9dc9 --- /dev/null +++ b/源代码/StgSharp/Geometries/Polygon.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Numerics; +using System.Text; + +namespace StgSharp.Geometries +{ + public class Polygon : IGeometryCombination + { + internal Point[] pointsArray; + + public Polygon(uint bornTime) : base(bornTime) + { + + } + + public Polygon(int pointNum) + { + pointsArray = new Point[pointNum]; + this.toSimpleGeometry(); + } + + public Polygon(Point[] pointsArray) + { + PointsArray = pointsArray; + this.toSimpleGeometry(); + } + + internal override void toSimpleGeometry() + { + Point begin = pointsArray[0]; + for (int i = 1; i <= pointsArray.Length; i++) + { + Triangle a = new Triangle(this._bornTick); + this.Add(a); + } + + } + + public Point[] PointsArray + { + get { return pointsArray; } + set { pointsArray = value; } + } + + + } +} diff --git a/源代码/StgSharp/Geometries/Rectangle.cs b/源代码/StgSharp/Geometries/Rectangle.cs index 88139660..fc474822 100644 --- a/源代码/StgSharp/Geometries/Rectangle.cs +++ b/源代码/StgSharp/Geometries/Rectangle.cs @@ -67,12 +67,12 @@ namespace StgSharp.Geometries _center._position = _basePoint._position + MovCenter(tick); } - internal override void CalcVec02(vec2d vec, uint tick) + internal override void CalcVec02(vec3d vec, uint tick) { _centerToCorner1._position = vec + UpdateCTC1(tick); } - internal override void CalcVec03(vec2d vec, uint tick) + internal override void CalcVec03(vec3d vec, uint tick) { _centerToCorner2._position = vec + UpdateCTC2(tick); if (_centerToCorner1._position.GetLength() @@ -83,10 +83,10 @@ namespace StgSharp.Geometries } } - public virtual vec2d MovCenter(uint tick)=>default(vec2d); + public virtual vec3d MovCenter(uint tick)=>default(vec3d); - public virtual vec2d UpdateCTC1(uint tick) => default(vec2d); + public virtual vec3d UpdateCTC1(uint tick) => default(vec3d); - public virtual vec2d UpdateCTC2(uint tick) => default(vec2d); + public virtual vec3d UpdateCTC2(uint tick) => default(vec3d); } } diff --git a/源代码/StgSharp/Geometries/Triangle.cs b/源代码/StgSharp/Geometries/Triangle.cs index c186db21..3551fd0c 100644 --- a/源代码/StgSharp/Geometries/Triangle.cs +++ b/源代码/StgSharp/Geometries/Triangle.cs @@ -41,21 +41,21 @@ namespace StgSharp.Geometries _beginPoint._position = _basePoint._position+ MovBegin(tick); } - internal override void CalcVec02(vec2d vec, uint tick) + internal override void CalcVec02(vec3d vec, uint tick) { _line1._position = vec + CalcSide1(tick); } - internal override void CalcVec03(vec2d vec, uint tick) + internal override void CalcVec03(vec3d vec, uint tick) { _line2._position = vec + CalcSide2(tick); } - public virtual vec2d MovBegin(uint tick) => default(vec2d); + public virtual vec3d MovBegin(uint tick) => default(vec3d); - public virtual vec2d CalcSide1(uint tick)=> default(vec2d); + public virtual vec3d CalcSide1(uint tick)=> default(vec3d); - public virtual vec2d CalcSide2(uint tick) => default(vec2d); + public virtual vec3d CalcSide2(uint tick) => default(vec3d); internal override sealed void OnRender(uint tick) { diff --git a/源代码/StgSharp/Logic/ContainerNode.cs b/源代码/StgSharp/Logic/ContainerNode.cs index 72f15795..7bab22be 100644 --- a/源代码/StgSharp/Logic/ContainerNode.cs +++ b/源代码/StgSharp/Logic/ContainerNode.cs @@ -5,11 +5,22 @@ using System.Text; namespace StgSharp { - public interface INode where T : INode + public abstract class INode where T : INode { + protected ContainerNode _id; internal ContainerNode ID { get; } - internal void setID(ContainerNode id); + internal void setID(ContainerNode id) + { + if (_id!=null) + { + throw new ArgumentException("Cannot set ID twice"); + } + else + { + _id = id; + } + } } diff --git a/源代码/StgSharp/Logic/Counter.cs b/源代码/StgSharp/Logic/Counter.cs index 04c04507..19752ae9 100644 --- a/源代码/StgSharp/Logic/Counter.cs +++ b/源代码/StgSharp/Logic/Counter.cs @@ -5,7 +5,7 @@ using System.Text; namespace StgSharp { - public class Counterwhere T:struct, IConvertible, IFormattable, IComparable + public class Counter where T:struct, IConvertible, IFormattable, IComparable { internal readonly dynamic _defualtValue; internal readonly dynamic _defualtAddValue; diff --git a/源代码/StgSharp/Logic/LinkedList.cs b/源代码/StgSharp/Logic/LinkedList.cs index c5362580..90feac54 100644 --- a/源代码/StgSharp/Logic/LinkedList.cs +++ b/源代码/StgSharp/Logic/LinkedList.cs @@ -35,8 +35,6 @@ namespace StgSharp set { _tail = new ContainerNode(value); } } - ContainerNode> INode>.ID => _id; - public void Add(T t) { if (_first != default(ContainerNode)) @@ -70,17 +68,5 @@ namespace StgSharp { return new LinkedListEnumrator(this); } - - void INode>.setID(ContainerNode> id) - { - if (_id == null) - { - throw new ArgumentException("Cannot set ID twice"); - } - else - { - _id = id; - } - } } } diff --git a/源代码/StgSharp/Logic/Pool.cs b/源代码/StgSharp/Logic/Pool.cs index 6114289d..6cfbf12a 100644 --- a/源代码/StgSharp/Logic/Pool.cs +++ b/源代码/StgSharp/Logic/Pool.cs @@ -13,9 +13,9 @@ namespace StgSharp { internal LinkedList pointContainer; internal LinkedList geometryContainer; - internal LinkedList _bulletContainer; - internal LinkedList _awardContainer; - internal LinkedList _enemyContainer; + internal LinkedList _bulletContainer; + internal LinkedList _awardContainer; + internal LinkedList _enemyContainer; internal Line leftBoader; internal Line rightBoader; @@ -45,9 +45,6 @@ namespace StgSharp } - - ContainerNode INode.ID => _id; - public void OnRender() { foreach (Enemy e in _enemyContainer) @@ -56,17 +53,7 @@ namespace StgSharp } } - void INode.setID(ContainerNode id) - { - if (_id == default) - { - _id = id; - } - else - { - throw new ArgumentException("Cannot set ID twicee!"); - } - } + } } diff --git a/源代码/StgSharp/Optimization/m128.cs b/源代码/StgSharp/Optimization/m128.cs new file mode 100644 index 00000000..11081215 --- /dev/null +++ b/源代码/StgSharp/Optimization/m128.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Optimization +{ + [StructLayout(LayoutKind.Explicit,Size =16)] + public struct m128 + { + [FieldOffset(0)] public float float0; + [FieldOffset(4)] public float float1; + [FieldOffset(8)] public float float2; + [FieldOffset(12)] public float float3; + + [FieldOffset(0)] public double double0; + [FieldOffset(8)] public double double1; + + [FieldOffset(0)] public int int0; + [FieldOffset(1)] public int int1; + [FieldOffset(2)] public int int2; + [FieldOffset(3)] public int int3; + + [FieldOffset(0)] public byte byte0; + [FieldOffset(1)] public byte byte1; + [FieldOffset(2)] public byte byte2; + [FieldOffset(3)] public byte byte3; + [FieldOffset(4)] public byte byte4; + [FieldOffset(5)] public byte byte5; + [FieldOffset(6)] public byte byte6; + [FieldOffset(7)] public byte byte7; + [FieldOffset(8)] public byte byte8; + [FieldOffset(9)] public byte byte9; + [FieldOffset(10)] public byte byte10; + [FieldOffset(11)] public byte byte11; + [FieldOffset(12)] public byte byte12; + [FieldOffset(13)] public byte byte13; + [FieldOffset(14)] public byte byte14; + [FieldOffset(15)] public byte byte15; + [FieldOffset(16)] public byte byte16; + + + public int[] ToIntArray() + { + return new int[4] { int0, int1, int2, int3 }; + } + + public float[] ToFloatArray() + { + return new float[4] { float0, float1, float2, float3 }; + } + + public byte[] ToByteArray() + { + return new byte[16] + { + byte0, byte1, byte2, byte3, + byte4, byte5, byte6, byte7, + byte8, byte9, byte10, byte11, + byte12, byte13, byte14, byte15, + }; + } + } +} diff --git a/源代码/StgSharp/obj/Debug/netstandard2.1/StgSharp.csproj.CoreCompileInputs.cache b/源代码/StgSharp/obj/Debug/netstandard2.1/StgSharp.csproj.CoreCompileInputs.cache index 3d509c4a..9a2d1df9 100644 --- a/源代码/StgSharp/obj/Debug/netstandard2.1/StgSharp.csproj.CoreCompileInputs.cache +++ b/源代码/StgSharp/obj/Debug/netstandard2.1/StgSharp.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -d9fddb3184a4632597eeeb36380d494aa4b8420f +96b7e2fc11bda4a0584ab313be1a6838a308d265 diff --git a/源代码/StgSharp/obj/StgSharp.csproj.nuget.dgspec.json b/源代码/StgSharp/obj/StgSharp.csproj.nuget.dgspec.json index b49228e4..2720f0a7 100644 --- a/源代码/StgSharp/obj/StgSharp.csproj.nuget.dgspec.json +++ b/源代码/StgSharp/obj/StgSharp.csproj.nuget.dgspec.json @@ -70,7 +70,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.101\\RuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.104\\RuntimeIdentifierGraph.json" } } } diff --git a/源代码/StgSharp/obj/project.assets.json b/源代码/StgSharp/obj/project.assets.json index ec46bb1c..bb10ef31 100644 --- a/源代码/StgSharp/obj/project.assets.json +++ b/源代码/StgSharp/obj/project.assets.json @@ -219,7 +219,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.101\\RuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.104\\RuntimeIdentifierGraph.json" } } } diff --git a/源代码/StgSharp/obj/project.nuget.cache b/源代码/StgSharp/obj/project.nuget.cache index cd3626dc..12e89084 100644 --- a/源代码/StgSharp/obj/project.nuget.cache +++ b/源代码/StgSharp/obj/project.nuget.cache @@ -1,6 +1,6 @@ { "version": 2, - "dgSpecHash": "E+9DVhmJD3iKjwnjVgkXQe4WBAHxK66OG5RQDU+mTSvAaJhypgeRYBYqAJ0ou3rs/5+fuoCbzhodIhbFOCCYPQ==", + "dgSpecHash": "b7aEyowdGs09IzFAv3MOrx4rzMEcigh5hl+s/yyP7FKdo0cO9N5KIV8YfZMV12QhBrdbtC46iQeAJmDZsWljEg==", "success": true, "projectFilePath": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\源代码\\StgSharp\\StgSharp.csproj", "expectedPackageFiles": [ diff --git a/源代码/StgSharpDebug/Program.cs b/源代码/StgSharpDebug/Program.cs index 9eb0a1b9..d45715f6 100644 --- a/源代码/StgSharpDebug/Program.cs +++ b/源代码/StgSharpDebug/Program.cs @@ -39,6 +39,11 @@ internal class Program } */ } + + public class MyNum : INode + { + + } } diff --git a/源代码/StgSharpDebug/obj/Debug/net6.0/StgSharpDebug.csproj.AssemblyReference.cache b/源代码/StgSharpDebug/obj/Debug/net6.0/StgSharpDebug.csproj.AssemblyReference.cache index fd2d6a6f..967b4da5 100644 Binary files a/源代码/StgSharpDebug/obj/Debug/net6.0/StgSharpDebug.csproj.AssemblyReference.cache and b/源代码/StgSharpDebug/obj/Debug/net6.0/StgSharpDebug.csproj.AssemblyReference.cache differ diff --git a/源代码/StgSharpDebug/obj/StgSharpDebug.csproj.nuget.dgspec.json b/源代码/StgSharpDebug/obj/StgSharpDebug.csproj.nuget.dgspec.json index 5d2bc635..9af10ffb 100644 --- a/源代码/StgSharpDebug/obj/StgSharpDebug.csproj.nuget.dgspec.json +++ b/源代码/StgSharpDebug/obj/StgSharpDebug.csproj.nuget.dgspec.json @@ -62,19 +62,19 @@ "downloadDependencies": [ { "name": "Microsoft.AspNetCore.App.Ref", - "version": "[6.0.12, 6.0.12]" + "version": "[6.0.15, 6.0.15]" }, { "name": "Microsoft.NETCore.App.Host.win-x64", - "version": "[6.0.12, 6.0.12]" + "version": "[6.0.15, 6.0.15]" }, { "name": "Microsoft.NETCore.App.Ref", - "version": "[6.0.12, 6.0.12]" + "version": "[6.0.15, 6.0.15]" }, { "name": "Microsoft.WindowsDesktop.App.Ref", - "version": "[6.0.12, 6.0.12]" + "version": "[6.0.15, 6.0.15]" } ], "frameworkReferences": { @@ -82,7 +82,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.101\\RuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.104\\RuntimeIdentifierGraph.json" } } }, @@ -152,7 +152,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.101\\RuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.104\\RuntimeIdentifierGraph.json" } } } diff --git a/源代码/StgSharpDebug/obj/project.assets.json b/源代码/StgSharpDebug/obj/project.assets.json index ca8340c2..1d66c948 100644 --- a/源代码/StgSharpDebug/obj/project.assets.json +++ b/源代码/StgSharpDebug/obj/project.assets.json @@ -225,19 +225,19 @@ "downloadDependencies": [ { "name": "Microsoft.AspNetCore.App.Ref", - "version": "[6.0.12, 6.0.12]" + "version": "[6.0.15, 6.0.15]" }, { "name": "Microsoft.NETCore.App.Host.win-x64", - "version": "[6.0.12, 6.0.12]" + "version": "[6.0.15, 6.0.15]" }, { "name": "Microsoft.NETCore.App.Ref", - "version": "[6.0.12, 6.0.12]" + "version": "[6.0.15, 6.0.15]" }, { "name": "Microsoft.WindowsDesktop.App.Ref", - "version": "[6.0.12, 6.0.12]" + "version": "[6.0.15, 6.0.15]" } ], "frameworkReferences": { @@ -245,7 +245,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.101\\RuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.104\\RuntimeIdentifierGraph.json" } } } diff --git a/源代码/StgSharpDebug/obj/project.nuget.cache b/源代码/StgSharpDebug/obj/project.nuget.cache index c9f9400b..b2edeb18 100644 --- a/源代码/StgSharpDebug/obj/project.nuget.cache +++ b/源代码/StgSharpDebug/obj/project.nuget.cache @@ -1,15 +1,15 @@ { "version": 2, - "dgSpecHash": "USQa9TRIOFrOtueb6s3fk/PEhZUaWdhZR7Ecxnxq9Zj3HUHBl/Kuh4G3rNG9QtA7ZKOVStap7P4CP93BwoPfFg==", + "dgSpecHash": "IOdj9Wl7bXRmrLhrs9zCVYzAAmO7CNv7OiL/xB3b75SDQc9Fs7AWXgdHQWQMAbsMSyZOUKmIfqFpw00u7EFM3A==", "success": true, "projectFilePath": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\源代码\\StgSharpDebug\\StgSharpDebug.csproj", "expectedPackageFiles": [ "C:\\Users\\Nitlo\\.nuget\\packages\\microsoft.csharp\\4.7.0\\microsoft.csharp.4.7.0.nupkg.sha512", "C:\\Users\\Nitlo\\.nuget\\packages\\steamworks.net\\20.1.0\\steamworks.net.20.1.0.nupkg.sha512", - "C:\\Users\\Nitlo\\.nuget\\packages\\microsoft.netcore.app.host.win-x64\\6.0.12\\microsoft.netcore.app.host.win-x64.6.0.12.nupkg.sha512", - "C:\\Users\\Nitlo\\.nuget\\packages\\microsoft.aspnetcore.app.ref\\6.0.12\\microsoft.aspnetcore.app.ref.6.0.12.nupkg.sha512", - "C:\\Users\\Nitlo\\.nuget\\packages\\microsoft.windowsdesktop.app.ref\\6.0.12\\microsoft.windowsdesktop.app.ref.6.0.12.nupkg.sha512", - "C:\\Users\\Nitlo\\.nuget\\packages\\microsoft.netcore.app.ref\\6.0.12\\microsoft.netcore.app.ref.6.0.12.nupkg.sha512" + "C:\\Users\\Nitlo\\.nuget\\packages\\microsoft.netcore.app.host.win-x64\\6.0.15\\microsoft.netcore.app.host.win-x64.6.0.15.nupkg.sha512", + "C:\\Users\\Nitlo\\.nuget\\packages\\microsoft.aspnetcore.app.ref\\6.0.15\\microsoft.aspnetcore.app.ref.6.0.15.nupkg.sha512", + "C:\\Users\\Nitlo\\.nuget\\packages\\microsoft.windowsdesktop.app.ref\\6.0.15\\microsoft.windowsdesktop.app.ref.6.0.15.nupkg.sha512", + "C:\\Users\\Nitlo\\.nuget\\packages\\microsoft.netcore.app.ref\\6.0.15\\microsoft.netcore.app.ref.6.0.15.nupkg.sha512" ], "logs": [] } \ No newline at end of file