diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-01-26 19:49:17 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-01-26 19:49:17 -0500 |
commit | 22a0a32b6d959946bfd80bf0ca9796378f36e0cd (patch) | |
tree | 4dc91461e2a06148c975d12d46986a6a9648e1ff /src/SMAPI.Mods.ConsoleCommands/Framework/Commands/ArgumentParser.cs | |
parent | 1b905205a3073c56e29c46b5e57c4a9cb2ca5832 (diff) | |
download | SMAPI-22a0a32b6d959946bfd80bf0ca9796378f36e0cd.tar.gz SMAPI-22a0a32b6d959946bfd80bf0ca9796378f36e0cd.tar.bz2 SMAPI-22a0a32b6d959946bfd80bf0ca9796378f36e0cd.zip |
refactor performance counter code
This commit performs some general refactoring, including...
- avoid manually duplicating the event list;
- rework the 'is important' event flag;
- remove the new packages (Cyotek.Collections can be replaced with built-in types, and System.ValueTuple won't work in the Mono version used on Linux/Mac);
- improve performance;
- minor cleanup.
Diffstat (limited to 'src/SMAPI.Mods.ConsoleCommands/Framework/Commands/ArgumentParser.cs')
-rw-r--r-- | src/SMAPI.Mods.ConsoleCommands/Framework/Commands/ArgumentParser.cs | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/ArgumentParser.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/ArgumentParser.cs index 40691a3e..9c7082c9 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/ArgumentParser.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/ArgumentParser.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Globalization; @@ -32,13 +32,6 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands /// <param name="index">The zero-based index of the element to get.</param> public string this[int index] => this.Args[index]; - /// <summary>A method which parses a string argument into the given value.</summary> - /// <typeparam name="T">The expected argument type.</typeparam> - /// <param name="input">The argument to parse.</param> - /// <param name="output">The parsed value.</param> - /// <returns>Returns whether the argument was successfully parsed.</returns> - public delegate bool ParseDelegate<T>(string input, out T output); - /********* ** Public methods @@ -114,19 +107,6 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands return true; } - public bool IsDecimal(int index) - { - if (!this.TryGet(index, "", out string raw, false)) - return false; - - if (!decimal.TryParse(raw, NumberStyles.Number, CultureInfo.InvariantCulture, out decimal value)) - { - return false; - } - - return true; - } - /// <summary>Try to read a decimal argument.</summary> /// <param name="index">The argument index.</param> /// <param name="name">The argument name for error messages.</param> |