Пример #1
0
        private async Task SpectatorAsync()
        {
            while (!consoleTokenProvider.Token.IsCancellationRequested)
            {
                LoadedReplay loadedReplay = await replayProvider.TryLoadNextReplayAsync();

                if (loadedReplay != null)
                {
                    await gameManager.LaunchAndSpectate(loadedReplay);
                }
            }
        }
Пример #2
0
        public async Task OutputReportAsync()
        {
            await gameData.LoadDataAsync().ConfigureAwait(false);

            LoadedReplay loadedReplay = await provider.TryLoadNextReplayAsync();

            IEnumerable <string> lines = analyzer.GetPlayers(loadedReplay.Replay)
                                         .Select(WriteCsvLine)
                                         .Prepend(string.Join(",", headers));

            Directory.CreateDirectory(settings.SpectateReportPath);

            string report = Path.Combine(settings.SpectateReportPath, Path.GetFileName(loadedReplay.FileInfo.FullName) + ".csv");

            await File.WriteAllLinesAsync(report, lines, tokenProvider.Token);
        }