daily update 20221123 by nitload youmu

This commit is contained in:
Nitload
2022-11-24 03:27:18 +08:00
parent 9660de6240
commit b6977da66a
26 changed files with 125 additions and 115 deletions
@@ -14,21 +14,20 @@ namespace Debug
{
public static void Main()
{
float[] a= new float[10];
for (int i = 0; i < 10; i++)
int b = A.a;
A.a = 10;
}
}
public class A
{
a[i] = i;
}
ref float b = ref a[5];
float c = 100;
Console.WriteLine(c==b);
}
public static int a = 10;
}
}
@@ -13,16 +13,16 @@ namespace StgSharp.Control
{
static public partial class Create
{
internal static Pool pool;
private static LinkedObject cache;
/// <summary>
/// 创建一个子弹并将其绑定在一个指定的点上
/// </summary>
/// <param name="point"></param>
public static void Bullet(Point point)
/// <param name="point">表示子弹坐标的点</param>
public static void Bullet(this Pool pool , Point point)
{
Pool.bulletContainer.Add(new Bullet(point));
pool.bulletContainer.Add(new Bullet(point));
}
/// <summary>
@@ -33,7 +33,7 @@ namespace StgSharp.Control
/// <param name="end">终点序号</param>
public static void Bullet(int begin, int end)
{
cache = Pool.pointContainer.Ending;
cache = pool.pointContainer.Ending;
for (int i = 1; i < begin; i++)
{
cache--;
@@ -41,7 +41,7 @@ namespace StgSharp.Control
for (int i = begin; i < end; i++)
{
cache--;
Pool.bulletContainer.Add(new Bullet(cache as Point));
pool.bulletContainer.Add(new Bullet(cache as Point));
}
}
@@ -54,7 +54,7 @@ namespace StgSharp.Control
/// <param name="angle"></param>
public static void Bullet(int order,uint count,float angle)
{
cache=Pool.pointContainer.Ending;
cache=pool.pointContainer.Ending;
for (int i = 1; i < count; i++)
{
cache--;
@@ -62,8 +62,8 @@ namespace StgSharp.Control
for (uint i = 0; i < count; i++)
{
PointOnCircle p = new PointOnCircle(cache as Circle, angle, i);
Pool.pointContainer.Add(p);
Pool.bulletContainer.Add(new Bullet(p));
pool.pointContainer.Add(p);
pool.bulletContainer.Add(new Bullet(p));
}
}
@@ -81,7 +81,7 @@ namespace StgSharp.Control
PointCommon p = new PointCommon(beginX, beginY, angle,Pool.tickCounter);
p.XVelocity = x;
p.YVelocity = y;
Pool.pointContainer.Add(p);
pool.pointContainer.Add(p);
}
/// <summary>
@@ -92,7 +92,7 @@ namespace StgSharp.Control
public static void Circle(Point c, float r)
{
Circle o = new Circle(c,r,Pool.tickCounter);
Pool.geometryContainer.Add(o);
pool.geometryContainer.Add(o);
}
/// <summary>
@@ -103,7 +103,7 @@ namespace StgSharp.Control
public static void Circle(Point c, Point s)
{
Circle o = new Circle(c, s,Pool.tickCounter);
Pool.geometryContainer.Add(o);
pool.geometryContainer.Add(o);
}
/// <summary>
@@ -114,7 +114,7 @@ namespace StgSharp.Control
public static void Line(Point b, Point e)
{
Line l = new Line(b,e);
Pool.geometryContainer.Add(l);
pool.geometryContainer.Add(l);
}
@@ -137,8 +137,8 @@ namespace StgSharp.Control
f[10]=rotateFunc[i];
circle.RadiusFunc = f;
o = new PointOnCircle(circle, angles[i],1);
Pool.geometryContainer.Add(circle);
Pool.pointContainer.Add(o);
pool.geometryContainer.Add(circle);
pool.pointContainer.Add(o);
}
}
@@ -1,85 +0,0 @@
using StgSharp.Entities;
using StgSharp.Geometries;
using StgSharp.Logic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.ExceptionServices;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Control
{
public static class Pool
{
public static Player player;
public static Counter<uint> tickCounter
= new Counter<uint>();
internal static Counter<uint> collectCounter
=new Counter<uint>();
internal static Logic.LinkedList<LinkedObject> topCollector
= new Logic.LinkedList<LinkedObject>(collectCounter);
internal static Logic.LinkedList<LinkedObject> bottomCollector
=new Logic.LinkedList<LinkedObject>(collectCounter);
internal static Logic.LinkedList<LinkedObject> leftCollector
=new Logic.LinkedList<LinkedObject>(collectCounter);
internal static Logic.LinkedList<LinkedObject> rightCollector
= new Logic.LinkedList<LinkedObject>(collectCounter);
public static float leftBoarder;
public static float rightBoarder;
public static float topBoarder;
public static float bottomBoarder;
internal static Bullet bulletCache;
internal static Counter<uint> bulletCounter
=new Counter<uint>();
internal static Logic.LinkedList<Bullet> bulletContainer
= new Logic.LinkedList<Bullet>(bulletCounter);
internal static Entity entityCache;
internal static Counter<uint> entityCounter
=new Counter<uint>();
internal static Logic.LinkedList<Entity> entityContainer
= new Logic.LinkedList<Entity>(entityCounter);
internal static Geometries.Geometry geometryCache;
internal static Counter<uint> gemoetryCounter
=new Counter<uint>();
internal static Logic.LinkedList<Geometries.Geometry> geometryContainer
= new Logic.LinkedList<Geometries.Geometry>(gemoetryCounter);
internal static Point pointCache;
internal static Counter<uint> pointCounter
=new Counter<uint>();
internal static Logic.LinkedList<Point> pointContainer
= new Logic.LinkedList<Point>(pointCounter);
static Pool()
{
}
public static void OnRender()
{
bulletCache = bulletContainer.Heading;
for (; bulletCache!=null;)
{
if (true)
{
}
}
}
}
}
@@ -0,0 +1,78 @@
using StgSharp.Entities;
using StgSharp.Geometries;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Logic
{
public class Pool
{
public Player player;
public static Counter<uint> tickCounter
= new Counter<uint>();
internal static Counter<uint> collectCounter
=new Counter<uint>();
internal Logic.LinkedList<LinkedObject> topCollector
=new Logic.LinkedList<LinkedObject>(collectCounter);
internal Logic.LinkedList<LinkedObject> bottomCollector
=new Logic.LinkedList<LinkedObject>(collectCounter);
internal Logic.LinkedList<LinkedObject> leftCollector
=new Logic.LinkedList<LinkedObject>(collectCounter);
internal Logic.LinkedList<LinkedObject> rightCollector
=new Logic.LinkedList<LinkedObject>(collectCounter);
public float leftBoarder;
public float rightBoarder;
public float topBoarder;
public float bottomBoarder;
internal Bullet bulletCache;
internal static Counter<uint> bulletCounter
=new Counter<uint>();
internal Logic.LinkedList<Bullet> bulletContainer
= new Logic.LinkedList<Bullet>(bulletCounter);
internal Entity entityCache;
internal static Counter<uint> entityCounter
=new Counter<uint>();
internal Logic.LinkedList<Entity> entityContainer
=new Logic.LinkedList<Entity>(entityCounter);
internal Geometries.Geometry geometryCache;
internal static Counter<uint> gemoetryCounter
=new Counter<uint>();
internal Logic.LinkedList<Geometries.Geometry> geometryContainer
=new Logic.LinkedList<Geometries.Geometry>(gemoetryCounter);
internal Point pointCache;
internal static Counter<uint> pointCounter
=new Counter<uint>();
internal Logic.LinkedList<Point> pointContainer
=new Logic.LinkedList<Point>(pointCounter);
public Pool()
{
}
public void OnRender()
{
}
}
}
@@ -49,7 +49,7 @@
<Compile Include="Control\SelectOperation.cs" />
<Compile Include="Control\Get.cs" />
<Compile Include="Control\Set.cs" />
<Compile Include="Control\Pool.cs" />
<Compile Include="Logic\Pool.cs" />
<Compile Include="Control\Create.cs" />
<Compile Include="Entities\RenderedGeometry.cs" />
<Compile Include="Entities\Entity.cs" />
@@ -73,6 +73,7 @@
<Compile Include="Logic\LinkedList.cs" />
<Compile Include="Logic\LinkedObject.cs" />
<Compile Include="UI\BattleField.cs" />
<Compile Include="UI\SelectEventHandler.cs" />
<Compile Include="UI\Option.cs" />
</ItemGroup>
<ItemGroup>
@@ -1,4 +1,5 @@
using System;
using StgSharp.Logic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -8,6 +9,8 @@ namespace StgSharp.UI
{
public class BattleField
{
internal Pool pool;
internal float _leftBoarder;
public float LeftBoarder
{
@@ -35,5 +38,8 @@ namespace StgSharp.UI
set { _bottomBoarder = value; }
get { return _bottomBoarder; }
}
}
}
@@ -1,4 +1,5 @@
using System;
using StgSharp.Logic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -6,7 +7,7 @@ using System.Threading.Tasks;
namespace StgSharp.UI
{
public class Option
public class Option:LinkedObject
{
public SelectEventHandler selectEventHandler;
@@ -28,6 +29,6 @@ namespace StgSharp.UI
}
public delegate void SelectEventHandler();
}
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.UI
{
public delegate void SelectEventHandler();
}