using System;
using System.Collections.Generic;
using System.Text;
using AIStudio.Wpf.DiagramDesigner;

namespace AIStudio.Wpf.SFC.ViewModels
{
    public class SFCCOEndNode : SFCNode
    {
        public SFCCOEndNode() : base(SFCNodeKinds.COEnd)
        {
            ItemWidth = 280;
            ItemHeight = 10;

            ExecuteAddBottomOutput(null);
            ExecuteAddTopInput(null);
            ExecuteAddTopInput(null);
        }

        public SFCCOEndNode(IDiagramViewModel parent, DesignerItemBase designer) : base(parent, designer)
        {
        }

        public SFCCOEndNode(IDiagramViewModel parent, string json) : base(parent, json)
        {

        }

        public override void ExecuteAddTopInput(object parameter)
        {
            FullyCreatedConnectorInfo connector = new FullyCreatedConnectorInfo(this, ConnectorOrientation.Top, true);
            connector.YRatio = 0;
            connector.XRatio = (40 + Input.Count * 200) / ItemWidth;
            Input.Add(Input.Count, connector);

            AddConnector(connector);
        }

        public override void ExecuteAddBottomOutput(object parameter)
        {
            FullyCreatedConnectorInfo connector = new FullyCreatedConnectorInfo(this, ConnectorOrientation.Bottom, true);
            connector.YRatio = 1;
            connector.XRatio = (40 + Output.Count * 200) / ItemWidth;
            Output.Add(Output.Count, connector);


            AddConnector(connector);
        }

    }
}
