From 4663636803c178b13efbac57022d1447b371d213 Mon Sep 17 00:00:00 2001 From: minisbett <39670899+minisbett@users.noreply.github.com> Date: Fri, 18 Oct 2024 14:14:31 +0200 Subject: [PATCH 1/6] Remove --output parameter --- PerformanceCalculator/Difficulty/DifficultyCommand.cs | 3 --- .../Difficulty/LegacyScoreAttributesCommand.cs | 3 --- PerformanceCalculator/Leaderboard/LeaderboardCommand.cs | 3 --- PerformanceCalculator/ProcessorCommand.cs | 9 --------- PerformanceCalculator/Profile/ProfileCommand.cs | 3 --- 5 files changed, 21 deletions(-) diff --git a/PerformanceCalculator/Difficulty/DifficultyCommand.cs b/PerformanceCalculator/Difficulty/DifficultyCommand.cs index 5fa1ac98a..484d54b88 100644 --- a/PerformanceCalculator/Difficulty/DifficultyCommand.cs +++ b/PerformanceCalculator/Difficulty/DifficultyCommand.cs @@ -63,9 +63,6 @@ public override void Execute() string json = JsonConvert.SerializeObject(resultSet); Console.WriteLine(json); - - if (OutputFile != null) - File.WriteAllText(OutputFile, json); } else { diff --git a/PerformanceCalculator/Difficulty/LegacyScoreAttributesCommand.cs b/PerformanceCalculator/Difficulty/LegacyScoreAttributesCommand.cs index 31ce58a30..053287b7d 100644 --- a/PerformanceCalculator/Difficulty/LegacyScoreAttributesCommand.cs +++ b/PerformanceCalculator/Difficulty/LegacyScoreAttributesCommand.cs @@ -62,9 +62,6 @@ public override void Execute() string json = JsonConvert.SerializeObject(resultSet); Console.WriteLine(json); - - if (OutputFile != null) - File.WriteAllText(OutputFile, json); } else { diff --git a/PerformanceCalculator/Leaderboard/LeaderboardCommand.cs b/PerformanceCalculator/Leaderboard/LeaderboardCommand.cs index 52bd5fe44..b66fa55b0 100644 --- a/PerformanceCalculator/Leaderboard/LeaderboardCommand.cs +++ b/PerformanceCalculator/Leaderboard/LeaderboardCommand.cs @@ -98,9 +98,6 @@ public override void Execute() var json = JsonConvert.SerializeObject(calculatedPlayers); Console.Write(json); - - if (OutputFile != null) - File.WriteAllText(OutputFile, json); } else { diff --git a/PerformanceCalculator/ProcessorCommand.cs b/PerformanceCalculator/ProcessorCommand.cs index deef8047b..d99e50153 100644 --- a/PerformanceCalculator/ProcessorCommand.cs +++ b/PerformanceCalculator/ProcessorCommand.cs @@ -26,10 +26,6 @@ public abstract class ProcessorCommand /// public IConsole Console { get; private set; } - [UsedImplicitly] - [Option(Template = "-o|--output ", Description = "Output results to text file.")] - public string OutputFile { get; } - [UsedImplicitly] [Option(Template = "-j|--json", Description = "Output results as JSON.")] public bool OutputJson { get; } @@ -65,9 +61,6 @@ public void OutputPerformance(ScoreInfo score, PerformanceAttributes performance string json = JsonConvert.SerializeObject(result, Formatting.Indented); Console.WriteLine(json); - - if (OutputFile != null) - File.WriteAllText(OutputFile, json); } else { @@ -131,8 +124,6 @@ public void OutputDocument(Document document) str = string.Join('\n', lines); Console.Write(str); - if (OutputFile != null) - File.WriteAllText(OutputFile, str); } } diff --git a/PerformanceCalculator/Profile/ProfileCommand.cs b/PerformanceCalculator/Profile/ProfileCommand.cs index 79a037546..41fc98e9f 100644 --- a/PerformanceCalculator/Profile/ProfileCommand.cs +++ b/PerformanceCalculator/Profile/ProfileCommand.cs @@ -109,9 +109,6 @@ public override void Execute() }); Console.Write(json); - - if (OutputFile != null) - File.WriteAllText(OutputFile, json); } else { From f7d3b1b9f5dc0a57a4d10d7105b80c2645a44f43 Mon Sep 17 00:00:00 2001 From: minisbett <39670899+minisbett@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:38:12 +0200 Subject: [PATCH 2/6] Add mod settings support --- .../Simulate/SimulateCommand.cs | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/PerformanceCalculator/Simulate/SimulateCommand.cs b/PerformanceCalculator/Simulate/SimulateCommand.cs index 51ad4ad67..5f0804d08 100644 --- a/PerformanceCalculator/Simulate/SimulateCommand.cs +++ b/PerformanceCalculator/Simulate/SimulateCommand.cs @@ -4,10 +4,17 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.Globalization; using System.Linq; +using System.Reflection; +using System.Text.RegularExpressions; using JetBrains.Annotations; using McMaster.Extensions.CommandLineUtils; +using osu.Framework.Bindables; using osu.Game.Beatmaps; +using osu.Game.Configuration; +using osu.Game.Extensions; +using osu.Game.Online.API; using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; @@ -34,6 +41,11 @@ public abstract class SimulateCommand : ProcessorCommand + " Values: hr, dt, hd, fl, etc...")] public string[] Mods { get; set; } + [UsedImplicitly] + [Option(CommandOptionType.MultipleValue, Template = "-o|--mod-option