[Serializable]
public class FlowRequest
{
[SerializeField] private string id = "flow";
[SerializeField] private FlowEndpoint source = new FlowEndpoint();
[SerializeField] private FlowEndpoint target = new FlowEndpoint();
[SerializeField] private string flowClass = "default";
[SerializeField] private Color debugColor = new Color(0.16f, 0.7f, 0.95f, 1f);
public string Id
{
get => id;
set => id = value;
}
public FlowEndpoint Source => source;
public FlowEndpoint Target => target;
public string FlowClass
{
get => flowClass;
set => flowClass = string.IsNullOrWhiteSpace(value) ? "default" : value;
}
public Color DebugColor
{
get => debugColor;
set => debugColor = value;
}
public void AssignAutoSlots(int sourceSlotIndex, int sourceSlotCount, int targetSlotIndex, int targetSlotCount)
{
source.AssignAutoSlot(sourceSlotIndex, sourceSlotCount);
target.AssignAutoSlot(targetSlotIndex, targetSlotCount);
}
public bool TryResolve(out SlotPose sourcePose, out SlotPose targetPose)
{
sourcePose = default;
targetPose = default;
return source.TryGetPose(SlotKind.Out, out sourcePose) && target.TryGetPose(SlotKind.In, out targetPose);
}
}