Remove FluentResults, documentation

This commit is contained in:
2024-07-28 12:52:17 +02:00
parent 5d6149b18b
commit 10f411f076
25 changed files with 224 additions and 44 deletions

View File

@@ -1,5 +1,8 @@
namespace PkmnLib.Dynamic.Models.Choices;
/// <summary>
/// A choice to flee from a battle.
/// </summary>
public interface IFleeChoice : ITurnChoice
{

View File

@@ -1,5 +1,8 @@
namespace PkmnLib.Dynamic.Models.Choices;
/// <summary>
/// A choice to use an item
/// </summary>
public interface IItemChoice : ITurnChoice
{

View File

@@ -1,5 +1,8 @@
namespace PkmnLib.Dynamic.Models.Choices;
/// <summary>
/// A choice to pass a turn.
/// </summary>
public interface IPassChoice : ITurnChoice
{

View File

@@ -1,5 +1,8 @@
namespace PkmnLib.Dynamic.Models.Choices;
/// <summary>
/// A choice to switch to a different Pokémon.
/// </summary>
public interface ISwitchChoice : ITurnChoice
{

View File

@@ -2,6 +2,9 @@ using PkmnLib.Dynamic.ScriptHandling;
namespace PkmnLib.Dynamic.Models.Choices;
/// <summary>
/// A choice that is made at the beginning of a turn. This can be a switch, flee, item, or pass choice.
/// </summary>
public interface ITurnChoice : IScriptSource
{
/// <summary>
@@ -33,24 +36,49 @@ public interface ITurnChoice : IScriptSource
public void Fail();
}
/// <summary>
/// A basic implementation of a <see cref="ITurnChoice"/>.
/// </summary>
public abstract class TurnChoice : ScriptSource, ITurnChoice
{
/// <inheritdoc cref="TurnChoice"/>
protected TurnChoice(IPokemon user)
{
User = user;
}
/// <summary>
/// The Pokemon for which the choice is made.
/// </summary>
public IPokemon User { get; }
/// <summary>
/// The speed of the user at the beginning of the turn.
/// </summary>
/// <remarks>
/// As a developer you do not need to set this value. It is set at the beginning of a turn automatically.
/// </remarks>
public uint Speed { get; set; }
/// <summary>
/// A random value that is set at the beginning of the turn. This is used for tie breaking of the turn order.
/// </summary>
/// <remarks>
/// As a developer you do not need to set this value. It is set at the beginning of a turn automatically.
/// </remarks>
public uint RandomValue { get; set; }
/// <summary>
/// Whether the choice has failed. A failed choice will stop running, and execute special fail handling
/// during turn execution.
/// </summary>
public bool HasFailed { get; private set; }
/// <summary>
/// Fail the choice. This will prevent it from executing and run a specific fail handling during execution.
/// </summary>
public void Fail()
{
HasFailed = true;
}
}
}