Make PokemonParty an IReadOnlyList instead of IEnumerable

This commit is contained in:
Deukhoofd 2022-05-15 13:12:02 +02:00
parent 4ce0aa54ea
commit e3f8e7e71c
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 6 additions and 3 deletions

View File

@ -6,7 +6,7 @@ using PkmnLibSharp.Utilities;
namespace PkmnLibSharp.Battling
{
public class PokemonParty : PointerWrapper, IEnumerable<Pokemon?>
public class PokemonParty : PointerWrapper, IReadOnlyList<Pokemon?>
{
public delegate void OnSwitchDelegate(ulong a, ulong b);
public event OnSwitchDelegate? OnSwitch;
@ -114,8 +114,11 @@ namespace PkmnLibSharp.Battling
_cache = null;
}
public int Count => (int)Length;
public int IndexOf(Pokemon? pokemon)
{
return Party.IndexOf(pokemon);
}
}
}