source generator
This commit is contained in:
33
Cables/SignalCable.cs
Normal file
33
Cables/SignalCable.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Enigmos.Ports.SignalPorts;
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user