Example #1
0
        public virtual void BuildConnectionsFromSourceData()
        {
            List <EntityLink <EntityType> > InputEvents = GetInputEvents();

            foreach (EntityLink <EntityType> CurrentLink in InputEvents)
            {
                Anchor <EntityType> LocalAnchor = GetAnchor("Input" + CurrentLink.Name);

                if (LocalAnchor != null)
                {
                    foreach (EntityLink <EntityType> CurrentRemoteLink in CurrentLink.LinkedEntities)
                    {
                        if (CurrentRemoteLink.GetOwner() != null && CurrentRemoteLink.GetOwner().OutputEvents.Contains(CurrentRemoteLink))
                        {
                            EntityBox <EntityType> RemoteBox = Owner.GetEntityBoxForEntity(CurrentRemoteLink.GetOwner());

                            if (RemoteBox != null)
                            {
                                Anchor <EntityType> RemoteAnchor = RemoteBox.GetAnchor("Output" + CurrentRemoteLink.Name);

                                if (RemoteAnchor != null)
                                {
                                    Owner.ConnectInputToOutput(LocalAnchor, RemoteAnchor);
                                }
                            }
                        }
                    }
                }
            }
        }
Example #2
0
        public override void BuildConnectionsFromSourceData()
        {
            if (bIsInputBox)
            {
                List <EntityLink <EntityType> > OutputEvents = GetStartEntities();
                foreach (EntityLink <EntityType> CurrentLink in OutputEvents)
                {
                    Anchor <EntityType> LocalAnchor = GetAnchor("Output" + CurrentLink.Name);

                    if (LocalAnchor != null)
                    {
                        foreach (EntityLink <EntityType> CurrentRemoteLink in CurrentLink.LinkedEntities)
                        {
                            if (CurrentRemoteLink.GetOwner() != null)
                            {
                                if (CurrentRemoteLink.GetOwner().InputEvents.Contains(CurrentRemoteLink))
                                {
                                    EntityBox <EntityType> RemoteBox = Owner.GetEntityBoxForEntity(CurrentRemoteLink.GetOwner());

                                    if (RemoteBox != null)
                                    {
                                        Anchor <EntityType> RemoteAnchor = RemoteBox.GetAnchor("Input" + CurrentRemoteLink.Name);

                                        if (RemoteAnchor != null)
                                        {
                                            Owner.ConnectInputToOutput(LocalAnchor, RemoteAnchor);
                                        }
                                    }
                                }
                            }
                            else
                            {
                                EntityBox <EntityType> EndBox = Owner.GetOutputBox();

                                if (EndBox != null)
                                {
                                    Anchor <EntityType> RemoteAnchor = EndBox.GetAnchor("Input" + CurrentRemoteLink.Name);

                                    if (RemoteAnchor != null)
                                    {
                                        Owner.ConnectInputToOutput(LocalAnchor, RemoteAnchor);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                List <EntityLink <EntityType> > InputEvents = GetEndEntities();
                foreach (EntityLink <EntityType> CurrentLink in InputEvents)
                {
                    Anchor <EntityType> LocalAnchor = GetAnchor("Input" + CurrentLink.Name);

                    if (LocalAnchor != null)
                    {
                        foreach (EntityLink <EntityType> CurrentRemoteLink in CurrentLink.LinkedEntities)
                        {
                            if (CurrentRemoteLink.GetOwner() != null)
                            {
                                if (CurrentRemoteLink.GetOwner().OutputEvents.Contains(CurrentRemoteLink))
                                {
                                    EntityBox <EntityType> RemoteBox = Owner.GetEntityBoxForEntity(CurrentRemoteLink.GetOwner());

                                    if (RemoteBox != null)
                                    {
                                        Anchor <EntityType> RemoteAnchor = RemoteBox.GetAnchor("Output" + CurrentRemoteLink.Name);

                                        if (RemoteAnchor != null)
                                        {
                                            Owner.ConnectInputToOutput(LocalAnchor, RemoteAnchor);
                                        }
                                    }
                                }
                            }
                            else
                            {
                                EntityBox <EntityType> StartBox = Owner.GetInputBox();

                                if (StartBox != null)
                                {
                                    Anchor <EntityType> RemoteAnchor = StartBox.GetAnchor("Input" + CurrentRemoteLink.Name);

                                    if (RemoteAnchor != null)
                                    {
                                        Owner.ConnectInputToOutput(LocalAnchor, RemoteAnchor);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }