예제 #1
0
        public void SubmitComboResult(string combo, ResultType resultType, CaptureDictionary captures = null, bool outputResult = true, string file = null, string directory = null)
        {
            _runInformations = RunInformations.GetOrNewInstance();
            _formatUtils     = FormatUtils.GetOrNewInstance();
            _fileUtils       = FileUtils.GetOrNewInstance();
            _consoleUtils    = ConsoleUtils.GetOrNewInstance();

            if (resultType != ResultType.Invalid)
            {
                Interlocked.Increment(ref _runInformations.hits);

                if (resultType == ResultType.Free)
                {
                    Interlocked.Increment(ref _runInformations.free);
                }

                if (outputResult)
                {
                    string output = _formatUtils.FormatOutput(combo, captures != null ? _formatUtils.CaptureDictionaryToString(captures) : null);

                    _fileUtils.WriteLine(output, $"{file ?? (resultType == ResultType.Free ? "Free" : "Hits")}.txt", directory ?? $"Results/{_runInformations.runStartFormattedDate}");

                    _consoleUtils.WriteLine(output, resultType == ResultType.Free ? ConsoleColor.Cyan : ConsoleColor.Green);
                }
            }

            Interlocked.Increment(ref _runInformations.ran);
        }
예제 #2
0
        public void FinishRun()
        {
            _runInformations  = RunInformations.GetOrNewInstance();
            _customStatistics = CustomStatistics.GetOrNewInstance();
            _consoleUtils     = ConsoleUtils.GetOrNewInstance();

            _runInformations.runStatus = RunInformations.RunStatus.Finished;

            _consoleUtils.WriteLine(null);
            _customStatistics.DisplayCustomStatistics();

            _consoleUtils.UpdateTitle();
            _consoleUtils.Write($"{Environment.NewLine}Finished ");
        }
예제 #3
0
        public void StartRun()
        {
            _consoleUtils     = ConsoleUtils.GetOrNewInstance();
            _runInformations  = RunInformations.GetOrNewInstance();
            _loopsManager     = LoopsManager.GetOrNewInstance();
            _keyboardListener = KeyboardListener.GetOrNewInstance();

            _runInformations.SetRunStartDate();
            _runInformations.runStatus = RunInformations.RunStatus.Running;

            _loopsManager.StartAllLoops();
            _keyboardListener.StartListening();

            _consoleUtils.WriteLine($"Powered by Milky Library 1.2{Environment.NewLine}");
        }
예제 #4
0
 public static RunInformations GetOrNewInstance()
 {
     return(_classInstance ?? (_classInstance = new RunInformations()));
 }