Daily update on 20221022
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FreeFileSync XmlType="BATCH" XmlFormat="17">
|
||||
<Compare>
|
||||
<Variant>Content</Variant>
|
||||
<Symlinks>Exclude</Symlinks>
|
||||
<IgnoreTimeShift/>
|
||||
</Compare>
|
||||
<Synchronize>
|
||||
<Variant>Update</Variant>
|
||||
<DetectMovedFiles>false</DetectMovedFiles>
|
||||
<DeletionPolicy>Versioning</DeletionPolicy>
|
||||
<VersioningFolder Style="TimeStamp-Folder">A:\荷城工业\研究项目\1-旗舰级\东方同人TH2020\历史版本</VersioningFolder>
|
||||
</Synchronize>
|
||||
<Filter>
|
||||
<Include>
|
||||
<Item>*</Item>
|
||||
</Include>
|
||||
<Exclude>
|
||||
<Item>\System Volume Information\</Item>
|
||||
<Item>\$Recycle.Bin\</Item>
|
||||
<Item>\RECYCLE?\</Item>
|
||||
<Item>*\thumbs.db</Item>
|
||||
</Exclude>
|
||||
<TimeSpan Type="None">0</TimeSpan>
|
||||
<SizeMin Unit="None">0</SizeMin>
|
||||
<SizeMax Unit="None">0</SizeMax>
|
||||
</Filter>
|
||||
<FolderPairs>
|
||||
<Pair>
|
||||
<Left>D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile</Left>
|
||||
<Right>A:\荷城工业\研究项目\1-旗舰级\东方同人TH2020\工程</Right>
|
||||
</Pair>
|
||||
</FolderPairs>
|
||||
<Errors Ignore="false" Retry="0" Delay="5"/>
|
||||
<PostSyncCommand Condition="Completion"/>
|
||||
<LogFolder>A:\荷城工业\研究项目\1-旗舰级\东方同人TH2020\历史版本\同步日志</LogFolder>
|
||||
<EmailNotification Condition="Always"/>
|
||||
<Batch>
|
||||
<ProgressDialog Minimized="true" AutoClose="false"/>
|
||||
<ErrorDialog>Show</ErrorDialog>
|
||||
<PostSyncAction>None</PostSyncAction>
|
||||
</Batch>
|
||||
</FreeFileSync>
|
||||
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.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp_Geometry
|
||||
{
|
||||
internal unsafe class Circle
|
||||
internal unsafe class Circle:Geometry
|
||||
{
|
||||
private Point _center;
|
||||
|
||||
@@ -31,8 +31,9 @@ namespace StgSharp_Geometry
|
||||
this._radius = radius;
|
||||
}
|
||||
|
||||
public void BindPoint(float angle,int number,SimpleContainer geoItemPool)
|
||||
public void BindPoint(float angle,int number,GeometryContainer geoItemPool)
|
||||
{
|
||||
|
||||
for (int i = 1; i <= number; i++)
|
||||
{
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
using StgSharp_Geometry;
|
||||
using StgSharp_Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Design;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp_Geometry
|
||||
{
|
||||
internal class Geometry:LinkedTarget
|
||||
{
|
||||
public new LinkedTarget Previous
|
||||
{
|
||||
get { return this.Previous; }
|
||||
set
|
||||
{
|
||||
if (value is Geometry)
|
||||
{
|
||||
this.Previous = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public new LinkedTarget Next
|
||||
{
|
||||
get { return this.Next; }
|
||||
set
|
||||
{
|
||||
if (value is Geometry)
|
||||
{
|
||||
this.Next = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Add()
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp_Geometry
|
||||
{
|
||||
internal class Line
|
||||
{
|
||||
private Point _beginPoint;
|
||||
|
||||
public Point BeginPoint
|
||||
{
|
||||
get { return _beginPoint; }
|
||||
set { _beginPoint = value; }
|
||||
}
|
||||
|
||||
private Point _endingPoint;
|
||||
|
||||
public Point EndingPoint
|
||||
{
|
||||
get { return _endingPoint; }
|
||||
set { _endingPoint = value; }
|
||||
}
|
||||
|
||||
public Line(Point begin,Point end)
|
||||
{
|
||||
_beginPoint= begin;
|
||||
_endingPoint= end;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,20 @@ namespace StgSharp_Geometry
|
||||
set { _y = value; }
|
||||
}
|
||||
|
||||
|
||||
public new LinkedTarget Next
|
||||
{
|
||||
get { return this.Next; }
|
||||
set
|
||||
{
|
||||
if (value is Point)
|
||||
{
|
||||
this.Next = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnRender()
|
||||
{ }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp_Geometry
|
||||
{
|
||||
internal class PointOnCircle : Point
|
||||
internal unsafe class PointOnCircle : Point
|
||||
{
|
||||
private Circle _bindedItem;
|
||||
|
||||
@@ -25,12 +25,15 @@ namespace StgSharp_Geometry
|
||||
}
|
||||
|
||||
private float[] _angularVelocity;
|
||||
private readonly uint beginTick;
|
||||
private readonly uint* nowtick;
|
||||
|
||||
public PointOnCircle(Circle c, float p, float angle, int counts)
|
||||
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)
|
||||
@@ -44,18 +47,20 @@ namespace StgSharp_Geometry
|
||||
throw new Exception("Parameters are too much or too few!");
|
||||
}
|
||||
}
|
||||
public void onRender()
|
||||
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));
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp_Geometry
|
||||
{
|
||||
internal class PointOnLine : Point
|
||||
{
|
||||
private Point _beginPoint;
|
||||
|
||||
public Point BeginPoint
|
||||
{
|
||||
get { return _beginPoint; }
|
||||
set { _beginPoint = value; }
|
||||
}
|
||||
|
||||
private Point _endPoint;
|
||||
|
||||
public Point EndPoint
|
||||
{
|
||||
get { return _endPoint; }
|
||||
set { _endPoint = value; }
|
||||
}
|
||||
|
||||
private float _angle;
|
||||
|
||||
public float Angle
|
||||
{
|
||||
get { return _angle; }
|
||||
set { _angle = value; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
private float rate;
|
||||
|
||||
public PointOnLine(Point beginPoint,Point endPoint,float rate,int number)
|
||||
{
|
||||
_beginPoint = beginPoint;
|
||||
_endPoint = endPoint;
|
||||
|
||||
_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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,9 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Circle.cs" />
|
||||
<Compile Include="Geometry.cs" />
|
||||
<Compile Include="Line.cs" />
|
||||
<Compile Include="PointOnLine.cs" />
|
||||
<Compile Include="PointOnCircle.cs" />
|
||||
<Compile Include="Point.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Bullets.cs" />
|
||||
<Compile Include="debug.cs" />
|
||||
<Compile Include="EntityPool.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,21 +0,0 @@
|
||||
|
||||
using OpenTK;
|
||||
using OpenTK.Input;
|
||||
using StgSharp_Entity;
|
||||
using StgSharp_Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
static unsafe void Main()
|
||||
{
|
||||
Console.WriteLine(typeof(Bullet).Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||
namespace StgSharp_Entity
|
||||
{
|
||||
|
||||
public class Bullet:LinkedTarget
|
||||
public unsafe class Bullet:LinkedTarget
|
||||
{
|
||||
|
||||
//子弹的缩放比例
|
||||
@@ -85,21 +85,21 @@ namespace StgSharp_Entity
|
||||
}
|
||||
}
|
||||
|
||||
private float _xVertical;
|
||||
private float* _x;
|
||||
|
||||
//xy坐标
|
||||
public float XVertical
|
||||
public float* X
|
||||
{
|
||||
get { return _xVertical; }
|
||||
set { _xVertical = value; }
|
||||
get { return _x; }
|
||||
set { _x = value; }
|
||||
}
|
||||
|
||||
private float _yVertical;
|
||||
private float* _y;
|
||||
|
||||
public float YVertical
|
||||
public float* Y
|
||||
{
|
||||
get { return _yVertical; }
|
||||
set { _yVertical = value; }
|
||||
get { return _y; }
|
||||
set { _y = value; }
|
||||
}
|
||||
|
||||
private uint _beginTick;
|
||||
@@ -110,6 +110,9 @@ namespace StgSharp_Entity
|
||||
set { _beginTick = value; }
|
||||
}
|
||||
|
||||
public Bullet()
|
||||
{
|
||||
}
|
||||
|
||||
//通过传入的时间刻计算位移并更新位置坐标
|
||||
public void move(uint tick)
|
||||
@@ -122,7 +125,7 @@ namespace StgSharp_Entity
|
||||
deltaX *= deltaTick;
|
||||
}
|
||||
deltaX += _xVelocity[10];
|
||||
_xVertical += deltaX;
|
||||
*_x += deltaX;
|
||||
float deltaY = 0;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
@@ -130,34 +133,32 @@ namespace StgSharp_Entity
|
||||
deltaY *= deltaTick;
|
||||
}
|
||||
deltaY += _yVelocity[10];
|
||||
_yVertical += deltaY;
|
||||
*_y += deltaY;
|
||||
}
|
||||
|
||||
public Bullet()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 修改自身路径,修改条件由外部逻辑判断触发
|
||||
/// </summary>
|
||||
public void ChangeVelocity(float[] newXSpeed,float[] newYSpeed)
|
||||
public void ChangeVelocity(float[] XSpeed,float[] YSpeed)
|
||||
{
|
||||
if (newXSpeed != null)
|
||||
if (XSpeed != null)
|
||||
{
|
||||
if (newXSpeed.Length == 10)
|
||||
if (XSpeed.Length == 10)
|
||||
{
|
||||
this._xVelocity = newXSpeed;
|
||||
this._xVelocity = XSpeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("The amount of parameters should be 10!");
|
||||
}
|
||||
}
|
||||
if (newYSpeed != null)
|
||||
if (YSpeed != null)
|
||||
{
|
||||
if (newYSpeed.Length == 10)
|
||||
if (YSpeed.Length == 10)
|
||||
{
|
||||
this._yVelocity = newYSpeed;
|
||||
this._yVelocity = YSpeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -50,11 +50,10 @@ namespace StgSharp_Logic
|
||||
|
||||
public void Add(LinkedTarget target)
|
||||
{
|
||||
if (true)
|
||||
if (true) //对target类型进行判断,应当只是实体
|
||||
{
|
||||
|
||||
}
|
||||
_container.Add(target);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveAt(int id)
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
|
||||
using OpenTK;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp_Logic
|
||||
{
|
||||
public class GeometryContainer
|
||||
{
|
||||
private LinkedList _container;
|
||||
|
||||
public LinkedList Container
|
||||
{
|
||||
get { return _container; }
|
||||
set { _container = value; }
|
||||
}
|
||||
|
||||
private float _leftBorder;
|
||||
|
||||
public float LeftBorder
|
||||
{
|
||||
get { return _leftBorder; }
|
||||
set { _leftBorder = value; }
|
||||
}
|
||||
|
||||
private float _rightBorder;
|
||||
|
||||
public float RightBorder
|
||||
{
|
||||
get { return _rightBorder; }
|
||||
set { _rightBorder = value; }
|
||||
}
|
||||
|
||||
private float _upBorder;
|
||||
|
||||
public float UpBorder
|
||||
{
|
||||
get { return _upBorder; }
|
||||
set { _upBorder = value; }
|
||||
}
|
||||
|
||||
private float _downBorder;
|
||||
|
||||
public float DownBorder
|
||||
{
|
||||
get { return _downBorder; }
|
||||
set { _downBorder = value; }
|
||||
}
|
||||
|
||||
|
||||
public GeometryContainer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void Add(LinkedTarget t)
|
||||
{
|
||||
_container.Add(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using OpenTK;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp_Logic
|
||||
{
|
||||
public class SimpleContainer
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="SimpleContainer.cs" />
|
||||
<Compile Include="GeometryContainer.cs" />
|
||||
<Compile Include="LinkedList.cs" />
|
||||
<Compile Include="LinkedTarget.cs" />
|
||||
<Compile Include="Counter.cs" />
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
db769c63e34adb286b6eefdc1550008efc594664
|
||||
7ca1e6081e494ab105ef5baa469f5f9fc4ab8d06
|
||||
|
||||
Binary file not shown.
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,25 @@
|
||||
|
||||
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}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{09E14FBB-EF63-496E-BFB2-2A47C1EE4111}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{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
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {D9288FB8-3C06-4172-A2B4-11D58F0792F5}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,25 @@
|
||||
<configuration>
|
||||
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
|
||||
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
|
||||
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
|
||||
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
|
||||
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
|
||||
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
|
||||
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
|
||||
<dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
|
||||
<dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
|
||||
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
|
||||
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
|
||||
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
|
||||
<dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
|
||||
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
|
||||
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
|
||||
<dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
|
||||
<!-- XQuartz compatibility (X11 on Mac) -->
|
||||
<dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
|
||||
<dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
|
||||
<dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
|
||||
<dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
|
||||
<dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
|
||||
<dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
|
||||
</configuration>
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("Stg_Sharp")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Stg_Sharp")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("09e14fbb-ef63-496e-bfb2-2a47c1ee4111")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,173 @@
|
||||
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_Entity
|
||||
{
|
||||
internal unsafe class Bullet : LinkedTarget
|
||||
{
|
||||
|
||||
//子弹的缩放比例
|
||||
private float _size;
|
||||
|
||||
public float Size
|
||||
{
|
||||
get { return _size; }
|
||||
set
|
||||
{
|
||||
if (value > 0)
|
||||
{
|
||||
_size = value;
|
||||
this.Radius = DefualtRadius * Size;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Size cannot be smaller than zero!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//该种类子弹的默认大小
|
||||
private static float _defualtRadius;
|
||||
|
||||
public static float DefualtRadius
|
||||
{
|
||||
get { return _defualtRadius; }
|
||||
set { _defualtRadius = value; }
|
||||
}
|
||||
|
||||
//子弹的实际判定半径
|
||||
private float _radius;
|
||||
|
||||
public float Radius
|
||||
{
|
||||
get { return _radius; }
|
||||
set { _radius = value; }
|
||||
}
|
||||
|
||||
//子弹x轴运动的函数表达
|
||||
private float[] _xVelocity;
|
||||
|
||||
public float[] XVelocity
|
||||
{
|
||||
get { return _xVelocity; }
|
||||
set
|
||||
{
|
||||
if (value.Length == 10)
|
||||
{
|
||||
_xVelocity = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Too many or too few parameters!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//子弹y轴运动的函数表达
|
||||
private float[] _yVelocity;
|
||||
|
||||
public float[] YVelocity
|
||||
{
|
||||
get { return _yVelocity; }
|
||||
set
|
||||
{
|
||||
if (value.Length == 10)
|
||||
{
|
||||
_yVelocity = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Too many or too few parameters!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private float* _x;
|
||||
|
||||
//xy坐标
|
||||
public float* X
|
||||
{
|
||||
get { return _x; }
|
||||
set { _x = value; }
|
||||
}
|
||||
|
||||
private float* _y;
|
||||
|
||||
public float* Y
|
||||
{
|
||||
get { return _y; }
|
||||
set { _y = value; }
|
||||
}
|
||||
|
||||
private uint _beginTick;
|
||||
|
||||
public uint BeginTick
|
||||
{
|
||||
get { return _beginTick; }
|
||||
set { _beginTick = value; }
|
||||
}
|
||||
|
||||
public Bullet()
|
||||
{
|
||||
}
|
||||
|
||||
//通过传入的时间刻计算位移并更新位置坐标
|
||||
public void move(uint tick)
|
||||
{
|
||||
float deltaTick = tick - _beginTick;
|
||||
float deltaX = 0;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
deltaX += _xVelocity[i];
|
||||
deltaX *= deltaTick;
|
||||
}
|
||||
deltaX += _xVelocity[10];
|
||||
*_x += deltaX;
|
||||
float deltaY = 0;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
deltaY += _yVelocity[i];
|
||||
deltaY *= deltaTick;
|
||||
}
|
||||
deltaY += _yVelocity[10];
|
||||
*_y += deltaY;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 修改自身路径,修改条件由外部逻辑判断触发
|
||||
/// </summary>
|
||||
public void ChangeVelocity(float[] XSpeed, float[] YSpeed)
|
||||
{
|
||||
if (XSpeed != null)
|
||||
{
|
||||
if (XSpeed.Length == 10)
|
||||
{
|
||||
this._xVelocity = XSpeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("The amount of parameters should be 10!");
|
||||
}
|
||||
}
|
||||
if (YSpeed != null)
|
||||
{
|
||||
if (YSpeed.Length == 10)
|
||||
{
|
||||
this._yVelocity = YSpeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("The amount of parameters should be 10!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Stg_Sharp.StgSharp_Entity
|
||||
{
|
||||
internal unsafe class Launcher
|
||||
{
|
||||
private Bullet _bullet;
|
||||
|
||||
public Bullet NewBullet
|
||||
{
|
||||
get { return _bullet; }
|
||||
set { _bullet = value; }
|
||||
}
|
||||
|
||||
private float* _xPositon;
|
||||
|
||||
public float* XPsition
|
||||
{
|
||||
get { return _xPositon; }
|
||||
set { _xPositon = value; }
|
||||
}
|
||||
|
||||
private float* _yPosition;
|
||||
|
||||
public float* YPosition
|
||||
{
|
||||
get { return _yPosition; }
|
||||
set { _yPosition = value; }
|
||||
}
|
||||
|
||||
|
||||
public Launcher()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Bind(float* _xPointer, float* _yPointer)
|
||||
{
|
||||
_xPositon = _xPointer;
|
||||
_yPosition = _yPointer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
using OpenTK.Input;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Stg_Sharp.StgSharp_Entity
|
||||
{
|
||||
internal class Player
|
||||
{
|
||||
private uint gameTick;
|
||||
private uint beginTick;
|
||||
|
||||
private readonly float _velocityHigh;
|
||||
private readonly float _vHighCorner;
|
||||
|
||||
public float VelocityHigh
|
||||
{
|
||||
get { return _velocityHigh; }
|
||||
}
|
||||
|
||||
private readonly float _velocityLow;
|
||||
private readonly float _vLowCorner;
|
||||
|
||||
public float VelocityLow
|
||||
{
|
||||
get { return _velocityLow; }
|
||||
}
|
||||
|
||||
private float _xLocation;
|
||||
|
||||
public float XLocation
|
||||
{
|
||||
get { return _xLocation; }
|
||||
set { _xLocation = value; }
|
||||
}
|
||||
|
||||
public float _yLocation;
|
||||
|
||||
public float YLocation
|
||||
{
|
||||
get { return _yLocation; }
|
||||
set { _yLocation = value; }
|
||||
}
|
||||
|
||||
private KeyboardState _keyboardState;
|
||||
|
||||
public KeyboardState KeyboardState
|
||||
{
|
||||
get { return _keyboardState; }
|
||||
set { _keyboardState = value; }
|
||||
}
|
||||
|
||||
|
||||
public Player(float velocityHigh, float velocityLow, KeyboardState keyboardState)
|
||||
{
|
||||
this._velocityHigh = velocityHigh;
|
||||
this._vHighCorner = velocityHigh / 1.4142136f;
|
||||
this._velocityLow = velocityLow;
|
||||
this._vLowCorner = velocityLow / 1.4142136f;
|
||||
this._keyboardState = keyboardState;
|
||||
}
|
||||
|
||||
private Launcher _launcherAtHigh;
|
||||
public Launcher LauncherAtHigh
|
||||
{
|
||||
get { return LauncherAtHigh; }
|
||||
set { LauncherAtHigh = value; }
|
||||
}
|
||||
|
||||
private Launcher _launcherAtLow;
|
||||
|
||||
public void Action()
|
||||
{
|
||||
if (_keyboardState.IsKeyDown(Key.ShiftLeft))
|
||||
{
|
||||
FastShoot();
|
||||
FastMove();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自机高速移动的简单方法
|
||||
/// </summary>
|
||||
public void SlowMove()
|
||||
{
|
||||
if (_keyboardState.IsKeyDown(Key.Up))
|
||||
{
|
||||
if (_keyboardState.IsKeyDown(Key.Left))
|
||||
{
|
||||
this._yLocation += _vLowCorner;
|
||||
this._xLocation -= _vLowCorner;
|
||||
}
|
||||
else if (_keyboardState.IsKeyDown(Key.Right))
|
||||
{
|
||||
this._yLocation += _vLowCorner;
|
||||
this._xLocation += _vLowCorner;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._yLocation += _velocityLow;
|
||||
}
|
||||
}
|
||||
else if (_keyboardState.IsKeyDown(Key.Down))
|
||||
{
|
||||
if (_keyboardState.IsKeyDown(Key.Left))
|
||||
{
|
||||
this._yLocation -= _vLowCorner;
|
||||
this._xLocation -= _vLowCorner;
|
||||
}
|
||||
else if (_keyboardState.IsKeyDown(Key.Right))
|
||||
{
|
||||
this._yLocation -= _vLowCorner;
|
||||
this._xLocation += _vLowCorner;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._yLocation -= _velocityLow;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自机低速移动的简单方法
|
||||
/// </summary>
|
||||
public void FastMove()
|
||||
{
|
||||
if (_keyboardState.IsKeyDown(Key.Up))
|
||||
{
|
||||
if (_keyboardState.IsKeyDown(Key.Left))
|
||||
{
|
||||
this._yLocation += _vHighCorner;
|
||||
this._xLocation -= _vHighCorner;
|
||||
}
|
||||
else if (_keyboardState.IsKeyDown(Key.Right))
|
||||
{
|
||||
this._yLocation += _vHighCorner;
|
||||
this._xLocation += _vHighCorner;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._yLocation += _velocityHigh;
|
||||
}
|
||||
}
|
||||
else if (_keyboardState.IsKeyDown(Key.Down))
|
||||
{
|
||||
if (_keyboardState.IsKeyDown(Key.Left))
|
||||
{
|
||||
this._yLocation -= _vHighCorner;
|
||||
this._xLocation -= _vHighCorner;
|
||||
}
|
||||
else if (_keyboardState.IsKeyDown(Key.Right))
|
||||
{
|
||||
this._yLocation -= _vHighCorner;
|
||||
this._xLocation += _vHighCorner;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._yLocation -= _velocityHigh;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public void UseSkill()
|
||||
{
|
||||
if (_keyboardState.IsKeyDown(Key.X))
|
||||
{
|
||||
//new event added to use spell
|
||||
}
|
||||
}
|
||||
|
||||
public void FastShoot()
|
||||
{
|
||||
if (_keyboardState.IsKeyDown(Key.Z))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
public void SlowSoot()
|
||||
{
|
||||
if (_keyboardState.IsKeyDown(Key.Z))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void Die()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
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++)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
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 class Geometry : LinkedTarget
|
||||
{
|
||||
public new LinkedTarget Previous
|
||||
{
|
||||
get { return this.Previous; }
|
||||
set
|
||||
{
|
||||
if (value is Geometry)
|
||||
{
|
||||
this.Previous = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public new LinkedTarget Next
|
||||
{
|
||||
get { return this.Next; }
|
||||
set
|
||||
{
|
||||
if (value is Geometry)
|
||||
{
|
||||
this.Next = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Add()
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Stg_Sharp.StgSharp_Geometry
|
||||
{
|
||||
internal class Line
|
||||
{
|
||||
private Point _beginPoint;
|
||||
|
||||
public Point BeginPoint
|
||||
{
|
||||
get { return _beginPoint; }
|
||||
set { _beginPoint = value; }
|
||||
}
|
||||
|
||||
private Point _endingPoint;
|
||||
|
||||
public Point EndingPoint
|
||||
{
|
||||
get { return _endingPoint; }
|
||||
set { _endingPoint = value; }
|
||||
}
|
||||
|
||||
public Line(Point begin, Point end)
|
||||
{
|
||||
_beginPoint = begin;
|
||||
_endingPoint = end;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
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 class Point : LinkedTarget
|
||||
{
|
||||
private float _x;
|
||||
|
||||
public float X
|
||||
{
|
||||
get { return _x; }
|
||||
set { _x = value; }
|
||||
}
|
||||
|
||||
private float _y;
|
||||
|
||||
public float Y
|
||||
{
|
||||
get { return _y; }
|
||||
set { _y = value; }
|
||||
}
|
||||
|
||||
public new LinkedTarget Next
|
||||
{
|
||||
get { return this.Next; }
|
||||
set
|
||||
{
|
||||
if (value is Point)
|
||||
{
|
||||
this.Next = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnRender()
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
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));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Stg_Sharp.StgSharp_Geometry
|
||||
{
|
||||
internal class PointOnLine : Point
|
||||
{
|
||||
private Point _beginPoint;
|
||||
|
||||
public Point BeginPoint
|
||||
{
|
||||
get { return _beginPoint; }
|
||||
set { _beginPoint = value; }
|
||||
}
|
||||
|
||||
private Point _endPoint;
|
||||
|
||||
public Point EndPoint
|
||||
{
|
||||
get { return _endPoint; }
|
||||
set { _endPoint = value; }
|
||||
}
|
||||
|
||||
private float _angle;
|
||||
|
||||
public float Angle
|
||||
{
|
||||
get { return _angle; }
|
||||
set { _angle = value; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
private float rate;
|
||||
|
||||
public PointOnLine(Point beginPoint, Point endPoint, float rate, int number)
|
||||
{
|
||||
_beginPoint = beginPoint;
|
||||
_endPoint = endPoint;
|
||||
|
||||
_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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Stg_Sharp.StgSharp_Logic
|
||||
{
|
||||
internal class Counter<T>
|
||||
{
|
||||
private T _value;
|
||||
|
||||
public T Value
|
||||
{
|
||||
get { return _value; }
|
||||
set { _value = value; }
|
||||
}
|
||||
|
||||
public Counter()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Increase(T deltaValue)
|
||||
{
|
||||
//_value += deltaValue;
|
||||
}
|
||||
|
||||
public void Decrease(T deltaValue)
|
||||
{
|
||||
//_value -= deltaValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
using Stg_Sharp.StgSharp_Entity;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Stg_Sharp.StgSharp_Logic
|
||||
{
|
||||
internal class EntityContainer
|
||||
{
|
||||
private Counter<int> _limit;
|
||||
private float _leftBorder;
|
||||
private float _rightBorder;
|
||||
private float _topBorder;
|
||||
private float _bottomBorder;
|
||||
private LinkedList _container;
|
||||
|
||||
public LinkedList Container
|
||||
{
|
||||
get { return _container; }
|
||||
set { _container = value; }
|
||||
}
|
||||
|
||||
public float LeftBorder
|
||||
{
|
||||
get { return _leftBorder; }
|
||||
set { _leftBorder = value; }
|
||||
}
|
||||
public float RightBorder
|
||||
{
|
||||
get { return _rightBorder; }
|
||||
set { _rightBorder = value; }
|
||||
}
|
||||
public float TopBorder
|
||||
{
|
||||
get { return _topBorder; }
|
||||
set { _topBorder = value; }
|
||||
}
|
||||
public float BottomBorder
|
||||
{
|
||||
get { return _bottomBorder; }
|
||||
set { _bottomBorder = value; }
|
||||
}
|
||||
|
||||
public EntityContainer(Counter<int> counter)
|
||||
{
|
||||
this._limit = counter;
|
||||
this.Container = new LinkedList(_limit);
|
||||
}
|
||||
|
||||
public void Add(LinkedTarget t)
|
||||
{
|
||||
if (true) //对target类型进行判断,应当只是实体
|
||||
{
|
||||
_container.Add(t);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveAt(int id)
|
||||
{
|
||||
_container.Remove(id);
|
||||
}
|
||||
|
||||
//Move an entity from one container to another one
|
||||
public void Move(LinkedTarget target, EntityContainer targetContainer)
|
||||
{
|
||||
target.Previous = target.Next;
|
||||
target.Next = target.Previous;
|
||||
targetContainer.Add(target);
|
||||
|
||||
}
|
||||
|
||||
//What should a container do on each rendering frame
|
||||
//This method should be overriden
|
||||
public void OnRender()
|
||||
{
|
||||
//坐标刷新
|
||||
//边界判定
|
||||
//碰撞判定
|
||||
}
|
||||
|
||||
public void ReportCapacity()
|
||||
{
|
||||
Console.WriteLine(_limit.Value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
using Stg_Sharp.StgSharp_Geometry;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Stg_Sharp.StgSharp_Logic
|
||||
{
|
||||
internal class GeometryContainer
|
||||
{
|
||||
private LinkedList _container;
|
||||
|
||||
public LinkedList Container
|
||||
{
|
||||
get { return _container; }
|
||||
set { _container = value; }
|
||||
}
|
||||
|
||||
private float _leftBorder;
|
||||
|
||||
public float LeftBorder
|
||||
{
|
||||
get { return _leftBorder; }
|
||||
set { _leftBorder = value; }
|
||||
}
|
||||
|
||||
private float _rightBorder;
|
||||
|
||||
public float RightBorder
|
||||
{
|
||||
get { return _rightBorder; }
|
||||
set { _rightBorder = value; }
|
||||
}
|
||||
|
||||
private float _upBorder;
|
||||
|
||||
public float UpBorder
|
||||
{
|
||||
get { return _upBorder; }
|
||||
set { _upBorder = value; }
|
||||
}
|
||||
|
||||
private float _downBorder;
|
||||
|
||||
public float DownBorder
|
||||
{
|
||||
get { return _downBorder; }
|
||||
set { _downBorder = value; }
|
||||
}
|
||||
|
||||
public GeometryContainer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Add(LinkedTarget t)
|
||||
{
|
||||
if (t is Geometry)
|
||||
{
|
||||
_container.Add(t);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Stg_Sharp.StgSharp_Logic
|
||||
{
|
||||
internal class LinkedList
|
||||
{
|
||||
private LinkedTarget _heading;
|
||||
private LinkedTarget _ending;
|
||||
private LinkedTarget _cache;
|
||||
private Counter<int> _amountCounter;
|
||||
|
||||
public LinkedTarget Heading
|
||||
{
|
||||
get { return _heading; }
|
||||
set { _heading = value; }
|
||||
}
|
||||
|
||||
public LinkedTarget Ending
|
||||
{
|
||||
get { return _ending; }
|
||||
set { _ending = value; }
|
||||
}
|
||||
public LinkedTarget Cache
|
||||
{
|
||||
get { return _cache; }
|
||||
set { _cache = value; }
|
||||
}
|
||||
public Counter<int> AmountCounter
|
||||
{
|
||||
get { return _amountCounter; }
|
||||
set { _amountCounter = value; }
|
||||
}
|
||||
|
||||
//构造器
|
||||
public LinkedList(Counter<int> counter)
|
||||
{
|
||||
this._amountCounter = counter;
|
||||
_amountCounter.Value = 0;
|
||||
_ending = null;
|
||||
_heading = null;
|
||||
}
|
||||
|
||||
|
||||
public void Add(LinkedTarget target)
|
||||
{
|
||||
if (_ending != null)
|
||||
{
|
||||
_ending.Next = target;
|
||||
target.Previous = _ending;
|
||||
_ending = target;
|
||||
_amountCounter.Value++;
|
||||
}
|
||||
else
|
||||
{
|
||||
_heading = target;
|
||||
_heading.Previous = null;
|
||||
_ending = target;
|
||||
_ending.Next = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据序号删除一个链表成员。
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
public void Remove(int id)
|
||||
{
|
||||
_cache = null;
|
||||
for (int i = 1; i < id; i++)
|
||||
{
|
||||
_cache = _cache.Next;
|
||||
}
|
||||
_cache.Previous = _cache.Next;
|
||||
_cache.Next = _cache.Previous;
|
||||
_cache.Next = null;
|
||||
_cache.Previous = null;
|
||||
_cache = null;
|
||||
_amountCounter.Value--;
|
||||
}
|
||||
/// <summary>
|
||||
/// 快速删除链表中已知名称的一个实例。由于不能判别实例是否存在于链表中故安全性较低。在对安全性有要求的情况下应当使用Remove_s方法。
|
||||
/// </summary>
|
||||
/// <param name="target"></param>
|
||||
public void Remove(LinkedTarget target)
|
||||
{
|
||||
target.Previous = target.Next;
|
||||
target.Next = target.Previous;
|
||||
target.Previous = null;
|
||||
target.Next = null;
|
||||
_amountCounter.Value--;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 该方法用于防止传入不属于该链表的实例。
|
||||
/// </summary>
|
||||
/// <param name="target"></param>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public void Remove_s(LinkedTarget target)
|
||||
{
|
||||
bool a = true;
|
||||
_cache = _heading;
|
||||
for (int i = 0; _cache.Next != null; i++)
|
||||
{
|
||||
if (_cache == target)
|
||||
{
|
||||
Remove(target);
|
||||
a = false;
|
||||
_amountCounter.Value--;
|
||||
}
|
||||
}
|
||||
if (a)
|
||||
{
|
||||
throw new Exception("Target can not be found in this List!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Stg_Sharp.StgSharp_Logic
|
||||
{
|
||||
internal class LinkedTarget
|
||||
{
|
||||
private LinkedTarget _previous;
|
||||
|
||||
public LinkedTarget Previous
|
||||
{
|
||||
get { return _previous; }
|
||||
set
|
||||
{
|
||||
if (value.GetType() == this.GetType())
|
||||
{
|
||||
_previous = value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private LinkedTarget _next;
|
||||
|
||||
public LinkedTarget Next
|
||||
{
|
||||
get { return _next; }
|
||||
set
|
||||
{
|
||||
_next = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?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>{09E14FBB-EF63-496E-BFB2-2A47C1EE4111}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Stg_Sharp</RootNamespace>
|
||||
<AssemblyName>Stg_Sharp</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="OpenTK, Version=3.3.3.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\OpenTK.3.3.3\lib\net20\OpenTK.dll</HintPath>
|
||||
</Reference>
|
||||
<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="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" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<None Include="OpenTK.dll.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
+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")]
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+1
@@ -0,0 +1 @@
|
||||
b4eff8e6d37a34965f1d99fc3819eccdc83dfb8b
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\Stg_Sharp\Stg_Sharp\bin\Debug\Stg_Sharp.dll
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\Stg_Sharp\Stg_Sharp\bin\Debug\Stg_Sharp.pdb
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\Stg_Sharp\Stg_Sharp\bin\Debug\OpenTK.dll
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\Stg_Sharp\Stg_Sharp\bin\Debug\OpenTK.pdb
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\Stg_Sharp\Stg_Sharp\bin\Debug\OpenTK.xml
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\Stg_Sharp\Stg_Sharp\obj\Debug\Stg_Sharp.csproj.AssemblyReference.cache
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\Stg_Sharp\Stg_Sharp\obj\Debug\Stg_Sharp.csproj.CoreCompileInputs.cache
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\Stg_Sharp\Stg_Sharp\obj\Debug\Stg_Sharp.csproj.CopyComplete
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\Stg_Sharp\Stg_Sharp\obj\Debug\Stg_Sharp.dll
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\Stg_Sharp\Stg_Sharp\obj\Debug\Stg_Sharp.pdb
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
obj\Debug\\_IsIncrementalBuild
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="OpenTK" version="3.3.3" targetFramework="net472" />
|
||||
</packages>
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,25 @@
|
||||
<configuration>
|
||||
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
|
||||
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
|
||||
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
|
||||
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
|
||||
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
|
||||
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
|
||||
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
|
||||
<dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
|
||||
<dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
|
||||
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
|
||||
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
|
||||
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
|
||||
<dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
|
||||
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
|
||||
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
|
||||
<dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
|
||||
<!-- XQuartz compatibility (X11 on Mac) -->
|
||||
<dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
|
||||
<dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
|
||||
<dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
|
||||
<dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
|
||||
<dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
|
||||
<dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
|
||||
</configuration>
|
||||
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user