Add all missing docs

This commit is contained in:
2025-05-03 14:18:12 +02:00
parent 4d5dfd0342
commit 441f5dddaf
40 changed files with 400 additions and 21 deletions

View File

@@ -1,3 +1,4 @@
using JetBrains.Annotations;
using PkmnLib.Dynamic.Models;
using PkmnLib.Dynamic.Models.Choices;
using PkmnLib.Static.Moves;
@@ -8,12 +9,13 @@ namespace PkmnLib.Dynamic.AI;
/// <summary>
/// The base class for implementing an AI for Pokémon.
/// </summary>
[PublicAPI]
public abstract class PokemonAI
{
/// <summary>
/// The name of the AI.
/// </summary>
public StringKey Name { get; set; }
public StringKey Name { get; }
/// <inheritdoc cref="PokemonAI" />
protected PokemonAI(StringKey name)
@@ -26,9 +28,11 @@ public abstract class PokemonAI
/// </summary>
public abstract ITurnChoice GetChoice(IBattle battle, IPokemon pokemon);
/// <summary>
/// For a given user and move, returns the valid targets for that move.
/// </summary>
public IEnumerable<(byte side, byte position)> GetValidTargetsForMove(IPokemon user, ILearnedMove move)
{
byte GetOppositeSide(byte side) => side == 0 ? (byte)1 : (byte)0;
var userBattleData = user.BattleData!;
switch (move.MoveData.Target)
{
@@ -90,5 +94,7 @@ public abstract class PokemonAI
default:
throw new ArgumentOutOfRangeException();
}
yield break;
byte GetOppositeSide(byte side) => side == 0 ? (byte)1 : (byte)0;
}
}