ZMWSLI0-SL2021-GR11/Projekt/MWSProjekt/Library/PackageCache/com.unity.visualscripting@1.6.1/Runtime/VisualScripting.Flow/Connections/UnitRelation.cs

26 lines
669 B
C#
Raw Normal View History

2021-07-05 21:20:56 +02:00
using System;
namespace Unity.VisualScripting
{
public sealed class UnitRelation : IUnitRelation
{
public UnitRelation(IUnitPort source, IUnitPort destination)
{
Ensure.That(nameof(source)).IsNotNull(source);
Ensure.That(nameof(destination)).IsNotNull(destination);
if (source.unit != destination.unit)
{
throw new NotSupportedException("Cannot create relations across units.");
}
this.source = source;
this.destination = destination;
}
public IUnitPort source { get; }
public IUnitPort destination { get; }
}
}