Updates pkmnlib, adds wrappers for PkmnLib_ai
This commit is contained in:
9
PkmnLibSharp/AI/DepthSearchAI.cs
Normal file
9
PkmnLibSharp/AI/DepthSearchAI.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace PkmnLibSharp.AI
|
||||
{
|
||||
public class DepthSearchAI : PokemonAI
|
||||
{
|
||||
public DepthSearchAI() : base(PkmnLibAI.Generated.DepthSearchAI.Create())
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
11
PkmnLibSharp/AI/NaiveAI.cs
Normal file
11
PkmnLibSharp/AI/NaiveAI.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace PkmnLibSharp.AI
|
||||
{
|
||||
public class NaiveAI : PokemonAI
|
||||
{
|
||||
public NaiveAI() : base(PkmnLibAI.Generated.NaiveAI.Create())
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
27
PkmnLibSharp/AI/PokemonAI.cs
Normal file
27
PkmnLibSharp/AI/PokemonAI.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using PkmnLibSharp.Battling;
|
||||
using PkmnLibSharp.Utilities;
|
||||
using BaseTurnChoice = PkmnLibSharp.Battling.ChoiceTurn.BaseTurnChoice;
|
||||
|
||||
namespace PkmnLibSharp.AI
|
||||
{
|
||||
public abstract class PokemonAI : PointerWrapper
|
||||
{
|
||||
protected PokemonAI(IntPtr ptr) : base(ptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public BaseTurnChoice GetChoice(Battle battle, Pokemon user)
|
||||
{
|
||||
var ptr = IntPtr.Zero;
|
||||
PkmnLibAI.Generated.PokemonAI.GetChoice(ref ptr, Ptr, battle.Ptr, user.Ptr).Assert();
|
||||
return BaseTurnChoice.GetFromPointer(ptr);
|
||||
}
|
||||
|
||||
protected override void DeletePtr()
|
||||
{
|
||||
PkmnLibAI.Generated.PokemonAI.Delete(Ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
PkmnLibSharp/AI/RandomAI.cs
Normal file
11
PkmnLibSharp/AI/RandomAI.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace PkmnLibSharp.AI
|
||||
{
|
||||
public class RandomAI : PokemonAI
|
||||
{
|
||||
public RandomAI() : base(PkmnLibAI.Generated.RandomAI.Create())
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user