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

@@ -3,8 +3,12 @@ using PkmnLib.Static;
namespace PkmnLib.Dynamic.Libraries;
/// <summary>
/// Represents the result of a capture attempt.
/// </summary>
public record struct CaptureResult
{
/// <inheritdoc cref="CaptureResult"/>
public CaptureResult(bool IsCaught, int Shakes, bool CriticalCapture)
{
this.IsCaught = IsCaught;
@@ -12,14 +16,35 @@ public record struct CaptureResult
this.CriticalCapture = CriticalCapture;
}
/// <summary>
/// Indicates whether the capture was successful.
/// </summary>
public bool IsCaught { get; init; }
/// <summary>
/// The number of shakes the Poké Ball made before the capture attempt was successful or failed.
/// </summary>
public int Shakes { get; init; }
/// <summary>
/// Indicates whether a critical capture occurred. A critical capture is a special case where the Poké Ball
/// shakes only once and then captures the Pokémon.
/// </summary>
public bool CriticalCapture { get; init; }
/// <summary>
/// Creates a <see cref="CaptureResult"/> indicating a failed capture attempt.
/// </summary>
public static CaptureResult Failed => new(false, 0, false);
}
/// <summary>
/// Interface for a library that handles Pokémon capture mechanics.
/// </summary>
public interface ICaptureLibrary
{
/// <summary>
/// Attempts to capture a Pokémon using a specified item (e.g., Poké Ball).
/// </summary>
CaptureResult TryCapture(IPokemon target, IItem captureItem, IBattleRandom random);
}

View File

@@ -20,5 +20,8 @@ public interface IMiscLibrary
/// </summary>
TimeOfDay GetTimeOfDay();
/// <summary>
/// Returns whether the given Pokemon can flee from the battle.
/// </summary>
bool CanFlee(IBattle battle, IFleeChoice fleeChoice);
}