Пример #1
0
        public MilkyManager()
        {
            KeyboardListener = KeyboardListener.GetOrNewInstance();

            ConsoleLoops    = ConsoleLoops.GetOrNewInstance();
            LoopsManager    = LoopsManager.GetOrNewInstance();
            StatisticsLoops = StatisticsLoops.GetOrNewInstance();

            OutputSettings = OutputSettings.GetOrNewInstance();

            ProgramInformations = ProgramInformations.GetOrNewInstance();
            ProgramManager      = ProgramManager.GetOrNewInstance();

            RunInformations = RunInformations.GetOrNewInstance();
            RunLists        = RunLists.GetOrNewInstance();
            RunManager      = RunManager.GetOrNewInstance();

            ConsoleSettings = ConsoleSettings.GetOrNewInstance();
            RunSettings     = RunSettings.GetOrNewInstance();

            CustomStatistics = CustomStatistics.GetOrNewInstance();
            RunStatistics    = RunStatistics.GetOrNewInstance();

            ConsoleUtils  = ConsoleUtils.GetOrNewInstance();
            DateTimeUtils = DateTimeUtils.GetOrNewInstance();
            FileUtils     = FileUtils.GetOrNewInstance();
            FormatUtils   = FormatUtils.GetOrNewInstance();
            HashUtils     = HashUtils.GetOrNewInstance();
            ListUtils     = ListUtils.GetOrNewInstance();
            RequestUtils  = RequestUtils.GetOrNewInstance();
            StringUtils   = StringUtils.GetOrNewInstance();
            UserUtils     = UserUtils.GetOrNewInstance();
        }
Пример #2
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);
        }