mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
27 lines
646 B
C#
27 lines
646 B
C#
using System.Diagnostics.CodeAnalysis;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Robust.Shared.Utility
|
|
{
|
|
public sealed class VectorSerializerUtility
|
|
{
|
|
private static char[] _separators = {',', 'x'};
|
|
|
|
public static bool TryParseArgs(string value, int count, [NotNullWhen(true)] out string[]? args)
|
|
{
|
|
foreach (var separator in _separators)
|
|
{
|
|
args = value.Split(separator);
|
|
if (args.Length == count)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
}
|
|
|
|
args = null;
|
|
return false;
|
|
}
|
|
}
|
|
}
|