using PkmnLib.Dynamic.ScriptHandling; namespace PkmnLib.Dynamic.Models.Choices; public interface ITurnChoice : IScriptSource { /// /// The user of the turn choice /// IPokemon User { get; } /// /// The speed of the user at the beginning of the turn. /// uint Speed { get; set; } /// /// This random value is set at the beginning of the turn. It is used for tie breaking of the /// turn order in a predictable way, regardless of implementation and hardware. /// uint RandomValue { get; set; } /// /// Whether the choice has failed. A failed choice will stop running, and execute special /// fail handling during turn execution. /// bool HasFailed { get; } /// /// Fails the choice. This will prevent it from executing and run a specific fail handling during /// execution. Note that this can not be undone. /// public void Fail(); } public abstract class TurnChoice : ScriptSource, ITurnChoice { protected TurnChoice(IPokemon user) { User = user; } public IPokemon User { get; } public uint Speed { get; set; } public uint RandomValue { get; set; } public bool HasFailed { get; private set; } public void Fail() { HasFailed = true; } }