daily update on 20230329 by nitload youmu

This commit is contained in:
Nitload
2023-03-29 00:51:31 +08:00
parent eedab82f6e
commit 8641b24206
33 changed files with 195 additions and 106 deletions
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
+4
View File
@@ -1,4 +1,5 @@
using GLFWDotNet;
using StgSharp.Geometries;
using System;
using System.Collections.Generic;
using System.Text;
@@ -7,6 +8,9 @@ namespace StgSharp.Control
{
public static class Add
{
public static void GeometryCombination(IGeometryCombination geometry)
{
}
}
}
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp.Control
{
public abstract class BlockOperation : INode<BlockOperation>
{
private ContainerNode<BlockOperation> _id;
ContainerNode<BlockOperation> INode<BlockOperation>.ID => _id;
void INode<BlockOperation>.setID(ContainerNode<BlockOperation> id)
{
if (_id == default)
{
_id = id;
}
else
{
throw new InvalidOperationException("Cannot set ID twice!");
}
}
public abstract void OnUpdating();
}
}
+21 -3
View File
@@ -1,4 +1,5 @@
using System;
using StgSharp.Entities;
using System;
using System.Collections.Generic;
using System.Text;
@@ -6,11 +7,28 @@ namespace StgSharp.Control
{
public static class TimeLine
{
public static Pool _cache;
internal static Pool _currentPool;
public static LinkedList<Pool> allPool;
public static Counter<uint> tickCounter
= new Counter<uint>(0,1,1);
internal static BlockOperation currentOperation;
private static bool isPaused;
internal static void OnRender()
{
tickCounter.QuickAdd();
foreach (Pool p in allPool)
{
_currentPool = p;
if (!isPaused)
{
currentOperation.OnUpdating();
}
foreach (EntityPartical b in _currentPool._bulletContainer)
{
}
}
}
}
}
+2 -2
View File
@@ -59,11 +59,11 @@ namespace StgSharp
_pos = p;
}
void INode<Entity>.setID<T>(ContainerNode<T> id)
void INode<Entity>.setID(ContainerNode<Entity> id)
{
if (id == null)
{
_id = id as ContainerNode<Entity>;
_id = id;
}
else
{
+2 -2
View File
@@ -35,7 +35,7 @@ namespace StgSharp
get { return _id; }
}
void INode<Launcher<T>>.setID<T1>(ContainerNode<T1> id)
void INode<Launcher<T>>.setID(ContainerNode<Launcher<T>> id)
{
if (_id == default(ContainerNode<Launcher<T>>))
{
@@ -43,7 +43,7 @@ namespace StgSharp
}
else
{
_id = id as ContainerNode<Launcher<T>>;
_id = id;
}
}
}
+2 -2
View File
@@ -27,7 +27,7 @@ namespace StgSharp
ContainerNode<IGeometry> INode<IGeometry>.ID => _id;
void INode<IGeometry>.setID<T>(ContainerNode<T> id)
void INode<IGeometry>.setID(ContainerNode<IGeometry> id)
{
if (_id != default)
{
@@ -35,7 +35,7 @@ namespace StgSharp
}
else
{
_id = id as ContainerNode<IGeometry>;
_id = id;
}
}
@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp.Geometries
{
public abstract class IGeometryCombination:LinkedList<IGeometry>
{
}
}
+2 -2
View File
@@ -34,11 +34,11 @@ namespace StgSharp
get { return this._position.Y; }
}
void INode<Point>.setID<T>(ContainerNode<T> id)
void INode<Point>.setID(ContainerNode<Point> id)
{
if (id == null)
{
_id = id as ContainerNode<Point>;
_id = id;
}
else
{
+33 -33
View File
@@ -11,58 +11,58 @@ namespace StgSharp.Geometries
internal Point _center;
internal Point _centerToCorner1;
internal Point _centerToCorner2;
internal GetLocationHandler _centerMov;
internal GetLocationHandler _CTC1Handler;
internal GetLocationHandler _CTC2Handler;
internal RenderMode _renderMode;
Point IGeometry.BasePoint
{
get { return _basePoint; }
}
Point IGeometry.RefPoint
{
get { return _center; }
}
public override sealed Point BasePoint => _basePoint;
public override sealed Point RefPoint=>_center;
Point IGeometry.RefVec01
{
get { return _centerToCorner1; }
}
public override sealed Point RefVec01 => _centerToCorner1;
Point IGeometry.RefVec02
{
get { return _centerToCorner2; }
}
public override sealed Point RefVec02 => _centerToCorner2;
public override RenderMode renderMode => _renderMode;
void IGeometry.OnRender()
internal override sealed void OnRender(uint tick)
{
this._CTC2Handler.Invoke(_centerToCorner2._position, Control.TimeLine.tickCounter);
}
float IGeometry.SetArrayX()
public override sealed float SetArrayX()
{
throw new NotImplementedException();
}
float IGeometry.SetArrayY()
public override sealed float SetArrayY()
{
throw new NotImplementedException();
}
void INode<IGeometry>.setID<T>(ContainerNode<T> id)
internal override void CalcVec01(uint tick)
{
if (_id != default(ContainerNode<IGeometry>))
{
throw new ArgumentException();
}
else
{
_id = id as ContainerNode<IGeometry>;
}
_center._position = _basePoint._position + MovCenter(tick);
}
internal override void CalcVec02(vec2d vec, uint tick)
{
_centerToCorner1._position = vec + UpdateCTC1(tick);
}
internal override void CalcVec03(vec2d vec, uint tick)
{
_centerToCorner2._position = vec + UpdateCTC2(tick);
if (_centerToCorner1._position.GetLength()
== _centerToCorner2._position.GetLength())
{
throw new ArgumentException("Cannot form a triangle, " +
"two crossing lines are not equal!");
}
}
public virtual vec2d MovCenter(uint tick)=>default(vec2d);
public virtual vec2d UpdateCTC1(uint tick) => default(vec2d);
public virtual vec2d UpdateCTC2(uint tick) => default(vec2d);
}
}
+41 -47
View File
@@ -2,80 +2,74 @@
using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
namespace StgSharp
{
public class Triangle :IGeometry
{
internal ContainerNode<IGeometry> _id;
internal Point _basePoint;
internal Point _refPoint;
internal Point _beginPoint;
internal Point _line1;
internal Point _line2;
internal RenderMode _renderMode;
internal GetLocationHandler _refMovHandler;
internal GetLocationHandler _line01MovHandler;
internal GetLocationHandler _line02MovHandler;
public override sealed Point BasePoint => _basePoint;
Point IGeometry.BasePoint
public override sealed Point RefPoint=>_beginPoint;
public override sealed Point RefVec01 => _line1;
public override sealed Point RefVec02 => _line2;
public override RenderMode renderMode => _renderMode;
internal override void CalcVec01(uint tick)
{
get { return _basePoint; }
_beginPoint._position = _basePoint._position+ MovBegin(tick);
}
Point IGeometry.RefPoint
internal override void CalcVec02(vec2d vec, uint tick)
{
get { return _refPoint; }
_line1._position = vec + CalcSide1(tick);
}
Point IGeometry.RefVec01
internal override void CalcVec03(vec2d vec, uint tick)
{
get { return _refPoint; }
_line2._position = vec + CalcSide2(tick);
}
Point IGeometry.RefVec02
public virtual vec2d MovBegin(uint tick) => default(vec2d);
public virtual vec2d CalcSide1(uint tick)=> default(vec2d);
public virtual vec2d CalcSide2(uint tick) => default(vec2d);
internal override sealed void OnRender(uint tick)
{
get { return _line1; }
CalcVec01(tick);
switch (_renderMode)
{
case RenderMode.BasePoint:
CalcVec02(BasePoint._position,tick);
CalcVec03(BasePoint._position,tick);
break;
case RenderMode.RefPoint:
CalcVec02(_beginPoint._position,tick);
CalcVec03(_beginPoint._position,tick);
break;
default:
break;
}
}
GetLocationHandler IGeometry.Vec01Expression
{
get { return _refMovHandler; }
}
GetLocationHandler IGeometry.Vec02Expression
{
get { return _line01MovHandler; }
}
GetLocationHandler IGeometry.Vec03Expression
{
get { return _line02MovHandler; }
}
ContainerNode<IGeometry> INode<IGeometry>.ID
{
get { return _id; }
}
void IGeometry.OnRender()
public override float SetArrayX()
{
throw new NotImplementedException();
}
float IGeometry.SetArrayX()
{
throw new NotImplementedException();
}
float IGeometry.SetArrayY()
{
throw new NotImplementedException();
}
void INode<IGeometry>.setID<T>(ContainerNode<T> id)
public override float SetArrayY()
{
throw new NotImplementedException();
}
+2 -2
View File
@@ -9,7 +9,7 @@ namespace StgSharp
{
internal ContainerNode<T> ID { get; }
internal void setID<T>(ContainerNode<T> id) where T : INode<T>;
internal void setID(ContainerNode<T> id);
}
@@ -23,7 +23,7 @@ namespace StgSharp
public ContainerNode(T t)
{
_value = t;
t.setID<T>(this);
t.setID(this);
}
public virtual ContainerNode<T> Previous
+15 -2
View File
@@ -6,12 +6,12 @@ using System.Text;
namespace StgSharp
{
public class LinkedList<T>:IEnumerable where T: INode<T>
public class LinkedList<T>:IEnumerable,INode<LinkedList<T>> where T: INode<T>
{
internal readonly ContainerNode<T> _heading;
internal ContainerNode<T> _first;
internal ContainerNode<T> _tail;
private ContainerNode<LinkedList<T>> _id;
private ContainerNode<T> _cache;
public LinkedList()
@@ -35,6 +35,7 @@ namespace StgSharp
set { _tail = new ContainerNode<T>(value); }
}
ContainerNode<LinkedList<T>> INode<LinkedList<T>>.ID => _id;
public void Add(T t)
{
@@ -69,5 +70,17 @@ namespace StgSharp
{
return new LinkedListEnumrator<T>(this);
}
void INode<LinkedList<T>>.setID(ContainerNode<LinkedList<T>> id)
{
if (_id == null)
{
throw new ArgumentException("Cannot set ID twice");
}
else
{
_id = id;
}
}
}
}
+29 -11
View File
@@ -1,4 +1,5 @@
using StgSharp;
using Steamworks;
using StgSharp;
using StgSharp.Entities;
using System;
using System.Collections.Generic;
@@ -7,25 +8,31 @@ using System.Text;
namespace StgSharp
{
public class Pool
public class Pool:INode<Pool>
{
public LinkedList<Point> pointContainer;
public LinkedList<IGeometry> geometryContainer;
public LinkedList<Entity> _bulletContainer;
public LinkedList<Entity> _awardContainer;
public LinkedList<Entity> _enemyContainer;
internal LinkedList<Point> pointContainer;
internal LinkedList<IGeometry> geometryContainer;
internal LinkedList<Entity> _bulletContainer;
internal LinkedList<Entity> _awardContainer;
internal LinkedList<Entity> _enemyContainer;
public Line leftBoader;
public Line rightBoader;
public Line topBoader;
public Line bottomBoader;
internal Line leftBoader;
internal Line rightBoader;
internal Line topBoader;
internal Line bottomBoader;
internal Sensor<EntityPartical> Sensor;
private ContainerNode<Pool> _id;
public Pool()
{
}
ContainerNode<Pool> INode<Pool>.ID => _id;
public void OnRender()
{
foreach (Enemy e in _enemyContainer)
@@ -34,6 +41,17 @@ namespace StgSharp
}
}
void INode<Pool>.setID(ContainerNode<Pool> id)
{
if (_id == default)
{
_id = id;
}
else
{
throw new ArgumentException("Cannot set ID twicee!");
}
}
}
}