More moves implemented
This commit is contained in:
12
PkmnLib.Dynamic/ScriptHandling/ILimitedTurnsScript.cs
Normal file
12
PkmnLib.Dynamic/ScriptHandling/ILimitedTurnsScript.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace PkmnLib.Dynamic.ScriptHandling;
|
||||
|
||||
/// <summary>
|
||||
/// Helper interface for scripts that have a limited number of turns.
|
||||
/// </summary>
|
||||
public interface ILimitedTurnsScript
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets the number of turns the script will last.
|
||||
/// </summary>
|
||||
public void SetTurns(int turns);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace PkmnLib.Dynamic.ScriptHandling;
|
||||
|
||||
/// <summary>
|
||||
/// Helper interface for weather scripts.
|
||||
/// </summary>
|
||||
public interface IWeatherScript
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets the number of turns the weather will last.
|
||||
/// </summary>
|
||||
public void SetTurns(int turns);
|
||||
}
|
||||
@@ -97,6 +97,10 @@ public abstract class Script : IDeepCloneable
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnAddedToParent(IScriptSource source)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override to customize whether the move can be selected at all.
|
||||
/// </summary>
|
||||
|
||||
@@ -117,6 +117,7 @@ public class ScriptSet : IScriptSet
|
||||
script.OnRemoveEvent += s => Remove(s.Name);
|
||||
var container = new ScriptContainer(script);
|
||||
_scripts.Add(container);
|
||||
script.OnAddedToParent(_source);
|
||||
return container;
|
||||
}
|
||||
|
||||
@@ -136,6 +137,7 @@ public class ScriptSet : IScriptSet
|
||||
script.OnRemoveEvent += s => Remove(s.Name);
|
||||
var container = new ScriptContainer(script);
|
||||
_scripts.Add(container);
|
||||
script.OnAddedToParent(_source);
|
||||
return container;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user