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

            settings.CriteriaToSplit = ComponentSettings.SplitCriteria.Labyrinth;
            settings.LabSplitType    = ComponentSettings.LabSplitMode.AllZones;
            MockTimerModel timer = new MockTimerModel();

            LoadRemoverSplitter splitter = new LoadRemoverSplitter(timer, settings);

            // Enter Aspirants' Plaza.
            splitter.HandleLoadStart(3);
            splitter.HandleLoadEnd(4, "Aspirants' Plaza");
            // Activated lab device.
            splitter.HandleIzaroDialogue(6, "Justice will prevail.");
            Assert.AreEqual(1, timer.NumStarts);
            Assert.AreEqual(0, timer.NumSplits);
            // Run through an intermediate lab zone.
            splitter.HandleLoadStart(7);
            splitter.HandleLoadEnd(8, "...");
            Assert.AreEqual(1, timer.NumSplits);
            // Enter Aspirants' Plaza resets timer
            splitter.HandleLoadStart(9);
            splitter.HandleLoadEnd(10, "Aspirants' Plaza");
            Assert.AreEqual(0, timer.NumStarts);
            Assert.AreEqual(0, timer.NumSplits);
        }
        public void LabAllZonesTest()
        {
            ComponentSettings settings = new ComponentSettings();

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

            LoadRemoverSplitter splitter = new LoadRemoverSplitter(timer, settings);

            splitter.HandleIzaroDialogue(1, "...");
            Assert.AreEqual(0, timer.NumStarts);
            // Enter Aspirants' Plaza.
            splitter.HandleLoadStart(3);
            splitter.HandleLoadEnd(4, "Aspirants' Plaza");
            Assert.AreEqual(0, timer.NumSplits);
            // Intro Izaro dialogue.
            splitter.HandleIzaroDialogue(5, "You stand before the gates of the lord's labyrinth. Within these walls the Lady of Justice doth preside. She shall weigh your mind in one hand, your heart another. Should she find you wanting, death will be your sentence. Should she find you worthy, you will be given the loyalty and love of an empire. Choose wisely. Strike quickly. Trust completely. And may you find the ending that you deserve.");
            Assert.AreEqual(0, timer.NumStarts);
            // Activated lab device.
            splitter.HandleIzaroDialogue(6, "Justice will prevail.");
            Assert.AreEqual(1, timer.NumStarts);
            Assert.AreEqual(0, timer.NumSplits);
            // Run through some zones.
            splitter.HandleLoadStart(7);
            splitter.HandleLoadEnd(8, "...");
            Assert.AreEqual(1, timer.NumSplits);
            splitter.HandleLoadStart(8);
            splitter.HandleLoadEnd(9, "...");
            Assert.AreEqual(2, timer.NumSplits);
            // Izaro death
            splitter.HandleIzaroDialogue(10, "I die for the Empire!");
            Assert.AreEqual(3, timer.NumSplits);
        }
        public void LabOnlyTrialsTest()
        {
            ComponentSettings settings = new ComponentSettings();

            settings.CriteriaToSplit = ComponentSettings.SplitCriteria.Labyrinth;
            settings.LabSplitType    = ComponentSettings.LabSplitMode.Trials;
            MockTimerModel timer = new MockTimerModel();

            LoadRemoverSplitter splitter = new LoadRemoverSplitter(timer, settings);

            // Enter Aspirants' Plaza.
            splitter.HandleLoadStart(3);
            splitter.HandleLoadEnd(4, "Aspirants' Plaza");
            // Activated lab device.
            splitter.HandleIzaroDialogue(6, "Justice will prevail.");
            Assert.AreEqual(1, timer.NumStarts);
            Assert.AreEqual(0, timer.NumSplits);
            // Run through an intermediate lab zone.
            splitter.HandleLoadStart(7);
            splitter.HandleLoadEnd(8, "...");
            Assert.AreEqual(0, timer.NumSplits);
            // Arrive at Aspirant's Trial.
            splitter.HandleLoadStart(8);
            splitter.HandleLoadEnd(9, "Aspirant's Trial");
            Assert.AreEqual(1, timer.NumSplits);
            splitter.HandleLoadStart(10);
            splitter.HandleLoadEnd(11, "Aspirant's Trial");
            Assert.AreEqual(2, timer.NumSplits);
            // Izaro death
            splitter.HandleIzaroDialogue(12, "You are free!");
            Assert.AreEqual(3, timer.NumSplits);
        }
        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);
        }
        public void Part1Part2Test()
        {
            ComponentSettings settings = new ComponentSettings();

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

            LoadRemoverSplitter splitter = new LoadRemoverSplitter(timer, settings);

            splitter.HandleLoadStart(1);
            splitter.HandleLoadEnd(2, "Lioneye's Watch");
            Assert.AreEqual(1, timer.NumSplits);
            // Already entered and still considered part 1.
            splitter.HandleLoadStart(3);
            splitter.HandleLoadEnd(4, "Lioneye's Watch");
            Assert.AreEqual(1, timer.NumSplits);
            // Enter the prerequisite zone.
            splitter.HandleLoadStart(5);
            splitter.HandleLoadEnd(6, "The Cathedral Rooftop");
            Assert.AreEqual(1, timer.NumSplits);
            // Now considered to be entering part 2.
            splitter.HandleLoadStart(7);
            splitter.HandleLoadEnd(8, "Lioneye's Watch");
            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);
        }
Beispiel #7
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);
            }
        }
Beispiel #8
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 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);
        }
Beispiel #10
0
 public ClientReader(ComponentSettings settings, LoadRemoverSplitter splitter)
 {
     this.settings = settings;
     parser        = new ClientParser(splitter);
 }