diff --git a/源代码/.Net Framework/StgSharp/.vs/StgSharp_OldVersion/v17/.suo b/源代码/.Net Framework/StgSharp/.vs/StgSharp_OldVersion/v17/.suo index 5e9e8f9d..6f3dd79b 100644 Binary files a/源代码/.Net Framework/StgSharp/.vs/StgSharp_OldVersion/v17/.suo and b/源代码/.Net Framework/StgSharp/.vs/StgSharp_OldVersion/v17/.suo differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/01ddb3b5-83d9-4658-8ed6-0890a437fc6c.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/01ddb3b5-83d9-4658-8ed6-0890a437fc6c.vsidx deleted file mode 100644 index bc365b71..00000000 Binary files a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/01ddb3b5-83d9-4658-8ed6-0890a437fc6c.vsidx and /dev/null differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/510d61ee-a99b-4c0c-abbd-5ebe03ff3a13.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/510d61ee-a99b-4c0c-abbd-5ebe03ff3a13.vsidx new file mode 100644 index 00000000..0f2891cd Binary files /dev/null and b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/510d61ee-a99b-4c0c-abbd-5ebe03ff3a13.vsidx differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/9786444d-578d-489f-88fb-9bb40ffe072c.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/9786444d-578d-489f-88fb-9bb40ffe072c.vsidx new file mode 100644 index 00000000..f5eb2d75 Binary files /dev/null and b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/9786444d-578d-489f-88fb-9bb40ffe072c.vsidx differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/a48cc8f4-8cc2-47e6-8a18-ba3a95a9eb28.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/a48cc8f4-8cc2-47e6-8a18-ba3a95a9eb28.vsidx deleted file mode 100644 index 529cfd20..00000000 Binary files a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/a48cc8f4-8cc2-47e6-8a18-ba3a95a9eb28.vsidx and /dev/null differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/d878723f-78fd-4550-a563-4187b23fdbff.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/d878723f-78fd-4550-a563-4187b23fdbff.vsidx deleted file mode 100644 index 59094f4b..00000000 Binary files a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/d878723f-78fd-4550-a563-4187b23fdbff.vsidx and /dev/null differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/de54af4e-f344-427c-bdea-403358bc53e9.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/de54af4e-f344-427c-bdea-403358bc53e9.vsidx deleted file mode 100644 index cb915f81..00000000 Binary files a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/de54af4e-f344-427c-bdea-403358bc53e9.vsidx and /dev/null differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/e3cef5d3-cd36-4342-9a52-51658bf8f738.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/e3cef5d3-cd36-4342-9a52-51658bf8f738.vsidx new file mode 100644 index 00000000..8a02e2bb Binary files /dev/null and b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/e3cef5d3-cd36-4342-9a52-51658bf8f738.vsidx differ diff --git a/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/ed5a1361-d25d-4fa1-b7f7-3e5364f13249.vsidx b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/ed5a1361-d25d-4fa1-b7f7-3e5364f13249.vsidx new file mode 100644 index 00000000..9ec58c43 Binary files /dev/null and b/源代码/.Net Framework/Stg_Sharp/.vs/Stg_Sharp/FileContentIndex/ed5a1361-d25d-4fa1-b7f7-3e5364f13249.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 6310da6a..1d270bb9 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/App.config b/源代码/.Net Framework/Stg_Sharp/Debug/App.config new file mode 100644 index 00000000..56efbc7b --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Debug/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/源代码/.Net Framework/Stg_Sharp/Debug/Debug.csproj b/源代码/.Net Framework/Stg_Sharp/Debug/Debug.csproj new file mode 100644 index 00000000..ad6328c2 --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Debug/Debug.csproj @@ -0,0 +1,59 @@ + + + + + Debug + AnyCPU + {71FFD00B-B2B1-4D23-B80F-1FEDA55D3E7F} + Exe + Debug + Debug + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + {09e14fbb-ef63-496e-bfb2-2a47c1ee4111} + StgSharp + + + + \ No newline at end of file diff --git a/源代码/.Net Framework/Stg_Sharp/Debug/Program.cs b/源代码/.Net Framework/Stg_Sharp/Debug/Program.cs new file mode 100644 index 00000000..0d5664d1 --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Debug/Program.cs @@ -0,0 +1,17 @@ +using StgSharp; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Debug +{ + internal class Program + { + static void Main(string[] args) + { + + } + } +} diff --git a/源代码/.Net Framework/Stg_Sharp/Debug/Properties/AssemblyInfo.cs b/源代码/.Net Framework/Stg_Sharp/Debug/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..f875fb30 --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Debug/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("Debug")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Debug")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("71ffd00b-b2b1-4d23-b80f-1feda55d3e7f")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 +//通过使用 "*",如下所示: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/源代码/.Net Framework/Stg_Sharp/Debug/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/源代码/.Net Framework/Stg_Sharp/Debug/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 00000000..3871b184 --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Debug/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/源代码/.Net Framework/Stg_Sharp/Debug/obj/Debug/Debug.csproj.AssemblyReference.cache b/源代码/.Net Framework/Stg_Sharp/Debug/obj/Debug/Debug.csproj.AssemblyReference.cache new file mode 100644 index 00000000..442efad4 Binary files /dev/null and b/源代码/.Net Framework/Stg_Sharp/Debug/obj/Debug/Debug.csproj.AssemblyReference.cache differ diff --git a/源代码/.Net Framework/Stg_Sharp/Debug/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/源代码/.Net Framework/Stg_Sharp/Debug/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 00000000..5bcb6297 Binary files /dev/null and b/源代码/.Net Framework/Stg_Sharp/Debug/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp.sln b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp.sln index e7df955f..5a456b4c 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp.sln +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp.sln @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32825.248 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stg_Sharp", "Stg_Sharp\Stg_Sharp.csproj", "{09E14FBB-EF63-496E-BFB2-2A47C1EE4111}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StgSharp", "Stg_Sharp\StgSharp.csproj", "{09E14FBB-EF63-496E-BFB2-2A47C1EE4111}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Debug", "Debug\Debug.csproj", "{71FFD00B-B2B1-4D23-B80F-1FEDA55D3E7F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,6 +17,10 @@ Global {09E14FBB-EF63-496E-BFB2-2A47C1EE4111}.Debug|Any CPU.Build.0 = Debug|Any CPU {09E14FBB-EF63-496E-BFB2-2A47C1EE4111}.Release|Any CPU.ActiveCfg = Release|Any CPU {09E14FBB-EF63-496E-BFB2-2A47C1EE4111}.Release|Any CPU.Build.0 = Release|Any CPU + {71FFD00B-B2B1-4D23-B80F-1FEDA55D3E7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {71FFD00B-B2B1-4D23-B80F-1FEDA55D3E7F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {71FFD00B-B2B1-4D23-B80F-1FEDA55D3E7F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {71FFD00B-B2B1-4D23-B80F-1FEDA55D3E7F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Entity/Bullet.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Entity/Bullet.cs similarity index 98% rename from 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Entity/Bullet.cs rename to 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Entity/Bullet.cs index 34e67d89..0f92e26e 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Entity/Bullet.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Entity/Bullet.cs @@ -1,11 +1,11 @@ -using Stg_Sharp.StgSharp_Logic; +using StgSharp.Logic; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Stg_Sharp.StgSharp_Entity +namespace StgSharp.Entity { internal unsafe class Bullet : LinkedTarget { diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Entity/Launcher.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Entity/Launcher.cs similarity index 96% rename from 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Entity/Launcher.cs rename to 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Entity/Launcher.cs index 2fd93d62..d2d67334 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Entity/Launcher.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Entity/Launcher.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Stg_Sharp.StgSharp_Entity +namespace StgSharp.Entity { internal unsafe class Launcher { diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Entity/Player.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Entity/Player.cs similarity index 98% rename from 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Entity/Player.cs rename to 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Entity/Player.cs index c25afb5b..18f0d9f9 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Entity/Player.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Entity/Player.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Stg_Sharp.StgSharp_Entity +namespace StgSharp.Entity { internal class Player { @@ -62,7 +62,7 @@ namespace Stg_Sharp.StgSharp_Entity this._keyboardState = keyboardState; } - private Launcher _launcherAtHigh; + private Launcher _launcherAtHigh; public Launcher LauncherAtHigh { get { return LauncherAtHigh; } diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Game/Class1.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Game/Class1.cs new file mode 100644 index 00000000..a73442dd --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Game/Class1.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Game +{ + internal class Class1 + { + } +} diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Circle.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Circle.cs new file mode 100644 index 00000000..8e14ef03 --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Circle.cs @@ -0,0 +1,156 @@ +using StgSharp.Logic; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Geometry +{ + public unsafe class Circle : Geometry + { + private Point _center; + + public Point Center + { + get { return _center; } + set { _center = value; } + } + + private float _radius; + public float Radius + { + get { return _radius; } + set { _radius = value; } + } + + private float[] _radiusFunc; + + public float[] RadiusFunc + { + get { return _radiusFunc; } + set + { + if (value.Length == 10) + { + _radiusFunc = value; + } + else + { + throw new Exception("Parameters are too many or too few!"); + } + } + } + + private float _angle; + + public float Angle + { + get { return _angle; } + set { _angle = value; } + } + + private float[] _rotateFunc; + private float[] RotateFunc + { + get { return _rotateFunc; } + set + { + if (value.Length == 10) + { + _rotateFunc = value; + } + else + { + throw new Exception("Parameters are too many or too few!"); + } + } + } + + readonly private Counter tickCounter; + readonly private uint beginTick; + + + + /// + /// 创建一个圆的快速方法 + /// + /// 圆心 + /// 半径 + /// 游戏刻计数器 + public Circle(Point center, float radius,Counter counter) + { + this._center = center; + this._radius = radius; + this.tickCounter = counter; + this.beginTick = counter.Value; + this._angle = 0; + } + + + + /// + /// 在创建实例时设定圆的变化方式 + /// + /// 圆心 + /// 半径初始值 + /// 游戏刻计数器 + /// 半径的时间函数 + /// 角速度时间函数 + public Circle(Point center, float radius, Counter counter, float[] rFunc, float[] roFunc) + { + this._center = center; + this._radius = radius; + this.tickCounter = counter; + this.beginTick = counter.Value; + this._angle = 0; + + this.RadiusFunc = rFunc; + this.RotateFunc = roFunc; + } + + public void SetMotion(float[] rFunc, float[] roFunc) + { + if (rFunc!=null) + { + this.RadiusFunc = rFunc; + } + if (roFunc!=null) + { + this.RotateFunc = roFunc; + } + } + + public void AddPoint(float angle,uint number,GeometryContainer geometryPool) + { + PointOnCircle p; + for (int i = 0; i < number; i++) + { + p = new PointOnCircle(this, angle, number, tickCounter); + p.AddRotation(_rotateFunc); + geometryPool.Add(p); + } + } + + public 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]; + } + + } +} diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/Geometry.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Geometry.cs similarity index 75% rename from 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/Geometry.cs rename to 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Geometry.cs index 3c1bba42..7189c8c2 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/Geometry.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Geometry.cs @@ -1,13 +1,13 @@ -using Stg_Sharp.StgSharp_Logic; +using StgSharp.Logic; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Stg_Sharp.StgSharp_Geometry +namespace StgSharp.Geometry { - internal class Geometry : LinkedTarget + public class Geometry : LinkedTarget { public new LinkedTarget Previous { @@ -16,7 +16,7 @@ namespace Stg_Sharp.StgSharp_Geometry { if (value is Geometry) { - this.Previous = value; + _previous = value; } } } @@ -28,7 +28,7 @@ namespace Stg_Sharp.StgSharp_Geometry { if (value is Geometry) { - this.Next = value; + _next = value; } } } diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/Line.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Line.cs similarity index 90% rename from 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/Line.cs rename to 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Line.cs index 4ae9a419..9153e231 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/Line.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Line.cs @@ -4,9 +4,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Stg_Sharp.StgSharp_Geometry +namespace StgSharp.Geometry { - internal class Line + public class Line { private Point _beginPoint; diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/Point.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Point.cs similarity index 78% rename from 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/Point.cs rename to 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Point.cs index b74c34c7..ab1c7515 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/Point.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/Point.cs @@ -1,15 +1,15 @@ -using Stg_Sharp.StgSharp_Logic; +using StgSharp.Logic; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Stg_Sharp.StgSharp_Geometry +namespace StgSharp.Geometry { - internal class Point : LinkedTarget + public class Point : LinkedTarget { - private float _x; + internal float _x; public float X { @@ -17,7 +17,7 @@ namespace Stg_Sharp.StgSharp_Geometry set { _x = value; } } - private float _y; + internal float _y; public float Y { @@ -38,6 +38,8 @@ namespace Stg_Sharp.StgSharp_Geometry } public virtual void OnRender() - { } + { + + } } } diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointOnCircle.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointOnCircle.cs new file mode 100644 index 00000000..a044d0ab --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointOnCircle.cs @@ -0,0 +1,66 @@ +using StgSharp.Logic; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Geometry +{ + public unsafe class PointOnCircle : Point + { + private Circle _bindedItem; + + public Circle geometryItem + { + get { return _bindedItem; } + set { _bindedItem = value; } + } + + private float _angle0; + private float _angle; + + public float Angle + { + get { return _angle; } + set { _angle = value; } + } + + private float[] _angularVelocity; + private readonly uint beginTick; + private readonly Counter counter; + + /// + /// + /// + /// 点所在的圆 + /// 点的初项 + /// 阵列次数 + /// 游戏刻计数器 + public PointOnCircle(Circle c, float angle, uint counts, Counter gameTick) + { + _bindedItem = c; + _angle0 = (angle + counts * (360.0f / counts)) * (float)(2 * Math.PI / 360); + counter = gameTick; + beginTick = gameTick.Value; + } + + public void AddRotation(float[] aFunc) + { + if (aFunc.Length == 10) + { + _angularVelocity = aFunc; + } + else + { + throw new Exception("Parameters are too much or too few!"); + } + } + public override void OnRender() + { + _angle = _angle0 + _bindedItem.Angle; + this._x = (float)(_bindedItem.Center.X + _bindedItem.Radius * Math.Cos(_angle)); + this._y = (float)(_bindedItem.Center.X + _bindedItem.Radius * Math.Sin(_angle)); + } + } +} diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/PointOnLine.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointOnLine.cs similarity index 74% rename from 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/PointOnLine.cs rename to 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointOnLine.cs index 18510e7d..1aeb8732 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/PointOnLine.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Geometry/PointOnLine.cs @@ -4,9 +4,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Stg_Sharp.StgSharp_Geometry +namespace StgSharp.Geometry { - internal class PointOnLine : Point + public class PointOnLine : Point { private Point _beginPoint; @@ -31,9 +31,8 @@ namespace Stg_Sharp.StgSharp_Geometry get { return _angle; } set { _angle = value; } } - - - + + private float rate; public PointOnLine(Point beginPoint, Point endPoint, float rate, int number) @@ -44,16 +43,16 @@ namespace Stg_Sharp.StgSharp_Geometry _angle = (float)(Math.Atan2(endPoint.Y - beginPoint.Y, endPoint.X - beginPoint.Y)); rate = rate * number; - this.Y = beginPoint.Y + rate * (endPoint.Y - beginPoint.Y); - this.X = beginPoint.X + rate * (endPoint.X - beginPoint.X); + this._y = beginPoint.Y + rate * (endPoint.Y - beginPoint.Y); + this._x = beginPoint.X + rate * (endPoint.X - beginPoint.X); } public override void OnRender() { _angle = (float)(Math.Atan2(_endPoint.Y - _beginPoint.Y, _endPoint.X - _beginPoint.Y)); - this.Y = _beginPoint.Y + rate * (_endPoint.Y - _beginPoint.Y); - this.X = _beginPoint.X + rate * (_endPoint.X - _beginPoint.X); + this._y = _beginPoint.Y + rate * (_endPoint.Y - _beginPoint.Y); + this._x = _beginPoint.X + rate * (_endPoint.X - _beginPoint.X); } } } diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Logic/Counter.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/Counter.cs similarity index 85% rename from 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Logic/Counter.cs rename to 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/Counter.cs index 70fdbaaa..4e8e3688 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Logic/Counter.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/Counter.cs @@ -4,9 +4,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Stg_Sharp.StgSharp_Logic +namespace StgSharp.Logic { - internal class Counter + public unsafe class Counter where T : struct { private T _value; @@ -21,6 +21,8 @@ namespace Stg_Sharp.StgSharp_Logic } + + public void Increase(T deltaValue) { //_value += deltaValue; diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Logic/EntityContainer.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/EntityContainer.cs similarity index 96% rename from 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Logic/EntityContainer.cs rename to 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/EntityContainer.cs index 0c4d4463..318d0e40 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Logic/EntityContainer.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/EntityContainer.cs @@ -1,11 +1,10 @@ -using Stg_Sharp.StgSharp_Entity; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Stg_Sharp.StgSharp_Logic +namespace StgSharp.Logic { internal class EntityContainer { diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Logic/GeometryContainer.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/GeometryContainer.cs similarity index 84% rename from 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Logic/GeometryContainer.cs rename to 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/GeometryContainer.cs index c714a182..7f21fdcd 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Logic/GeometryContainer.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/GeometryContainer.cs @@ -1,13 +1,13 @@ -using Stg_Sharp.StgSharp_Geometry; +using StgSharp.Geometry; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Stg_Sharp.StgSharp_Logic +namespace StgSharp.Logic { - internal class GeometryContainer + public class GeometryContainer { private LinkedList _container; @@ -56,10 +56,7 @@ namespace Stg_Sharp.StgSharp_Logic public void Add(LinkedTarget t) { - if (t is Geometry) - { - _container.Add(t); - } + Container.Add(t); } } diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Logic/LinkedList.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedList.cs similarity index 95% rename from 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Logic/LinkedList.cs rename to 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedList.cs index 0047fd7c..e55030ff 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Logic/LinkedList.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedList.cs @@ -4,12 +4,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Stg_Sharp.StgSharp_Logic +namespace StgSharp.Logic { - internal class LinkedList + public class LinkedList { - private LinkedTarget _heading; - private LinkedTarget _ending; + internal LinkedTarget _heading; + internal LinkedTarget _ending; private LinkedTarget _cache; private Counter _amountCounter; diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Logic/LinkedTarget.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedTarget.cs similarity index 75% rename from 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Logic/LinkedTarget.cs rename to 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedTarget.cs index bff772cc..a0492ed4 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Logic/LinkedTarget.cs +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Logic/LinkedTarget.cs @@ -1,14 +1,15 @@ -using System; +using OpenTK.Graphics.ES20; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Stg_Sharp.StgSharp_Logic +namespace StgSharp.Logic { - internal class LinkedTarget + public class LinkedTarget { - private LinkedTarget _previous; + protected LinkedTarget _previous; public LinkedTarget Previous { @@ -23,7 +24,7 @@ namespace Stg_Sharp.StgSharp_Logic } } - private LinkedTarget _next; + protected LinkedTarget _next; public LinkedTarget Next { diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgControl.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgControl.cs new file mode 100644 index 00000000..5add5d74 --- /dev/null +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgControl.cs @@ -0,0 +1,17 @@ +using StgSharp.Geometry; +using StgSharp.Logic; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp +{ + public class StgControl + { + + + + } +} diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Stg_Sharp.csproj b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp.csproj similarity index 73% rename from 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Stg_Sharp.csproj rename to 源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp.csproj index 956fea10..eb301944 100644 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/Stg_Sharp.csproj +++ b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp.csproj @@ -7,8 +7,8 @@ {09E14FBB-EF63-496E-BFB2-2A47C1EE4111} Library Properties - Stg_Sharp - Stg_Sharp + StgSharp + StgSharp v4.7.2 512 true @@ -45,21 +45,27 @@ + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/Circle.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/Circle.cs deleted file mode 100644 index 52e7f880..00000000 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/Circle.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Stg_Sharp.StgSharp_Logic; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Stg_Sharp.StgSharp_Geometry -{ - internal unsafe class Circle : Geometry - { - private Point _center; - - public Point Center - { - get { return _center; } - set { _center = value; } - } - - - private float _radius; - public float Radius - { - get { return _radius; } - set { _radius = value; } - } - - public Circle(Point center, float radius) - { - this._center = center; - this._radius = radius; - } - - public void BindPoint(float angle, int number, GeometryContainer geoItemPool) - { - - for (int i = 1; i <= number; i++) - { - - } - } - - } -} diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/PointOnCircle.cs b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/PointOnCircle.cs deleted file mode 100644 index bbc1c164..00000000 --- a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/StgSharp_Geometry/PointOnCircle.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Stg_Sharp.StgSharp_Geometry -{ - internal unsafe class PointOnCircle : Point - { - private Circle _bindedItem; - - public Circle geometryItem - { - get { return _bindedItem; } - set { _bindedItem = value; } - } - - private float _angle; - - public float Angle - { - get { return _angle; } - set { _angle = value; } - } - - private float[] _angularVelocity; - private readonly uint beginTick; - private readonly uint* nowtick; - - public PointOnCircle(Circle c, float p, float angle, uint counts, uint* gameTick) - { - _bindedItem = c; - _angle = (angle + counts * (360.0f / counts)) * (float)(2 * Math.PI / 360); - nowtick = gameTick; - beginTick = *gameTick; - } - - public void AddRotation(float[] aFunc) - { - if (aFunc.Length == 10) - { - _angularVelocity = aFunc; - } - else - { - throw new Exception("Parameters are too much or too few!"); - } - } - public override void OnRender() - { - if (_angularVelocity != null) - { - uint a = *nowtick - beginTick; - float deltaAngle = 0; - for (int i = 0; i < 10; i++) - { - deltaAngle += _angularVelocity[i]; - deltaAngle *= a; - } - _angle += deltaAngle; - } - - this.X = (float)(_bindedItem.Center.X + _bindedItem.Radius * Math.Cos(_angle)); - this.Y = (float)(_bindedItem.Center.X + _bindedItem.Radius * Math.Sin(_angle)); - - } - } -} diff --git a/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/obj/Debug/StgSharp.csproj.AssemblyReference.cache b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/obj/Debug/StgSharp.csproj.AssemblyReference.cache new file mode 100644 index 00000000..ce0f8f05 Binary files /dev/null and b/源代码/.Net Framework/Stg_Sharp/Stg_Sharp/obj/Debug/StgSharp.csproj.AssemblyReference.cache differ