32 lines
735 B
C#
32 lines
735 B
C#
using Godot;
|
|
using Nocturnis.Enigmos.Ports.SignalPorts.Directions;
|
|
|
|
namespace Enigmos.Cables;
|
|
|
|
public partial class SignalCable : BaseCable
|
|
{
|
|
public new ISignalOutPort PortTo
|
|
{
|
|
get => (base.PortTo as ISignalOutPort)!;
|
|
set => base.PortTo = value;
|
|
}
|
|
|
|
public new ISignalInPort PortFrom
|
|
{
|
|
get => (base.PortFrom as ISignalInPort)!;
|
|
set => base.PortFrom = value;
|
|
}
|
|
public override void LineUpdate()
|
|
{
|
|
Vector2 fromPosition = PortFrom.PositionToBoard;
|
|
Vector2 toPosition = PortTo.PositionToBoard;
|
|
Points = new []
|
|
{
|
|
fromPosition,
|
|
new Vector2(fromPosition.X, (fromPosition.Y + toPosition.Y) / 2),
|
|
new Vector2(toPosition.X, (fromPosition.Y + toPosition.Y) / 2),
|
|
toPosition
|
|
};
|
|
InFill.Points = Points;
|
|
}
|
|
} |