60 lines
1.3 KiB
C#
60 lines
1.3 KiB
C#
using StgSharp;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace StgSharp
|
|
{
|
|
public class Triangle : IGeometry
|
|
{
|
|
internal ContainerNode<INode> _id;
|
|
|
|
internal Point _referencePoint;
|
|
|
|
internal GetLocationHandler _setArrayXHandler;
|
|
internal GetLocationHandler _setArrayYHandler;
|
|
|
|
public Point ReferencePoint
|
|
{
|
|
get { return _referencePoint; }
|
|
}
|
|
|
|
public float VecX
|
|
{
|
|
get { return _referencePoint.X; }
|
|
}
|
|
|
|
public float VecY
|
|
{
|
|
get { return _referencePoint.Y; }
|
|
}
|
|
|
|
ContainerNode<INode> INode.ID
|
|
{
|
|
get { return _id; }
|
|
}
|
|
|
|
public float SetArrayX(Counter<uint> tickCounter)
|
|
{
|
|
return _setArrayXHandler.Invoke(tickCounter);
|
|
}
|
|
|
|
public float SetArrayY(Counter<uint> tickCounter)
|
|
{
|
|
return _setArrayYHandler.Invoke(tickCounter);
|
|
}
|
|
|
|
void INode.setID<T>(ContainerNode<T> id)
|
|
{
|
|
if (id == null)
|
|
{
|
|
_id = id as ContainerNode<INode>;
|
|
}
|
|
else
|
|
{
|
|
throw new ArgumentNullException("Cannot set id teice!");
|
|
}
|
|
}
|
|
}
|
|
}
|