Daily update on 20221023
This commit is contained in:
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{71FFD00B-B2B1-4D23-B80F-1FEDA55D3E7F}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>Debug</RootNamespace>
|
||||
<AssemblyName>Debug</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Stg_Sharp\StgSharp.csproj">
|
||||
<Project>{09e14fbb-ef63-496e-bfb2-2a47c1ee4111}</Project>
|
||||
<Name>StgSharp</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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")]
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
|
||||
Binary file not shown.
BIN
Binary file not shown.
@@ -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
|
||||
|
||||
+2
-2
@@ -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
|
||||
{
|
||||
+1
-1
@@ -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
|
||||
{
|
||||
+2
-2
@@ -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; }
|
||||
@@ -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
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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<uint> tickCounter;
|
||||
readonly private uint beginTick;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 创建一个圆的快速方法
|
||||
/// </summary>
|
||||
/// <param name="center">圆心</param>
|
||||
/// <param name="radius">半径</param>
|
||||
/// <param name="counter">游戏刻计数器</param>
|
||||
public Circle(Point center, float radius,Counter<uint> counter)
|
||||
{
|
||||
this._center = center;
|
||||
this._radius = radius;
|
||||
this.tickCounter = counter;
|
||||
this.beginTick = counter.Value;
|
||||
this._angle = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 在创建实例时设定圆的变化方式
|
||||
/// </summary>
|
||||
/// <param name="center">圆心</param>
|
||||
/// <param name="radius">半径初始值</param>
|
||||
/// <param name="counter">游戏刻计数器</param>
|
||||
/// <param name="rFunc">半径的时间函数</param>
|
||||
/// <param name="roFunc">角速度时间函数</param>
|
||||
public Circle(Point center, float radius, Counter<uint> 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];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -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;
|
||||
|
||||
+8
-6
@@ -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()
|
||||
{ }
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<uint> counter;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="c">点所在的圆</param>
|
||||
/// <param name="angle">点的初项</param>
|
||||
/// <param name="counts">阵列次数</param>
|
||||
/// <param name="gameTick">游戏刻计数器</param>
|
||||
public PointOnCircle(Circle c, float angle, uint counts, Counter<uint> 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));
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
-9
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -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<T>
|
||||
public unsafe class Counter<T> where T : struct
|
||||
{
|
||||
private T _value;
|
||||
|
||||
@@ -21,6 +21,8 @@ namespace Stg_Sharp.StgSharp_Logic
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Increase(T deltaValue)
|
||||
{
|
||||
//_value += deltaValue;
|
||||
+2
-3
@@ -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
|
||||
{
|
||||
+4
-7
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
+4
-4
@@ -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<int> _amountCounter;
|
||||
|
||||
+6
-5
@@ -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
|
||||
{
|
||||
@@ -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
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+21
-15
@@ -7,8 +7,8 @@
|
||||
<ProjectGuid>{09E14FBB-EF63-496E-BFB2-2A47C1EE4111}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Stg_Sharp</RootNamespace>
|
||||
<AssemblyName>Stg_Sharp</AssemblyName>
|
||||
<RootNamespace>StgSharp</RootNamespace>
|
||||
<AssemblyName>StgSharp</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
@@ -45,21 +45,27 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="StgControl.cs" />
|
||||
<Compile Include="Game\Class1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="StgSharp_Entity\Bullet.cs" />
|
||||
<Compile Include="StgSharp_Geometry\Circle.cs" />
|
||||
<Compile Include="StgSharp_Geometry\PointOnLine.cs" />
|
||||
<Compile Include="StgSharp_Geometry\PointOnCircle.cs" />
|
||||
<Compile Include="StgSharp_Geometry\Line.cs" />
|
||||
<Compile Include="StgSharp_Geometry\Point.cs" />
|
||||
<Compile Include="StgSharp_Geometry\Geometry.cs" />
|
||||
<Compile Include="StgSharp_Logic\GeometryContainer.cs" />
|
||||
<Compile Include="StgSharp_Logic\EntityContainer.cs" />
|
||||
<Compile Include="StgSharp_Logic\Counter.cs" />
|
||||
<Compile Include="StgSharp_Logic\LinkedList.cs" />
|
||||
<Compile Include="StgSharp_Logic\LinkedTarget.cs" />
|
||||
<Compile Include="Entity\Bullet.cs" />
|
||||
<Compile Include="Entity\Player.cs" />
|
||||
<Compile Include="Entity\Launcher.cs" />
|
||||
<Compile Include="Geometry\Circle.cs" />
|
||||
<Compile Include="Geometry\PointOnLine.cs" />
|
||||
<Compile Include="Geometry\PointOnCircle.cs" />
|
||||
<Compile Include="Geometry\Line.cs" />
|
||||
<Compile Include="Geometry\Point.cs" />
|
||||
<Compile Include="Geometry\Geometry.cs" />
|
||||
<Compile Include="Logic\GeometryContainer.cs" />
|
||||
<Compile Include="Logic\EntityContainer.cs" />
|
||||
<Compile Include="Logic\Counter.cs" />
|
||||
<Compile Include="Logic\LinkedList.cs" />
|
||||
<Compile Include="Logic\LinkedTarget.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="UI\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<None Include="OpenTK.dll.config" />
|
||||
<None Include="packages.config" />
|
||||
@@ -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++)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
Reference in New Issue
Block a user