daily update on 20230322 by nitload youmu, new geometry structure rewritten 70%

This commit is contained in:
Nitload
2023-03-22 20:32:17 +08:00
parent db2ca36fd7
commit eedab82f6e
66 changed files with 1382 additions and 785 deletions
+45 -32
View File
@@ -1,4 +1,6 @@
using StgSharp;
using Steamworks;
using StgSharp;
using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Text;
@@ -7,53 +9,64 @@ namespace StgSharp
{
public class Line:IGeometry
{
private ContainerNode<INode> _id;
internal Point _basePoint;
internal Point _beginPoint;
internal Point _endPoint;
internal GetLocationHandler _beginPointMov;
internal GetLocationHandler _endPointMov;
internal RenderMode _renderMode;
internal Point _referencePoint;
internal float _vecX;
internal float _vecY;
public Point ReferencePoint
public override Point BasePoint => _basePoint;
public override Point RefPoint => _beginPoint;
public override Point RefVec01 => _endPoint;
public override Point RefVec02 => default;
public override RenderMode renderMode => _renderMode;
public override float SetArrayX()
{
get { return _referencePoint; }
throw new NotImplementedException();
}
ContainerNode<INode> INode.ID
public override float SetArrayY()
{
get { return _id; }
throw new NotImplementedException();
}
float IGeometry.ExpressionX => throw new NotImplementedException();
float IGeometry.ExpressionY => throw new NotImplementedException();
public Line( Point referencePoint, float vecX, float vecY)
internal sealed override void CalcVec01(uint tick)
{
_referencePoint = referencePoint;
_vecX = vecX;
_vecY = vecY;
_beginPoint._position = _basePoint._position + MoveBeginPoint(tick);
}
public float SetArrayX(Counter<uint> tickCounter)
internal sealed override void CalcVec02(vec2d vec, uint tick)
{
return 0.0f;
}
public float SetArrayY(Counter<uint> tickCounter)
{
return 0.0f;
_endPoint._position = vec + MoveEndPoint(tick);
}
void INode.setID<T>(ContainerNode<T> id)
internal sealed override void CalcVec03(vec2d vec, uint tick)
{
if (id == null)
throw new ArgumentException("Lines do not need the third parameter to define!");
}
public virtual vec2d MoveBeginPoint(uint tick) => default;
public virtual vec2d MoveEndPoint(uint tick) => default;
internal override void OnRender(uint tick)
{
CalcVec01(tick);
switch (_renderMode)
{
_id = id as ContainerNode<INode>;
}
else
{
throw new ArgumentNullException("Cannot set id teice!");
case RenderMode.BasePoint:
CalcVec02(_basePoint._position, tick);
break;
case RenderMode.RefPoint:
CalcVec02(_beginPoint._position, tick);
break;
default:
break;
}
}
}