예제 #1
0
        public override void CreateStaticNodesIfNotPresent()
        {
            base.CreateStaticNodesIfNotPresent();

            if (InputEvents.Count != 1)
            {
                InputEvents.Clear();

                EntityLink <MonsterTestBase> InputLink = new EntityLink <MonsterTestBase>();
                InputLink.SetOwner(this);
                InputLink.Name = "Start Dialogue";
                InputEvents.Add(InputLink);
            }
            if (OutputEvents.Count != 3)
            {
                EntityLink <MonsterTestBase> OutputLink = new EntityLink <MonsterTestBase>();
                OutputLink.SetOwner(this);
                OutputLink.Name = "Game Finished";
                OutputEvents.Add(OutputLink);

                OutputLink = new EntityLink <MonsterTestBase>();
                OutputLink.SetOwner(this);
                OutputLink.Name = "Problem Encountered";
                OutputEvents.Add(OutputLink);

                OutputLink = new EntityLink <MonsterTestBase>();
                OutputLink.SetOwner(this);
                OutputLink.Name = "Navigation Required";
                OutputEvents.Add(OutputLink);
            }
        }
예제 #2
0
파일: EntityLink.cs 프로젝트: fbizuneh/Igor
        public virtual void FixupLinksWithList(GetLinkedEntityForFilename GetEntityFunction, GetLinkedEntityManager GetManagerFunction,
                                               ref List <string> LookupList, LinkType NameType)
        {
            foreach (string CurrentLinkName in LookupList)
            {
                string LinkFilename = CurrentLinkName.Substring(0, CurrentLinkName.IndexOf(":-:"));
                string LinkName     = CurrentLinkName.Substring(CurrentLinkName.IndexOf(":-:") + 3);
                if (NameType == XMLSerializable.LinkType.LINK_NormalLink)
                {
                    EntityType Linked = GetEntityFunction(LinkFilename);

                    if (Linked != null)
                    {
                        EntityLink <EntityType> DestinationLink = ((EntityType)Linked).GetLinkByName(LinkName);

                        if (DestinationLink != null)
                        {
                            EstablishLink(DestinationLink);
                        }
                    }
                }
                else
                {
                    LinkedEntityManager <EntityType> EntityManager = GetManagerFunction();

                    if (EntityManager != null)
                    {
                        EntityManager.FixupStartEndLink(this, LinkFilename, LinkName, NameType);
                    }
                }
            }
        }
예제 #3
0
파일: EntityLink.cs 프로젝트: fbizuneh/Igor
        public virtual void LinkToLinkName(ref EntityLink <EntityType> CurrentLink, ref string SavedLinkName)
        {
            if (CurrentLink != null)
            {
                SavedLinkName = CurrentLink.Owner.GetFilename() + ":-:" + CurrentLink.ListPrefix + CurrentLink.Name;
            }
            else if (SavedLinkName != null)
            {
                switch (CurrentLinkType)
                {
                case XMLSerializable.LinkType.LINK_StartLink:
                    StartLinkNamesToResolve.Add(SavedLinkName);
                    break;

                case XMLSerializable.LinkType.LINK_EndLink:
                    EndLinkNamesToResolve.Add(SavedLinkName);
                    break;

                case XMLSerializable.LinkType.LINK_NormalLink:
                default:
                    LinkNamesToResolve.Add(SavedLinkName);
                    break;
                }
            }
        }
예제 #4
0
        public override void CreateStaticNodesIfNotPresent()
        {
            base.CreateStaticNodesIfNotPresent();

            if (InputEvents.Count == 0)
            {
                EntityLink <MonsterTestBase> InputLink = new EntityLink <MonsterTestBase>();
                InputLink.SetOwner(this);
                InputLink.Name = "Input";
                InputEvents.Add(InputLink);
            }

            /*		if(OutputEvents.Count != NumberOfOutputs)
             *              {
             *                      for(int CurrentLink = OutputEvents.Count; CurrentLink < NumberOfOutputs; ++CurrentLink)
             *                      {
             *                              EntityLink<MonsterTestBase> OutputLink = new EntityLink<MonsterTestBase>();
             *                              OutputLink.SetOwner(this);
             *                              OutputLink.Name = "Option " + CurrentLink;
             *                              OutputEvents.Add(OutputLink);
             *                      }
             *
             *                      for(int CurrentLink = NumberOfOutputs; CurrentLink < OutputEvents.Count;)
             *                      {
             *                              OutputEvents[CurrentLink].BreakAllLinks();
             *                              OutputEvents.RemoveAt(CurrentLink);
             *                      }
             *              }*/
        }
예제 #5
0
 public virtual void BreakLinksToLink(EntityLink <EntityType> SourceLink)
 {
     for (int CurrentRemoteLink = 0; CurrentRemoteLink < SourceLink.LinkedEntities.Count; ++CurrentRemoteLink)
     {
         SourceLink.LinkedEntities[CurrentRemoteLink].BreakLink(SourceLink);
     }
 }
예제 #6
0
        public virtual void FixupStartEndLink(EntityLink <EntityType> SourceLink, string DestLinkFilename, string DestLinkName, XMLSerializable.LinkType TypeName)
        {
            EntityType DestEntity = GetEntityByFileName(DestLinkFilename);

            if (DestEntity != null)
            {
                EntityLink <EntityType> DestinationLink = ((EntityType)DestEntity).GetLinkByName(DestLinkName);

                if (DestinationLink != null)
                {
                    SourceLink.EstablishLink(DestinationLink);
                    DestinationLink.EstablishLink(SourceLink);
                }
            }
            else
            {
                string InvertLinkType = (DestLinkName.StartsWith("Input") ? DestLinkName.Replace("Input", "Output") : DestLinkName.Replace("Output", "Input"));

                EntityLink <EntityType> DestinationLink = GetLinkByName(InvertLinkType);

                if (DestinationLink != null)
                {
                    SourceLink.EstablishLink(DestinationLink);
                    DestinationLink.EstablishLink(SourceLink);
                }
            }
        }
예제 #7
0
        public override void CreateStaticNodesIfNotPresent()
        {
            base.CreateStaticNodesIfNotPresent();

            if (StartingEntities.Count == 0)
            {
                EntityLink <MonsterTestBase> StartLink = new EntityLink <MonsterTestBase>();
                StartLink.CurrentLinkType = XMLSerializable.LinkType.LINK_StartLink;
                StartLink.Name            = "Test Started";
                StartingEntities.Add(StartLink);

                StartLink = new EntityLink <MonsterTestBase>();
                StartLink.CurrentLinkType = XMLSerializable.LinkType.LINK_StartLink;
                StartLink.Name            = "Test Failed To Start";
                StartingEntities.Add(StartLink);
            }
            if (EndingEntities.Count == 0)
            {
                EntityLink <MonsterTestBase> EndLink = new EntityLink <MonsterTestBase>();
                EndLink.CurrentLinkType = XMLSerializable.LinkType.LINK_EndLink;
                EndLink.Name            = "Test Succeeded";
                EndingEntities.Add(EndLink);

                EndLink = new EntityLink <MonsterTestBase>();
                EndLink.CurrentLinkType = XMLSerializable.LinkType.LINK_EndLink;
                EndLink.Name            = "Test Failed";
                EndingEntities.Add(EndLink);
            }
        }
예제 #8
0
        public virtual LinkedEntity <EntityType> EditorDuplicate(LinkedEntity <EntityType> DerivedDuplicateInto = null)
        {
            LinkedEntity <EntityType> DuplicateInto = DerivedDuplicateInto;

            if (DuplicateInto == null)
            {
                DuplicateInto = new LinkedEntity <EntityType>();
            }

            DuplicateInto.Title    = Title;
            DuplicateInto.Filename = "";

            DuplicateInto.InputEvents = new List <EntityLink <EntityType> >();

            foreach (EntityLink <EntityType> CurrentLink in InputEvents)
            {
                EntityLink <EntityType> DuplicatedLink = CurrentLink.EditorDuplicateLink(DuplicateInto);

                DuplicateInto.InputEvents.Add(DuplicatedLink);
            }

            DuplicateInto.OutputEvents = new List <EntityLink <EntityType> >();

            foreach (EntityLink <EntityType> CurrentLink in OutputEvents)
            {
                EntityLink <EntityType> DuplicatedLink = CurrentLink.EditorDuplicateLink(DuplicateInto);

                DuplicateInto.OutputEvents.Add(DuplicatedLink);
            }

            return(DuplicateInto);
        }
예제 #9
0
파일: EntityBox.cs 프로젝트: fbizuneh/Igor
        public virtual bool InspectEntityLink(ref EntityLink <EntityType> CurrentLink)
        {
            InspectorGUIString("Name", ref CurrentLink.Name);

            InspectorGUIOrderedListEmbedded <EntityLink <EntityType> >("Linked Elements", "Link", ref CurrentLink.LinkedEntities, InspectEntityPerLinkDetails);

            return(false);
        }
예제 #10
0
        public virtual IGraphEvent GetNextEventAfterCurrentTestState(EntityLink <MonsterTestBase> NextLink)
        {
            if (Owner != null)
            {
                return(Owner.GetNextTest(NextLink));
            }

            return(null);
        }
예제 #11
0
파일: EntityLink.cs 프로젝트: fbizuneh/Igor
        public virtual void BreakAllLinks()
        {
            for (int CurrentIndex = 0; CurrentIndex < LinkedEntities.Count; ++CurrentIndex)
            {
                EntityLink <EntityType> CurrentLink = LinkedEntities[CurrentIndex];

                CurrentLink.BreakLink(this);
            }

            LinkedEntities.Clear();
        }
예제 #12
0
파일: EntityLink.cs 프로젝트: fbizuneh/Igor
        public virtual EntityLink <EntityType> EditorDuplicateLink(LinkedEntity <EntityType> NewOwner)
        {
            EntityLink <EntityType> DupedLink = new EntityLink <EntityType>();

            DupedLink.Name            = Name;
            DupedLink.ListPrefix      = ListPrefix;
            DupedLink.Owner           = NewOwner;
            DupedLink.CurrentLinkType = CurrentLinkType;

            return(DupedLink);
        }
예제 #13
0
        public virtual IGraphEvent GetNextEvent()
        {
            IGraphEvent             NextEvent = null;
            EntityLink <EntityType> NextLink  = FindNextValidOutputLink();

            if (NextLink != null)
            {
                NextEvent = NextLink.GetEventAndTriggerLink();
            }

            return(NextEvent);
        }
예제 #14
0
        public override void TriggerLink(EntityLink <MonsterTestBase> InputLink)
        {
            base.TriggerLink(InputLink);

            if (InputLink.Name == "Start New Game")
            {
                bShouldStartNewGame = true;
            }
            else if (InputLink.Name == "Load Saved Game")
            {
                bShouldLoadGame = true;
            }
            else if (InputLink.Name == "Quit")
            {
                bShouldQuit = true;
            }
        }
예제 #15
0
        public override void CreateStaticNodesIfNotPresent()
        {
            base.CreateStaticNodesIfNotPresent();

            if (InputEvents.Count == 0)
            {
                EntityLink <MonsterTest> InputLink = new EntityLink <MonsterTest>();
                InputLink.SetOwner(this);
                InputLink.Name = "Test Started";
                InputEvents.Add(InputLink);

                InputLink = new EntityLink <MonsterTest>();
                InputLink.SetOwner(this);
                InputLink.Name = "Test Failed To Start";
                InputEvents.Add(InputLink);
            }
        }
예제 #16
0
 public virtual void CreateAndAddNewStartEndNodeConnection(string ConnectionName, XMLSerializable.LinkType NodeType)
 {
     if (NodeType == XMLSerializable.LinkType.LINK_StartLink)
     {
         EntityLink <EntityType> StartLink = new EntityLink <EntityType>();
         StartLink.CurrentLinkType = XMLSerializable.LinkType.LINK_StartLink;
         StartLink.Name            = ConnectionName;
         StartingEntities.Add(StartLink);
     }
     else if (NodeType == XMLSerializable.LinkType.LINK_EndLink)
     {
         EntityLink <EntityType> EndLink = new EntityLink <EntityType>();
         EndLink.CurrentLinkType = XMLSerializable.LinkType.LINK_EndLink;
         EndLink.Name            = ConnectionName;
         EndingEntities.Add(EndLink);
     }
 }
예제 #17
0
파일: EntityLink.cs 프로젝트: fbizuneh/Igor
        public virtual void EstablishLink(EntityLink <EntityType> OtherLink)
        {
            bool bFound = false;

            foreach (EntityLink <EntityType> CurrentLink in LinkedEntities)
            {
                if (CurrentLink == OtherLink)
                {
                    bFound = true;
                    break;
                }
            }

            if (!bFound)
            {
                LinkedEntities.Add(OtherLink);
            }
        }
예제 #18
0
        public override IGraphEvent GetEventAndTriggerLink(EntityLink <MonsterTest> InputLink)
        {
            //		MonsterTestManager.GetActiveInstance().CurrentNode = this;

            base.GetEventAndTriggerLink(InputLink);

            if (TestStates == null)
            {
                LoadTestStates();
            }

            /*		if(GameManager.GetInstance() != null)
             *              {
             *                      GameManager.GetInstance().ChapterChanged();
             *              }*/

            return(TestStates.GetEventForStart(InputLink));
        }
예제 #19
0
        public virtual IGraphEvent GetEventForStart(EntityLink <MonsterTest> StartLink)
        {
            for (int CurrentLink = 0; CurrentLink < StartingEntities.Count; ++CurrentLink)
            {
                if (StartingEntities[CurrentLink].Name == StartLink.Name)
                {
                    if (StartingEntities[CurrentLink].LinkedEntities.Count > 0)
                    {
                        EntityLink <MonsterTestBase> ValidLink = StartingEntities[CurrentLink].GetValidLink();

                        if (ValidLink != null)
                        {
                            return(ValidLink.GetEventAndTriggerLink());
                        }
                    }
                }
            }

            return(null);
        }
예제 #20
0
        public override void CreateStaticNodesIfNotPresent()
        {
            base.CreateStaticNodesIfNotPresent();

            if (InputEvents.Count != 3)
            {
                InputEvents.Clear();

                EntityLink <MonsterTestBase> InputLink = new EntityLink <MonsterTestBase>();
                InputLink.SetOwner(this);
                InputLink.Name = "Start New Game";
                InputEvents.Add(InputLink);

                InputLink = new EntityLink <MonsterTestBase>();
                InputLink.SetOwner(this);
                InputLink.Name = "Load Saved Game";
                InputEvents.Add(InputLink);

                InputLink = new EntityLink <MonsterTestBase>();
                InputLink.SetOwner(this);
                InputLink.Name = "Quit";
                InputEvents.Add(InputLink);
            }
            if (OutputEvents.Count != 3)
            {
                EntityLink <MonsterTestBase> OutputLink = new EntityLink <MonsterTestBase>();
                OutputLink.SetOwner(this);
                OutputLink.Name = "Game Started";
                OutputEvents.Add(OutputLink);

                OutputLink = new EntityLink <MonsterTestBase>();
                OutputLink.SetOwner(this);
                OutputLink.Name = "Game Failed To Start";
                OutputEvents.Add(OutputLink);

                OutputLink = new EntityLink <MonsterTestBase>();
                OutputLink.SetOwner(this);
                OutputLink.Name = "Quit";
                OutputEvents.Add(OutputLink);
            }
        }
예제 #21
0
        public virtual IGraphEvent GetNextTest(EntityLink <MonsterTestBase> NextLink)
        {
            foreach (EntityLink <MonsterTest> CurrentLink in OutputEvents)
            {
                if (CurrentLink.Name == NextLink.Name)
                {
                    if (CurrentLink.Name == "Test Succeeded")
                    {
                        TestSucceeded();
                    }
                    else if (CurrentLink.Name == "Test Failed")
                    {
                        TestFailed();
                    }
                    if (CurrentLink.LinkedEntities.Count > 0 && CurrentLink.LinkedEntities[0].GetOwner() != null)
                    {
                        return(CurrentLink.LinkedEntities[0].GetOwner().GetStartingEvent());
                    }
                }
            }

            return(null);
        }
예제 #22
0
        public override IGraphEvent GetNextEvent()
        {
            IGraphEvent NextEvent = null;

            int OutputIndex = GetOutputIndex();

            if (OutputIndex != -1 && OutputEvents.Count > OutputIndex && OutputEvents[OutputIndex].LinkedEntities.Count > 0)
            {
                EntityLink <MonsterTestBase> ValidLink = OutputEvents[OutputIndex].GetValidLink();

                if (ValidLink != null)
                {
                    NextEvent = ValidLink.GetEventAndTriggerLink();
                }
            }

            if (NextEvent == null)
            {
                NextEvent = base.GetNextEvent();
            }

            return(NextEvent);
        }
예제 #23
0
파일: EntityBox.cs 프로젝트: fbizuneh/Igor
        public virtual void OnDisconnectedAnchors(Anchor <EntityType> LocalAnchor, Anchor <EntityType> RemoteAnchor)
        {
            EntityBox <EntityType> RemoteBox = RemoteAnchor.Owner;
            string LocalAnchorName           = "";
            string RemoteAnchorName          = "";

            if (Inputs.Contains(LocalAnchor))
            {
                LocalAnchorName = "Input";
            }
            else
            {
                LocalAnchorName = "Output";
            }

            LocalAnchorName += LocalAnchor.GetLabelText();

            if (RemoteBox.Inputs.Contains(RemoteAnchor))
            {
                RemoteAnchorName = "Input";
            }
            else
            {
                RemoteAnchorName = "Output";
            }

            RemoteAnchorName += RemoteAnchor.GetLabelText();

            EntityLink <EntityType> LocalLink  = GetLinkByName(LocalAnchorName);
            EntityLink <EntityType> RemoteLink = RemoteBox.GetLinkByName(RemoteAnchorName);

            if (LocalLink != null && RemoteLink != null)
            {
                LocalLink.BreakLink(RemoteLink);
            }
        }
예제 #24
0
 public virtual void TriggerLink(EntityLink <EntityType> InputLink)
 {
 }
예제 #25
0
        public virtual IGraphEvent GetEventAndTriggerLink(EntityLink <EntityType> InputLink)
        {
            TriggerLink(InputLink);

            return(this);
        }
예제 #26
0
 public override void TriggerLink(EntityLink <MonsterTestBase> InputLink)
 {
     base.TriggerLink(InputLink);
 }
예제 #27
0
파일: EntityBox.cs 프로젝트: fbizuneh/Igor
 public virtual string GetAnchorText(EntityLink <EntityType> Link)
 {
     return(Link.Name);
 }
예제 #28
0
파일: EntityLink.cs 프로젝트: fbizuneh/Igor
 public virtual void BreakLink(EntityLink <EntityType> OtherLink)
 {
     LinkedEntities.Remove(OtherLink);
 }
예제 #29
0
파일: EntityBox.cs 프로젝트: fbizuneh/Igor
        public virtual bool InspectEntityPerLinkDetails(ref EntityLink <EntityType> CurrentLink)
        {
            InspectorGUIString("Name", ref CurrentLink.Name, true);

            return(false);
        }