Support for integration tests, fixes
This commit is contained in:
@@ -223,7 +223,7 @@ public class BattleImpl : ScriptSource, IBattle
|
||||
/// <inheritdoc />
|
||||
public bool CanUse(ITurnChoice choice)
|
||||
{
|
||||
if (choice.User.IsUsable)
|
||||
if (!choice.User.IsUsable)
|
||||
return false;
|
||||
if (choice is IMoveChoice moveChoice)
|
||||
{
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using PkmnLib.Dynamic.ScriptHandling;
|
||||
|
||||
namespace PkmnLib.Dynamic.Models.Choices;
|
||||
|
||||
/// <summary>
|
||||
@@ -6,4 +8,25 @@ namespace PkmnLib.Dynamic.Models.Choices;
|
||||
public interface IPassChoice : ITurnChoice
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class PassChoice : TurnChoice, IPassChoice
|
||||
{
|
||||
public PassChoice(IPokemon user) : base(user)
|
||||
{
|
||||
}
|
||||
|
||||
/// <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);
|
||||
}
|
||||
}
|
||||
@@ -271,7 +271,7 @@ public interface IPokemon : IScriptSource
|
||||
/// <summary>
|
||||
/// Learn a move by name.
|
||||
/// </summary>
|
||||
void LearnMove(string moveName, MoveLearnMethod method, byte index);
|
||||
void LearnMove(StringKey moveName, MoveLearnMethod method, byte index);
|
||||
|
||||
/// <summary>
|
||||
/// Removes the current non-volatile status from the Pokemon.
|
||||
@@ -658,7 +658,7 @@ public class PokemonImpl : ScriptSource, IPokemon
|
||||
/// <remarks>
|
||||
/// If the index is 255, it will try to find the first empty move slot.
|
||||
/// </remarks>
|
||||
public void LearnMove(string moveName, MoveLearnMethod method, byte index)
|
||||
public void LearnMove(StringKey moveName, MoveLearnMethod method, byte index)
|
||||
{
|
||||
if (index == 255)
|
||||
{
|
||||
|
||||
@@ -8,6 +8,10 @@ namespace PkmnLib.Dynamic.ScriptHandling.Registry;
|
||||
[UsedImplicitly(ImplicitUseTargetFlags.WithInheritors)]
|
||||
public abstract class Plugin
|
||||
{
|
||||
protected Plugin(PluginConfiguration configuration)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The name of the plugin. Mostly used for debugging purposes.
|
||||
/// </summary>
|
||||
@@ -23,4 +27,8 @@ public abstract class Plugin
|
||||
/// Run the registration of the plugin when we're building the library.
|
||||
/// </summary>
|
||||
public abstract void Register(ScriptRegistry registry);
|
||||
}
|
||||
|
||||
public abstract class PluginConfiguration
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user