Implements AI Switching
Build / Build (push) Successful in 58s

This commit is contained in:
Deukhoofd committed 2025-07-12 13:03:00 +02:00
1 parent 364d4b9080
commit bf83b25238
34 files changed
+903 -226

No files matched your search

+11 -2
View File
@@ -21,7 +21,12 @@ public interface IBattleParty : IDeepCloneable
/// <summary>
/// Whether the party has a living Pokemon left that is not in the field.
/// </summary>
bool HasPokemonNotInField();
bool HasUsablePokemonNotInField();
/// <summary>
/// Gets all usable Pokemon that are not currently in the field.
/// </summary>
IEnumerable<IPokemon> GetUsablePokemonNotInField();
}
/// <summary>
@@ -49,6 +54,10 @@ public class BattlePartyImpl : IBattleParty
public bool IsResponsibleForIndex(ResponsibleIndex index) => _responsibleIndices.Contains(index);
/// <inheritdoc />
public bool HasPokemonNotInField() =>
public bool HasUsablePokemonNotInField() =>
Party.WhereNotNull().Any(x => x.IsUsable && x.BattleData?.IsOnBattlefield != true);
/// <inheritdoc />
public IEnumerable<IPokemon> GetUsablePokemonNotInField() =>
Party.WhereNotNull().Where(x => x.IsUsable && x.BattleData?.IsOnBattlefield != true);
}