Added VDF Generator
This commit is contained in:
20
007SaveTool/VdfGenerator/NumberParser.cs
Normal file
20
007SaveTool/VdfGenerator/NumberParser.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace EonaCat.FirstLight.SaveTransfer.VdfGenerator;
|
||||
|
||||
public static class NumberParser
|
||||
{
|
||||
/// <summary>
|
||||
/// Parses the specified string as a 32-bit signed integer value.
|
||||
/// </summary>
|
||||
/// <param name="s">The string representation of the number to parse.</param>
|
||||
/// <returns>The parsed 32-bit signed integer value if the parse operation succeeds; otherwise, 0.</returns>
|
||||
public static int ParseInt(string s)
|
||||
=> int.TryParse(s, out var v) ? v : 0;
|
||||
|
||||
/// <summary>
|
||||
/// Parses the specified string representation of a number to a 64-bit signed integer.
|
||||
/// </summary>
|
||||
/// <param name="s">The string containing the number to parse.</param>
|
||||
/// <returns>The parsed 64-bit signed integer value if parsing succeeds; otherwise, 0.</returns>
|
||||
public static long ParseLong(string s)
|
||||
=> long.TryParse(s, out var v) ? v : 0;
|
||||
}
|
||||
Reference in New Issue
Block a user