daily update on 20221020

This commit is contained in:
Youmu Konpaku
2022-10-21 01:55:54 +08:00
parent ef34fcf3c1
commit 7dc8f402e1
48 changed files with 297 additions and 98 deletions
@@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp_Geometry
{
public class Circle
{
private float _centerX;
public float CenterX
{
get { return _centerX; }
set { _centerX = value; }
}
private float _centerY;
public float CenterY
{
get { return _centerY; }
set { _centerY = value; }
}
private float _radius;
public float Radius
{
get { return _radius; }
set { _radius = value; }
}
public Circle(float centerX,float centerY,float radius)
{
this._centerX = centerX;
this._centerY = centerY;
this._radius = radius;
}
}
}
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("StgSharp Geometry")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("StgSharp Geometry")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("00b490aa-9fbb-4a9a-9293-d3ce79895d25")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,48 @@
<?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>{00B490AA-9FBB-4A9A-9293-D3CE79895D25}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>StgSharp_Geometry</RootNamespace>
<AssemblyName>StgSharp Geometry</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>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</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="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="Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -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")]
@@ -4,6 +4,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 17.3.32825.248
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StgSharp", "StgSharp\StgSharp.csproj", "{2509A432-198B-4098-8B43-24C3E3923468}"
ProjectSection(ProjectDependencies) = postProject
{57017F07-7412-4B61-B912-B1D36C3AF16F} = {57017F07-7412-4B61-B912-B1D36C3AF16F}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StgSharp_Logic", "StgSharp_Logic\StgSharp_Logic.csproj", "{AE7F3290-9AB4-4B54-AAB1-4DDCBA20F89D}"
EndProject
@@ -16,6 +19,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeMap", "CodeMap", "{06C3
CodeMap1.dgml = CodeMap1.dgml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StgSharp Geometry", "StgSharp Geometry\StgSharp Geometry.csproj", "{00B490AA-9FBB-4A9A-9293-D3CE79895D25}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -38,6 +43,10 @@ Global
{57017F07-7412-4B61-B912-B1D36C3AF16F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57017F07-7412-4B61-B912-B1D36C3AF16F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57017F07-7412-4B61-B912-B1D36C3AF16F}.Release|Any CPU.Build.0 = Release|Any CPU
{00B490AA-9FBB-4A9A-9293-D3CE79895D25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00B490AA-9FBB-4A9A-9293-D3CE79895D25}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00B490AA-9FBB-4A9A-9293-D3CE79895D25}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00B490AA-9FBB-4A9A-9293-D3CE79895D25}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -22,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -13,22 +13,9 @@ namespace StgSharp
{
static class Program
{
static void Main()
static unsafe void Main()
{
Counter<int> counter = new Counter<int>();
LinkedList linkedList = new LinkedList(counter);
for (int i = 0; i < 15; i++)
{
linkedList.Add(new LinkedTarget());
}
EntityContainer container = new EntityContainer(counter);
for (int i = 0; i < 10; i++)
{
container.Add(new Bullet());
}
container.ReportCapacity();
Console.WriteLine(Key.A.ToString());
Console.WriteLine(typeof(Bullet).Name);
}
}
}
@@ -0,0 +1,51 @@
using OpenTK;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 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;
}
}
}
@@ -65,113 +65,131 @@ namespace StgSharp_Entity
this._keyboardState = keyboardState;
}
private Launcher _launcherAtHigh;
public Launcher LauncherAtHigh
{
get { return LauncherAtHigh; }
set { LauncherAtHigh = value; }
}
private Launcher _launcherAtLow;
public void Action()
{
if (_keyboardState.IsAnyKeyDown)
if (_keyboardState.IsKeyDown(Key.ShiftLeft))
{
Move();
FastShoot();
FastMove();
}
}
/// <summary>
/// 自机移动的简单方法
/// 自机高速移动的简单方法
/// </summary>
public void Move()
public void SlowMove()
{
if (_keyboardState.IsKeyDown(Key.ShiftLeft))
{
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;
}
if (_keyboardState.IsKeyDown(Key.Up))
{
if (_keyboardState.IsKeyDown(Key.Left))
{
this._yLocation += _vLowCorner;
this._xLocation -= _vLowCorner;
}
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;
}
else if (_keyboardState.IsKeyDown(Key.Right))
{
this._yLocation += _vLowCorner;
this._xLocation += _vLowCorner;
}
else
{
this._yLocation += _velocityLow;
}
}
else
{
if (_keyboardState.IsKeyDown(Key.Up))
else if (_keyboardState.IsKeyDown(Key.Down))
{
if (_keyboardState.IsKeyDown(Key.Left))
{
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;
}
this._yLocation -= _vLowCorner;
this._xLocation -= _vLowCorner;
}
else if (_keyboardState.IsKeyDown(Key.Down))
else if (_keyboardState.IsKeyDown(Key.Right))
{
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;
}
this._yLocation -= _vLowCorner;
this._xLocation += _vLowCorner;
}
else
{
this._yLocation -= _velocityLow;
}
}
}
public void UseSkill(KeyboardState key)
/// <summary>
/// 自机低速移动的简单方法
/// </summary>
public void FastMove()
{
if (key.IsKeyDown(Key.X))
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 LaunchBullet(KeyboardState key)
public void SlowSoot()
{
}
if (_keyboardState.IsKeyDown(Key.Z))
{
}
}
public void Die()
{
@@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -45,6 +46,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Bullet.cs" />
<Compile Include="Launcher.cs" />
<Compile Include="Player.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
@@ -1 +1 @@
2d5905d44084acf7b24064935643d53ef7c88707
0fdc9e02df8123646ab2059355451462f25ad255
@@ -1,5 +1,4 @@
using StgSharp_Game;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>