daily update on 20230413 by nitload youmu
This commit is contained in:
@@ -6,8 +6,6 @@ namespace StgSharp.Control
|
||||
{
|
||||
public abstract class TimelineBlock : INode<TimelineBlock>
|
||||
{
|
||||
|
||||
private ContainerNode<TimelineBlock> _id;
|
||||
|
||||
public abstract void OnUpdating();
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Entities
|
||||
{
|
||||
public abstract class BehaviorArgs
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ namespace StgSharp.Entities
|
||||
public bool _selectalbe;
|
||||
|
||||
internal Launcher<EntityPartical> _awardLauncher;
|
||||
internal LinkedList< Launcher<EntityPartical>> _commonBulletLauncher;
|
||||
internal LinkedList<Launcher<EntityPartical>> _commonBulletLauncher;
|
||||
internal Launcher<EntityPartical> _dieBulletLauncher;
|
||||
|
||||
public Launcher<EntityPartical> AwardLauncher { get; set; }
|
||||
@@ -18,8 +18,8 @@ namespace StgSharp.Entities
|
||||
|
||||
internal void InternalDieOperation(Pool home)
|
||||
{
|
||||
_dieBulletLauncher.Launch(Control.GameTimeLine.tickCounter, home._bulletContainer);
|
||||
_awardLauncher.Launch(Control.GameTimeLine.tickCounter, home._awardContainer);
|
||||
_dieBulletLauncher.Launch();
|
||||
_awardLauncher.Launch();
|
||||
this._id.Remove();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace StgSharp.Entities
|
||||
this.OnUpdate();
|
||||
foreach (Launcher<EntityPartical> launcher in CommonBulletLauncher)
|
||||
{
|
||||
launcher.Launch(Control.GameTimeLine.tickCounter, Control.GameTimeLine._currentPool._bulletContainer);
|
||||
launcher.Launch();
|
||||
}
|
||||
this.OnRender();
|
||||
}
|
||||
|
||||
@@ -18,19 +18,14 @@ namespace StgSharp.Entities
|
||||
|
||||
internal void InternalDieOperation(Pool home)
|
||||
{
|
||||
_dieBulletLauncher.Launch(Control.GameTimeLine.tickCounter, home._bulletContainer);
|
||||
_awardLauncher.Launch(Control.GameTimeLine.tickCounter, home._awardContainer);
|
||||
_dieBulletLauncher.Launch();
|
||||
_awardLauncher.Launch();
|
||||
this._id.Remove();
|
||||
}
|
||||
|
||||
public override void OnRender()
|
||||
internal override void OnRenderFrame()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void OnUpdate()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
CommonBulletLauncher.Launch();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace StgSharp
|
||||
set { _bulletSample = value; }
|
||||
}
|
||||
|
||||
internal virtual void Launch(Counter<uint> outerTickCounter, LinkedList<IEntity> container)
|
||||
internal virtual void Launch( )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -7,12 +7,7 @@ namespace StgSharp
|
||||
{
|
||||
public class Partical : IEntity
|
||||
{
|
||||
public override void OnRender()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void OnUpdate()
|
||||
internal override void OnRenderFrame()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -38,19 +38,19 @@ namespace StgSharp.Geometries
|
||||
_center._position = _baseCenter._position + MoveCenter(tick);
|
||||
}
|
||||
|
||||
internal override void CalcVec02(vec2d vec, uint tick)
|
||||
internal override void CalcVec02(vec3d vec, uint tick)
|
||||
{
|
||||
_radiusVec._position = vec + UpdateRadius(tick);
|
||||
}
|
||||
|
||||
internal override void CalcVec03(vec2d vec, uint tick)
|
||||
internal override void CalcVec03(vec3d vec, uint tick)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public virtual vec2d MoveCenter(uint tick) => default;
|
||||
public virtual vec3d MoveCenter(uint tick) => default;
|
||||
|
||||
public virtual vec2d UpdateRadius(uint tick) => default;
|
||||
public virtual vec3d UpdateRadius(uint tick) => default;
|
||||
|
||||
|
||||
|
||||
@@ -83,5 +83,9 @@ namespace StgSharp.Geometries
|
||||
}
|
||||
}
|
||||
|
||||
public override Line[] GetAllSides()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ namespace StgSharp.Geometries
|
||||
public abstract RenderMode renderMode { get; }
|
||||
public abstract float SetArrayX();
|
||||
public abstract float SetArrayY();
|
||||
|
||||
public abstract Line[] GetAllSides();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -80,5 +80,10 @@ namespace StgSharp.Geometries
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override Line[] GetAllSides()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
internal class Parallelogram : IGeometry
|
||||
{
|
||||
internal Point _basePoint;
|
||||
internal Point _center;
|
||||
internal Point _centerToCorner1;
|
||||
internal Point _centerToCorner2;
|
||||
internal RenderMode _renderMode;
|
||||
internal readonly uint bornTick;
|
||||
|
||||
public override sealed Point BasePoint => _basePoint;
|
||||
public override sealed Point RefPoint => _center;
|
||||
|
||||
public override sealed Point RefVec01 => _centerToCorner1;
|
||||
|
||||
public override sealed Point RefVec02 => _centerToCorner2;
|
||||
|
||||
public override RenderMode renderMode => _renderMode;
|
||||
|
||||
public Parallelogram(uint bornTime) : base(bornTime)
|
||||
{
|
||||
bornTick = bornTime;
|
||||
}
|
||||
|
||||
public Parallelogram(Counter<uint> tickCounter) : base(tickCounter)
|
||||
{
|
||||
bornTick = tickCounter._value;
|
||||
}
|
||||
|
||||
internal override sealed void OnRender(uint tick)
|
||||
{
|
||||
tick -= bornTick;
|
||||
CalcVec01(tick);
|
||||
switch (renderMode)
|
||||
{
|
||||
case RenderMode.BasePoint:
|
||||
CalcVec02(_basePoint._position, tick);
|
||||
CalcVec03(_basePoint._position, tick);
|
||||
break;
|
||||
case RenderMode.RefPoint:
|
||||
CalcVec02(_center._position, tick);
|
||||
CalcVec03(_center._position, tick);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override sealed float SetArrayX()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override sealed float SetArrayY()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
internal override void CalcVec01(uint tick)
|
||||
{
|
||||
_center._position = _basePoint._position + MovCenter(tick);
|
||||
}
|
||||
|
||||
internal override void CalcVec02(vec3d vec, uint tick)
|
||||
{
|
||||
_centerToCorner1._position = vec + UpdateCTC1(tick);
|
||||
}
|
||||
|
||||
internal override void CalcVec03(vec3d vec, uint tick)
|
||||
{
|
||||
_centerToCorner2._position = vec + UpdateCTC2(tick);
|
||||
}
|
||||
|
||||
public virtual vec3d MovCenter(uint tick) => default(vec3d);
|
||||
|
||||
public virtual vec3d UpdateCTC1(uint tick) => default(vec3d);
|
||||
|
||||
public virtual vec3d UpdateCTC2(uint tick) => default(vec3d);
|
||||
|
||||
public override Line[] GetAllSides()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,11 +67,24 @@ namespace StgSharp.Geometries
|
||||
_center._position = _basePoint._position + MovCenter(tick);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算长方形第一条对角线的一半的矢量表示
|
||||
/// </summary>
|
||||
/// <param name="vec">作为参考的矢量,根据计算模式可以分为参考原点
|
||||
/// 和参考中心点两种</param>
|
||||
/// <param name="tick">当前游戏刻</param>
|
||||
internal override void CalcVec02(vec3d vec, uint tick)
|
||||
{
|
||||
_centerToCorner1._position = vec + UpdateCTC1(tick);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算长方形第二条对角线一半的矢量表示
|
||||
/// </summary>
|
||||
/// <param name="vec">作为参考的矢量,根据计算模式可以分为参考原点
|
||||
/// 和参考中心点两种</param>
|
||||
/// <param name="tick">当前游戏刻</param>
|
||||
/// <exception cref="ArgumentException">计算出的第二条对角线长与第一条不相等</exception>
|
||||
internal override void CalcVec03(vec3d vec, uint tick)
|
||||
{
|
||||
_centerToCorner2._position = vec + UpdateCTC2(tick);
|
||||
@@ -83,10 +96,25 @@ namespace StgSharp.Geometries
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算中心点相对于参考原点的位移
|
||||
/// </summary>
|
||||
/// <param name="tick">当前游戏刻</param>
|
||||
/// <returns></returns>
|
||||
public virtual vec3d MovCenter(uint tick)=>default(vec3d);
|
||||
|
||||
/// <summary>
|
||||
/// 计算一个顶点相对于
|
||||
/// </summary>
|
||||
/// <param name="tick"></param>
|
||||
/// <returns></returns>
|
||||
public virtual vec3d UpdateCTC1(uint tick) => default(vec3d);
|
||||
|
||||
public virtual vec3d UpdateCTC2(uint tick) => default(vec3d);
|
||||
|
||||
public override Line[] GetAllSides()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Graphic
|
||||
{
|
||||
internal class Class1
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -6,12 +6,11 @@ using System.Text;
|
||||
|
||||
namespace StgSharp
|
||||
{
|
||||
public class LinkedList<T>:IEnumerable,INode<LinkedList<T>> where T: INode<T>
|
||||
public class LinkedList<T>:INode<LinkedList<T>>,IEnumerable 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()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Steamworks;
|
||||
using StgSharp;
|
||||
using StgSharp.Math;
|
||||
using StgSharp.Entities;
|
||||
using StgSharp.Geometries;
|
||||
using System;
|
||||
@@ -29,8 +29,6 @@ namespace StgSharp
|
||||
|
||||
internal Sensor<EntityPartical> Sensor;
|
||||
|
||||
private ContainerNode<Pool> _id;
|
||||
|
||||
|
||||
|
||||
public Pool(Line left, Line right, Line top, Line bottom)
|
||||
@@ -42,7 +40,11 @@ namespace StgSharp
|
||||
}
|
||||
public Pool( Geometries.Rectangle area)
|
||||
{
|
||||
|
||||
if (Calc.Abs(area._centerToCorner1.X) == Calc.Abs(area._centerToCorner2.X)
|
||||
&& Calc.Abs(area._centerToCorner1.Y) == Calc.Abs(area._centerToCorner2.Y))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void OnRender()
|
||||
|
||||
@@ -14,11 +14,14 @@ namespace StgSharp.Math
|
||||
uint* a = (uint*)&x;
|
||||
*a &= 0b_0111_1111_1111_1111_1111_1111_1111_1111;
|
||||
return *(float*)a;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static unsafe int Abs(int x)
|
||||
{
|
||||
uint* a = (uint*)&x;
|
||||
*a &= 0b_0111_1111_1111_1111_1111_1111_1111_1111;
|
||||
return *(int*)a;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user