More moves implemented

This commit is contained in:
2025-02-01 15:00:22 +01:00
parent 3a75493912
commit 00fe08dcd4
50 changed files with 1146 additions and 139 deletions

View File

@@ -0,0 +1,25 @@
namespace PkmnLib.Static.Utils.Errors;
/// <summary>
/// A result that indicates an index is out of range.
/// </summary>
public class OutOfRangeException : Exception
{
private readonly string _hint;
private readonly int _index;
private readonly int _max;
/// <inheritdoc cref="OutOfRangeException"/>
public OutOfRangeException(string hint, int index, int max)
{
_hint = hint;
_index = index;
_max = max;
}
/// <inheritdoc />
public override string Message => _max == 0
? $"{_hint} index {_index} is out of range. Collection is empty."
: $"{_hint} index {_index} is out of range. Must be between 0 and {_max - 1}.";
}