Beispiel #1
0
        public void EndLastChallenge(string output)
        {
            if (lastChallenge == null)
            {
                return;
            }

            lastChallenge.SetEndNow();

            lastChallenge.keypresses = new List <Keypress>(savedPresses);
            savedPresses.Clear();

            lastChallenge.output = output;
            lastChallenge        = null;
        }
Beispiel #2
0
        public void Push(TrialItem item, string currentOutput, string currentLayoutName)
        {
            if (lastChallenge != null)
            {
                EndLastChallenge(currentOutput);
            }

            if (item is Challenge)
            {
                results.Add(lastChallenge = new ChallengeResult(item as Challenge, currentLayoutName));
            }
            else if (item is Command)
            {
                results.Add(new CommandResult(item as Command));
            }
            else if (item is Comment)
            {
                // comment is logged earlier or later, but nothing happens here.
            }
            else
            {
                throw new ArgumentException($"{item.GetType()} not recognized");
            }
        }