Implement most pokeballs
All checks were successful
Build / Build (push) Successful in 1m2s

This commit is contained in:
2025-07-20 11:15:45 +02:00
parent db3f7f2403
commit 77d7b86a3c
19 changed files with 452 additions and 38 deletions

View File

@@ -20,6 +20,18 @@ public static class NumericHelpers
return result > byte.MaxValue ? byte.MaxValue : (byte)result;
}
public static byte AddOrMax(this byte value, byte addend)
{
var result = value + addend;
return result > byte.MaxValue ? byte.MaxValue : (byte)result;
}
public static byte SubtractOrMin(this byte value, byte subtrahend)
{
var result = value - subtrahend;
return result < 0 ? (byte)0 : (byte)result;
}
/// <summary>
/// Multiplies two values. If this overflows, returns <see cref="byte.MaxValue"/>.
/// </summary>