Lots more work on implementing battling

This commit is contained in:
2024-08-10 09:44:46 +02:00
parent 554e1cf2cd
commit a049dda240
29 changed files with 1226 additions and 48 deletions

View File

@@ -5,6 +5,8 @@ namespace PkmnLib.Dynamic.Models.Choices;
/// </summary>
public class TurnChoiceComparer : IComparer<ITurnChoice>
{
public static TurnChoiceComparer Instance { get; } = new();
private enum CompareValues
{
XEqualsY = 0,
@@ -12,7 +14,7 @@ public class TurnChoiceComparer : IComparer<ITurnChoice>
XGreaterThanY = 1
}
private CompareValues CompareForSameType(ITurnChoice x, ITurnChoice y)
private static CompareValues CompareForSameType(ITurnChoice x, ITurnChoice y)
{
// Higher speed goes first
var speedComparison = x.Speed.CompareTo(y.Speed);
@@ -23,7 +25,7 @@ public class TurnChoiceComparer : IComparer<ITurnChoice>
return (CompareValues)x.RandomValue.CompareTo(y.RandomValue);
}
private CompareValues CompareImpl(ITurnChoice? x, ITurnChoice? y)
private static CompareValues CompareImpl(ITurnChoice? x, ITurnChoice? y)
{
// Deal with possible null values
switch (x)