daily update on 20221116 by nitload youmu

This commit is contained in:
Nitload
2022-11-17 01:55:11 +08:00
parent 5c50789568
commit 89aab4cc94
47 changed files with 702 additions and 24 deletions
@@ -0,0 +1,24 @@
using StgSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Control
{
public static class Change
{
/// <summary>
/// 将对战区在指定时间内变化至指定大小和位置
/// </summary>
/// <param name="size">对战区的长宽</param>
/// <param name="center">对战区矩形中心的位置</param>
/// <param name="count ">完成变化需要的时间</param>
public static void BattleField(float[] size, float[] center, uint count )
{
}
}
}
@@ -1,5 +1,6 @@
using StgSharp.Entities;
using StgSharp.Geometries;
using StgSharp.Logic;
using StgSharp.UI;
using System;
using System.Collections.Generic;
@@ -11,41 +12,82 @@ namespace StgSharp.Control
{
internal class Get
{
static bool isNotSelected;
static Point pointCache;
static Circle circleCache;
static Bullet bulletCache;
static Geometry geometryCache;
static Entity enemyCache;
public static Point Point(SelectOperation<Point> selectPointOperation )
public static Point Point(SelectOperation<Point> operation )
{
isNotSelected = true;
pointCache = Pool.pointContainer.Heading;
for (; pointCache.Next != null; )
for (; pointCache!= null; )
{
if (selectPointOperation.Invoke(pointCache))
if (operation.Invoke(pointCache))
{
isNotSelected = false;
return pointCache;
break;
}
pointCache++;
}
if (isNotSelected)
{
return null;
}
return null;
}
public static Bullet Bullet(SelectOperation<Bullet> operation)
{
bulletCache = Pool.bulletContainer.Heading;
for (; bulletCache != null; )
{
if (operation.Invoke(bulletCache))
{
break;
}
bulletCache++;
}
return bulletCache;
}
public static Circle Circle(SelectOperation<Circle> operation)
{
circleCache = Pool.geometryContainer.Heading;
geometryCache = Pool.geometryContainer.Heading;
for (; geometryCache != null ; )
{
if (geometryCache is Circle && operation.Invoke(geometryCache as Circle))
{
break;
}
geometryCache++;
}
return geometryCache as Circle;
}
public static Line Line(SelectOperation<Line> operation)
{
geometryCache= Pool.geometryContainer.Heading;
for (; geometryCache != null ; )
{
if (geometryCache is Line && operation.Invoke(geometryCache as Line))
{
break;
}
geometryCache++;
}
return geometryCache as Line;
}
public static Enemy Enemy(SelectOperation<LinkedObject> operation)
{
enemyCache= Pool.entityContainer.Heading ;
for (; enemyCache != null ; )
{
if (enemyCache is Enemy && operation.Invoke(enemyCache as Enemy ))
{
break;
}
enemyCache++;
}
return enemyCache as Enemy;
}
@@ -4,6 +4,7 @@ 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;
@@ -12,6 +13,7 @@ namespace StgSharp.Control
{
public static class Pool
{
public static Player player;
public static Counter<uint> tickCounter
= new Counter<uint>();
@@ -26,6 +28,11 @@ namespace StgSharp.Control
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>();
@@ -59,8 +66,18 @@ namespace StgSharp.Control
public static void OnRender()
{
bulletCache = bulletContainer.Heading;
for (; bulletCache!=null;)
{
if (true)
{
}
}
}
}
@@ -1,4 +1,4 @@
using StgSharp.Geometry;
using StgSharp.Geometries;
using StgSharp.Logic;
using System;
using System.Collections.Generic;
@@ -1,4 +1,4 @@
using StgSharp.Geometry;
using StgSharp.Geometries;
using StgSharp.Logic;
using System;
using System.Collections.Generic;
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace StgSharp.Entities
{
internal class Enemy:LinkedObject
internal class Enemy:Entity
{
private float _x;
@@ -26,9 +26,9 @@ namespace StgSharp.Entities
set { _y = value; }
}
private IPoint _location;
private Point _location;
public IPoint Location
public Point Location
{
get { return _location; }
set { _location = value; }
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
@@ -9,6 +10,13 @@ namespace StgSharp.Entities
{
internal class Entity:LinkedObject
{
public static Entity operator ++(Entity e)
{
return e.Next as Entity;
}
public static Entity operator --(Entity e)
{
return e.Next as Entity;
}
}
}
@@ -1,4 +1,4 @@
using StgSharp.Geometry;
using StgSharp.Geometries;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace StgSharp.Entities
{
internal unsafe class Launcher
public unsafe class Launcher
{
private Point _location;
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace StgSharp.Entities
{
internal class Player
public class Player
{
private uint gameTick;
private uint beginTick;
@@ -45,6 +45,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Control\Change.cs" />
<Compile Include="Control\SelectOperation.cs" />
<Compile Include="Control\Get.cs" />
<Compile Include="Control\Set.cs" />
@@ -71,6 +72,7 @@
<Compile Include="Logic\Counter.cs" />
<Compile Include="Logic\LinkedList.cs" />
<Compile Include="Logic\LinkedObject.cs" />
<Compile Include="UI\BattleField.cs" />
<Compile Include="UI\Option.cs" />
</ItemGroup>
<ItemGroup>
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.UI
{
public class BattleField
{
internal float _leftBoarder;
public float LeftBoarder
{
get { return _leftBoarder; }
set { _leftBoarder = value; }
}
internal float _rightBoarder;
public float RightBoarder
{
set { _rightBoarder = value; }
get { return _rightBoarder; }
}
internal float _topBoarder;
public float TopBoarder
{
set { _topBoarder = value; }
get { return _topBoarder; }
}
internal float _bottomBoarder;
public float BottomBoarder
{
set { _bottomBoarder = value; }
get { return _bottomBoarder; }
}
}
}