/// <summary>Gets a specific active <see cref="PBEPokemon"/> by its <see cref="PBEPokemon.FieldPosition"/>.</summary> /// <param name="pos">The <see cref="PBEFieldPosition"/> of the <see cref="PBEPokemon"/>.</param> public PBEPokemon TryGetPokemon(PBEFieldPosition pos) { if (IsDisposed) { throw new ObjectDisposedException(null); } return(ActiveBattlers.SingleOrDefault(p => p.FieldPosition == pos)); }
/// <summary>Gets a specific active <see cref="PBEBattlePokemon"/> by its <see cref="PBEBattlePokemon.FieldPosition"/>.</summary> /// <param name="pos">The <see cref="PBEFieldPosition"/> of the <see cref="PBEBattlePokemon"/>.</param> public PBEBattlePokemon TryGetPokemon(PBEFieldPosition pos) { return(ActiveBattlers.SingleOrDefault(p => p.FieldPosition == pos)); }
/// <summary> /// Gets a specific active Pokémon by its position. /// </summary> /// <param name="pos">The position of the Pokémon you want to get.</param> /// <returns>null if no Pokémon was found was found at <paramref name="pos"/>; otherwise the <see cref="PBEPokemon"/>.</returns> public PBEPokemon TryGetPokemon(PBEFieldPosition pos) => ActiveBattlers.SingleOrDefault(p => p.FieldPosition == pos);