Ejemplo n.º 1
0
        public void CompleteLevel(int level)
        {
            if (level == 3 || level == 4 || ModLoader.Settings.ILMode)
            {
                Freeze();
            }

            Split();
            DoAfterUpdate(() =>
            {
                var time = new SpeedrunTime(_speedrunStopwatch.RealTime, _beatTimer.Time);
                RunLog.CompleteLevel(level, time);

                if (level != 2)
                {
                    Log(level);
                }
            });
        }
Ejemplo n.º 2
0
        public void AllLevels()
        {
            var log           = new RunLog();
            var timeIncrement = new SpeedrunTime(TimeSpan.FromMinutes(3.1374), TimeSpan.FromMinutes(2.7684));
            var timer         = new SpeedrunTime();

            for (var lvl = 1; lvl <= log.Levels.Length; lvl++)
            {
                timer += timeIncrement;
                log.LevelStart(lvl, timer);

                var expectedLevelTime = new SpeedrunTime();
                for (var i = 0; i < lvl; i++)
                {
                    timer             += timeIncrement;
                    expectedLevelTime += timeIncrement;
                }

                log.CompleteLevel(lvl, timer);

                Assert.AreEqual(expectedLevelTime, log.Levels[lvl - 1].Time);
                Assert.AreEqual(timer, log.Levels[lvl - 1].SplitTime);
            }
        }