public void HandleSplitZonesTest()
        {
            ComponentSettings settings = new ComponentSettings();

            settings.SplitZones.Add(LIONEYES1);
            settings.SplitLevels.Add(2);
            MockTimerModel timer = new MockTimerModel();

            LoadRemoverSplitter splitter = new LoadRemoverSplitter(timer, settings);

            splitter.HandleLoadStart(1);
            splitter.HandleLoadEnd(2, "Lioneye's Watch");
            Assert.AreEqual(1, timer.NumSplits);
            // Wrong zone.
            splitter.HandleLoadStart(3);
            splitter.HandleLoadEnd(4, "The Coast");
            Assert.AreEqual(1, timer.NumSplits);
            // Not splitting on levels.
            splitter.HandleLevelUp(5, 2);
            Assert.AreEqual(1, timer.NumSplits);
            // Already entered this zone.
            splitter.HandleLoadStart(6);
            splitter.HandleLoadEnd(7, "Lioneye's Watch");
            Assert.AreEqual(1, timer.NumSplits);
        }
예제 #2
0
        public void HandleAutosplitDisabledTest()
        {
            foreach (ComponentSettings.SplitCriteria c in Enum.GetValues(typeof(ComponentSettings.SplitCriteria)))
            {
                ComponentSettings settings = new ComponentSettings();
                settings.CriteriaToSplit = c;
                settings.SplitZones.Add(LIONEYES1);
                settings.SplitZoneLevels.Add(70);
                settings.SplitLevels.Add(10);
                settings.AutoSplitEnabled = false;
                MockTimerModel timer = new MockTimerModel();

                LoadRemoverSplitter splitter = new LoadRemoverSplitter(timer, settings);
                // No splits are performed.
                splitter.HandleLevelUp(1, 10);
                splitter.HandleLevelUp(2, 70);
                splitter.HandleLoadStart(3);
                splitter.HandleLoadEnd(4, "Lioneye's Watch");
                Assert.AreEqual(0, timer.NumSplits);
            }
        }
예제 #3
0
        public void HandleSplitZonesPlusLevelTest()
        {
            ComponentSettings settings = new ComponentSettings();

            settings.SplitZones.Add(LIONEYES1);
            settings.SplitZoneLevels.Add(70);
            settings.SplitLevels.Add(2);
            MockTimerModel timer = new MockTimerModel();

            LoadRemoverSplitter splitter = new LoadRemoverSplitter(timer, settings);

            // Split on zone.
            splitter.HandleLoadStart(1);
            splitter.HandleLoadEnd(2, "Lioneye's Watch");
            Assert.AreEqual(1, timer.NumSplits);
            // Not splitting on normal level settings.
            splitter.HandleLevelUp(3, 2);
            Assert.AreEqual(1, timer.NumSplits);
            // But should split on levels added through the zone settings.
            splitter.HandleLevelUp(3, 70);
            Assert.AreEqual(2, timer.NumSplits);
        }
        public void NoSplitWhenInLabModeTest()
        {
            ComponentSettings settings = new ComponentSettings();

            settings.CriteriaToSplit = ComponentSettings.SplitCriteria.Labyrinth;
            settings.SplitLevels.Add(10);
            MockTimerModel timer = new MockTimerModel();

            LoadRemoverSplitter splitter = new LoadRemoverSplitter(timer, settings);

            // Lab mode disables other autosplitting behaviour.
            splitter.HandleLevelUp(1, 10);
            Assert.AreEqual(0, timer.NumSplits);
        }
        public void HandleLevelUpTest()
        {
            ComponentSettings settings = new ComponentSettings();

            settings.CriteriaToSplit = ComponentSettings.SplitCriteria.Levels;
            settings.SplitZones.Add(LIONEYES1);
            settings.SplitLevels.Add(10);
            MockTimerModel timer = new MockTimerModel();

            LoadRemoverSplitter splitter = new LoadRemoverSplitter(timer, settings);

            // Not splitting on this level.
            splitter.HandleLevelUp(1, 9);
            Assert.AreEqual(0, timer.NumSplits);
            splitter.HandleLevelUp(2, 10);
            Assert.AreEqual(1, timer.NumSplits);
            // Already reached this level.
            splitter.HandleLevelUp(3, 10);
            Assert.AreEqual(1, timer.NumSplits);
            // Not splitting on zones.
            splitter.HandleLoadStart(4);
            splitter.HandleLoadEnd(5, "Lioneye's Watch");
            Assert.AreEqual(1, timer.NumSplits);
        }