Refactor move selection prevention to use interface
This commit is contained in:
@@ -61,13 +61,6 @@ public abstract class Script : IDeepCloneable
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override to customize whether the move can be selected at all.
|
||||
/// </summary>
|
||||
public virtual void PreventMoveSelection(IMoveChoice choice, ref bool prevent)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Force a certain move choice to be selected. If the choice is set, the Pokemon will be forced
|
||||
/// to use it, and will not be able to select any other choice.
|
||||
@@ -854,4 +847,15 @@ public interface IScriptOnInitialize
|
||||
/// with parameters that are passed to it.
|
||||
/// </summary>
|
||||
void OnInitialize(IReadOnlyDictionary<StringKey, object?>? parameters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This interface is used to allow scripts to prevent a move from being selected.
|
||||
/// </summary>
|
||||
public interface IScriptPreventMoveSelection
|
||||
{
|
||||
/// <summary>
|
||||
/// Override to customize whether the move can be selected at all.
|
||||
/// </summary>
|
||||
void PreventMoveSelection(IMoveChoice choice, ref bool prevent);
|
||||
}
|
||||
Reference in New Issue
Block a user