Example #1
0
        public virtual string DrawTestDropdown(string CurrentTestName)
        {
            List <string> TestNames = new List <string>();

            if (MonsterTestList.GetInstance() != null)
            {
                for (int CurrentIndex = 0; CurrentIndex < MonsterTestList.GetInstance().EditorGetListCount(); ++CurrentIndex)
                {
                    MonsterTest CurrentValue = MonsterTestList.GetInstance().EditorGetValueAtIndex(CurrentIndex);

                    if (CurrentValue != null)
                    {
                        TestNames.Add(CurrentValue.GetFilename());
                    }
                }
            }

            TestNames.Add("Create new test");

            int CurrentTestIndex = TestNames.IndexOf(CurrentTestName);

            if (CurrentTestIndex == -1)
            {
                CurrentTestIndex = 0;
            }

            int NewTestIndex = EditorGUILayout.Popup("Test to run", CurrentTestIndex, TestNames.ToArray());

            bool bCreatedNew = false;

            if (NewTestIndex != CurrentTestIndex || TestNames.Count == 1)
            {
                if (NewTestIndex == (TestNames.Count - 1))
                {
                    if (TestNames.Count > 1 || MonsterTestListWindow.GetInstance() == null)
                    {
                        MonsterTestListWindow.Init();
                    }

                    bCreatedNew = true;
                }

                CurrentTestIndex = NewTestIndex;
            }

            if (!bCreatedNew)
            {
                CurrentTestName = TestNames[CurrentTestIndex];
            }

            return(CurrentTestName);
        }
Example #2
0
        public virtual void StartTest(string TestName)
        {
            if (RunningTestName != TestName)
            {
                RunningTestName = TestName;

                CurrentTest = MonsterTest.LoadMonsterTest(TestName);
            }

            CurrentTestEvent = CurrentTest.GetStartingEvent();

            if (CurrentTestEvent == null)
            {
                CurrentTest.TestSucceeded();
            }
        }
Example #3
0
        public static MonsterTestManager SwapActiveMonsterTestManager(MonsterTest NewTest)
        {
            if (Instance != null)
            {
                Instance.UnloadTests();
            }

            Instance = new MonsterTestManager();

            EntityListFilename = NewTest.GetTestStateListFilename();
            Owner = NewTest;

            XMLSerializable.SerializeFromXML <MonsterTestManager>(NewTest.GetTestStateListFilename(), ref Instance, false);

            return(Instance);
        }
Example #4
0
        public virtual void PreloadTest(string TestName)
        {
            RunningTestName = TestName;

            CurrentTest = MonsterTest.LoadMonsterTest(TestName);
        }