2024-09-30 17:23:56 +00:00
|
|
|
using PkmnLib.Dynamic.ScriptHandling;
|
|
|
|
using PkmnLib.Static;
|
|
|
|
|
2024-07-27 14:26:45 +00:00
|
|
|
namespace PkmnLib.Dynamic.Models.Choices;
|
|
|
|
|
2024-07-28 10:52:17 +00:00
|
|
|
/// <summary>
|
|
|
|
/// A choice to use an item
|
|
|
|
/// </summary>
|
2024-07-27 14:26:45 +00:00
|
|
|
public interface IItemChoice : ITurnChoice
|
|
|
|
{
|
2025-01-10 10:11:50 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The item that is used.
|
|
|
|
/// </summary>
|
|
|
|
public IItem Item { get; }
|
2024-07-27 14:26:45 +00:00
|
|
|
|
2025-01-10 10:11:50 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The side the move is targeted at.
|
|
|
|
/// </summary>
|
|
|
|
byte? TargetSide { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The position the move is targeted at.
|
|
|
|
/// </summary>
|
|
|
|
byte? TargetPosition { get; }
|
2024-09-30 17:23:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <inheritdoc cref="IItemChoice"/>
|
|
|
|
public class ItemChoice : TurnChoice, IItemChoice
|
|
|
|
{
|
2025-01-10 10:11:50 +00:00
|
|
|
public ItemChoice(IPokemon user, IItem item, byte? targetSide, byte? targetPosition) : base(user)
|
2024-09-30 17:23:56 +00:00
|
|
|
{
|
|
|
|
Item = item;
|
2025-01-10 10:11:50 +00:00
|
|
|
TargetSide = targetSide;
|
|
|
|
TargetPosition = targetPosition;
|
2024-09-30 17:23:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public IItem Item { get; }
|
|
|
|
|
2025-01-10 10:11:50 +00:00
|
|
|
/// <inheritdoc />
|
|
|
|
public byte? TargetSide { get; }
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public byte? TargetPosition { get; }
|
|
|
|
|
2024-09-30 17:23:56 +00:00
|
|
|
/// <inheritdoc />
|
|
|
|
public override int ScriptCount => User.ScriptCount;
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public override void GetOwnScripts(List<IEnumerable<ScriptContainer>> scripts)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public override void CollectScripts(List<IEnumerable<ScriptContainer>> scripts)
|
|
|
|
{
|
|
|
|
User.CollectScripts(scripts);
|
|
|
|
}
|
2024-07-27 14:26:45 +00:00
|
|
|
}
|