You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.5 KiB
C#
49 lines
1.5 KiB
C#
1 year ago
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
|
||
|
namespace Unity.VisualScripting
|
||
|
{
|
||
|
public sealed class InvalidInput : UnitPort<IUnitOutputPort, IUnitOutputPort, InvalidConnection>, IUnitInvalidPort, IUnitInputPort
|
||
|
{
|
||
|
public InvalidInput(string key) : base(key) { }
|
||
|
|
||
|
public override IEnumerable<InvalidConnection> validConnections => unit?.graph?.invalidConnections.WithDestination(this) ?? Enumerable.Empty<InvalidConnection>();
|
||
|
|
||
|
public override IEnumerable<InvalidConnection> invalidConnections => Enumerable.Empty<InvalidConnection>();
|
||
|
|
||
|
public override IEnumerable<IUnitOutputPort> validConnectedPorts => validConnections.Select(c => c.source);
|
||
|
|
||
|
public override IEnumerable<IUnitOutputPort> invalidConnectedPorts => invalidConnections.Select(c => c.source);
|
||
|
|
||
|
public override bool CanConnectToValid(IUnitOutputPort port)
|
||
|
{
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
public override void ConnectToValid(IUnitOutputPort port)
|
||
|
{
|
||
|
ConnectInvalid(port, this);
|
||
|
}
|
||
|
|
||
|
public override void ConnectToInvalid(IUnitOutputPort port)
|
||
|
{
|
||
|
ConnectInvalid(port, this);
|
||
|
}
|
||
|
|
||
|
public override void DisconnectFromValid(IUnitOutputPort port)
|
||
|
{
|
||
|
DisconnectInvalid(port, this);
|
||
|
}
|
||
|
|
||
|
public override void DisconnectFromInvalid(IUnitOutputPort port)
|
||
|
{
|
||
|
DisconnectInvalid(port, this);
|
||
|
}
|
||
|
|
||
|
public override IUnitPort CompatiblePort(IUnit unit)
|
||
|
{
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
}
|