diff --git a/源代码/.Net/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 b/源代码/.Net/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 index 37909dd7..7cbddd73 100644 Binary files a/源代码/.Net/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 and b/源代码/.Net/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 differ diff --git a/源代码/.Net/.vs/ProjectEvaluation/stgsharp.projects.v5.1 b/源代码/.Net/.vs/ProjectEvaluation/stgsharp.projects.v5.1 index 3504c6a9..e67c3eee 100644 Binary files a/源代码/.Net/.vs/ProjectEvaluation/stgsharp.projects.v5.1 and b/源代码/.Net/.vs/ProjectEvaluation/stgsharp.projects.v5.1 differ diff --git a/源代码/.Net/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 b/源代码/.Net/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 index dc2b804e..af7f9cef 100644 Binary files a/源代码/.Net/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 and b/源代码/.Net/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 differ diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/07b2d65b-b2c2-40bc-a4bc-097c200571d5.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/07b2d65b-b2c2-40bc-a4bc-097c200571d5.vsidx deleted file mode 100644 index 5093a873..00000000 Binary files a/源代码/.Net/.vs/StgSharp/FileContentIndex/07b2d65b-b2c2-40bc-a4bc-097c200571d5.vsidx and /dev/null differ diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/0c557f91-9a0a-4d1b-8307-dceb90ab8eaf.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/0c557f91-9a0a-4d1b-8307-dceb90ab8eaf.vsidx deleted file mode 100644 index ca77d449..00000000 Binary files a/源代码/.Net/.vs/StgSharp/FileContentIndex/0c557f91-9a0a-4d1b-8307-dceb90ab8eaf.vsidx and /dev/null differ diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/5032e5c0-d80d-4d9c-9704-e366cb27caae.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/5032e5c0-d80d-4d9c-9704-e366cb27caae.vsidx new file mode 100644 index 00000000..f0e39f58 Binary files /dev/null and b/源代码/.Net/.vs/StgSharp/FileContentIndex/5032e5c0-d80d-4d9c-9704-e366cb27caae.vsidx differ diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/69c9e653-1f5d-44cc-82ea-990a5f897086.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/69c9e653-1f5d-44cc-82ea-990a5f897086.vsidx new file mode 100644 index 00000000..2640e2ce Binary files /dev/null and b/源代码/.Net/.vs/StgSharp/FileContentIndex/69c9e653-1f5d-44cc-82ea-990a5f897086.vsidx differ diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/6b7598c3-e340-433b-ba18-617d267e2e5e.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/6b7598c3-e340-433b-ba18-617d267e2e5e.vsidx deleted file mode 100644 index c37d41c4..00000000 Binary files a/源代码/.Net/.vs/StgSharp/FileContentIndex/6b7598c3-e340-433b-ba18-617d267e2e5e.vsidx and /dev/null differ diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/6e3a29d5-5d0c-4a86-ae19-9050f3f1b74f.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/6e3a29d5-5d0c-4a86-ae19-9050f3f1b74f.vsidx new file mode 100644 index 00000000..bbca341f Binary files /dev/null and b/源代码/.Net/.vs/StgSharp/FileContentIndex/6e3a29d5-5d0c-4a86-ae19-9050f3f1b74f.vsidx differ diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/d055ba80-e653-485e-a079-70ffcec6f92c.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/afc162e6-e0e6-4720-ac47-1dad9aa6de0b.vsidx similarity index 85% rename from 源代码/.Net/.vs/StgSharp/FileContentIndex/d055ba80-e653-485e-a079-70ffcec6f92c.vsidx rename to 源代码/.Net/.vs/StgSharp/FileContentIndex/afc162e6-e0e6-4720-ac47-1dad9aa6de0b.vsidx index aff7b4e8..235ac695 100644 Binary files a/源代码/.Net/.vs/StgSharp/FileContentIndex/d055ba80-e653-485e-a079-70ffcec6f92c.vsidx and b/源代码/.Net/.vs/StgSharp/FileContentIndex/afc162e6-e0e6-4720-ac47-1dad9aa6de0b.vsidx differ diff --git a/源代码/.Net/.vs/StgSharp/v17/.suo b/源代码/.Net/.vs/StgSharp/v17/.suo index c75ed1e3..c4fdb41d 100644 Binary files a/源代码/.Net/.vs/StgSharp/v17/.suo and b/源代码/.Net/.vs/StgSharp/v17/.suo differ diff --git a/源代码/.Net/StgSharp/Entities/IEntity.cs b/源代码/.Net/StgSharp/Entities/IEntity.cs index 9407bfb0..ebe150f7 100644 --- a/源代码/.Net/StgSharp/Entities/IEntity.cs +++ b/源代码/.Net/StgSharp/Entities/IEntity.cs @@ -1,5 +1,4 @@ -using StgSharp; -using StgSharp.Vector; +using StgSharp.Math; using System; using System.Collections.Generic; using System.Text; diff --git a/源代码/.Net/StgSharp/Entities/Launcher.cs b/源代码/.Net/StgSharp/Entities/Launcher.cs index b2b11383..c9247062 100644 --- a/源代码/.Net/StgSharp/Entities/Launcher.cs +++ b/源代码/.Net/StgSharp/Entities/Launcher.cs @@ -6,6 +6,12 @@ namespace StgSharp { public class Launcher { - + internal Partical _bullet; + + public Partical Bullet + { + get { return _bullet; } + set { _bullet = value; } + } } } diff --git a/源代码/.Net/StgSharp/Entities/Partical.cs b/源代码/.Net/StgSharp/Entities/Partical.cs index 3914e8bb..16dc2a68 100644 --- a/源代码/.Net/StgSharp/Entities/Partical.cs +++ b/源代码/.Net/StgSharp/Entities/Partical.cs @@ -1,4 +1,4 @@ -using StgSharp.Vector; +using StgSharp.Math; using System; using System.Collections.Generic; using System.Text; diff --git a/源代码/.Net/StgSharp/Vector/Vec2x1.cs b/源代码/.Net/StgSharp/Vector/Vec2D.cs similarity index 97% rename from 源代码/.Net/StgSharp/Vector/Vec2x1.cs rename to 源代码/.Net/StgSharp/Vector/Vec2D.cs index 3e4342c5..0b21d28a 100644 --- a/源代码/.Net/StgSharp/Vector/Vec2x1.cs +++ b/源代码/.Net/StgSharp/Vector/Vec2D.cs @@ -1,10 +1,9 @@ -using StgSharp.Math; -using System; +using System; using System.Collections.Generic; using System.Data.Common; using System.Text; -namespace StgSharp.Vector +namespace StgSharp.Math { public struct Vec2D:IEquatable { @@ -98,5 +97,6 @@ namespace StgSharp.Vector { return this.X * others.Y - this.Y * others.X; } + } } diff --git a/源代码/.Net/StgSharp/Vector/Vec3D.cs b/源代码/.Net/StgSharp/Vector/Vec3D.cs new file mode 100644 index 00000000..2e179fe4 --- /dev/null +++ b/源代码/.Net/StgSharp/Vector/Vec3D.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.Data.Common; +using System.Text; + +namespace StgSharp.Math +{ + public struct Vec3D : IEquatable + { + public float X; + public float Y; + public float Z; + + public Vec3D(float x, float y, float z) + { + X = x; + Y = y; + Z = z; + } + + bool IEquatable.Equals(Vec3D other) + { + if (this.GetHashCode() != other.GetHashCode()) + { + return false; + } + else + { + return this.X == other.X + && this.Y == other.Y + && this.Z == other.Z; + } + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + else if (obj.GetType() != typeof(Vec3D)) + { + return false; + } + else + { + return this.Equals((Vec3D)obj); + } + } + + public override int GetHashCode() + { + return HashCode.Combine(X, Y, Z); + } + + public override string ToString() + { + return $"{X},{Y},{Z}"; + } + + public static bool operator ==(Vec3D vec1,Vec3D vec2) + { + return vec1.X == vec2.X + && vec1.Y == vec2.Y + && vec1.Z == vec2.Z; + } + + public static bool operator !=(Vec3D vec1, Vec3D vec2) + { + return !(vec1.X == vec2.X + && vec1.Y == vec2.Y + && vec1.Z == vec2.Z); + } + + public static Vec3D operator +(Vec3D vec1, Vec3D vec2) + { + return new Vec3D( + vec1.X + vec2.X, + vec1.Y + vec2.Y, + vec1.Z + vec2.Z + ); + } + + public static Vec3D operator -(Vec3D vec1, Vec3D vec2) + { + return new Vec3D( + vec1.X - vec2.X, + vec1.Y - vec2.Y, + vec1.Z - vec2.Z + ); + } + + public static Vec3D operator *(Vec3D vec, float x) + { + return new Vec3D( + vec.X * x, + vec.Y * x, + vec.Z * x + ); + } + + public static Vec3D operator /(Vec3D vec, float x) + { + return new Vec3D( + vec.X / x, + vec.Y / x, + vec.Z / x + ); + } + + } +}