daily update on 20230301 by nitload youmu, file struct cahnged and more vec func added
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp_Logic
|
||||
{
|
||||
public 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,87 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp_Logic
|
||||
{
|
||||
public 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 target)
|
||||
{
|
||||
if (true) //对target类型进行判断,应当只是实体
|
||||
{
|
||||
_container.Add(target);
|
||||
}
|
||||
}
|
||||
|
||||
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,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp_Logic
|
||||
{
|
||||
public 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,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp_Logic
|
||||
{
|
||||
public 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,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("StgSharp_Logic")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("StgSharp_Logic")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("ae7f3290-9ab4-4b54-aab1-4ddcba20f89d")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,66 @@
|
||||
<?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>{AE7F3290-9AB4-4B54-AAB1-4DDCBA20F89D}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>StgSharp_Logic</RootNamespace>
|
||||
<AssemblyName>StgSharp_Logic</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="GeometryContainer.cs" />
|
||||
<Compile Include="LinkedList.cs" />
|
||||
<Compile Include="LinkedTarget.cs" />
|
||||
<Compile Include="Counter.cs" />
|
||||
<Compile Include="EntityContainer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="OpenTK.dll.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Game\StgSharp_Game.csproj">
|
||||
<Project>{57017f07-7412-4b61-b912-b1d36c3af16f}</Project>
|
||||
<Name>StgSharp_Game</Name>
|
||||
</ProjectReference>
|
||||
</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.
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 @@
|
||||
7ca1e6081e494ab105ef5baa469f5f9fc4ab8d06
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Logic\bin\Debug\StgSharp_Logic.dll
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Logic\bin\Debug\StgSharp_Logic.pdb
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Logic\bin\Debug\OpenTK.dll
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Logic\bin\Debug\OpenTK.pdb
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Logic\bin\Debug\OpenTK.xml
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Logic\obj\Debug\StgSharp_Logic.csproj.AssemblyReference.cache
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Logic\obj\Debug\StgSharp_Logic.csproj.CoreCompileInputs.cache
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Logic\obj\Debug\StgSharp_Logic.csproj.CopyComplete
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Logic\obj\Debug\StgSharp_Logic.dll
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Logic\obj\Debug\StgSharp_Logic.pdb
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Logic\bin\Debug\StgSharp_Game.dll
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Logic\bin\Debug\StgSharp_Game.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>
|
||||
Reference in New Issue
Block a user