parent
ced4524737
commit
12850e3771
28 changed files with 211 additions and 18 deletions
@ -0,0 +1,9 @@ |
||||
namespace PkmnLibSharp.AI |
||||
{ |
||||
public class DepthSearchAI : PokemonAI |
||||
{ |
||||
public DepthSearchAI() : base(PkmnLibAI.Generated.DepthSearchAI.Create()) |
||||
{ |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,11 @@ |
||||
using System; |
||||
|
||||
namespace PkmnLibSharp.AI |
||||
{ |
||||
public class NaiveAI : PokemonAI |
||||
{ |
||||
public NaiveAI() : base(PkmnLibAI.Generated.NaiveAI.Create()) |
||||
{ |
||||
} |
||||
} |
||||
} |
@ -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); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,11 @@ |
||||
using System; |
||||
|
||||
namespace PkmnLibSharp.AI |
||||
{ |
||||
public class RandomAI : PokemonAI |
||||
{ |
||||
public RandomAI() : base(PkmnLibAI.Generated.RandomAI.Create()) |
||||
{ |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,18 @@ |
||||
// AUTOMATICALLY GENERATED, DO NOT EDIT |
||||
using System; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
namespace PkmnLibAI.Generated |
||||
{ |
||||
internal static class C |
||||
{ |
||||
/// <returns>const char *</returns> |
||||
[DllImport("libpkmnlib_ai", CallingConvention = CallingConvention.Cdecl, EntryPoint= "pkmnlibai_C_GetLastException")] |
||||
internal static extern IntPtr GetLastException(); |
||||
|
||||
/// <returns>const char *</returns> |
||||
[DllImport("libpkmnlib_ai", CallingConvention = CallingConvention.Cdecl, EntryPoint= "pkmnlibai_C_GetLastExceptionStacktrace")] |
||||
internal static extern IntPtr GetLastExceptionStacktrace(); |
||||
|
||||
} |
||||
} |
@ -0,0 +1,14 @@ |
||||
// AUTOMATICALLY GENERATED, DO NOT EDIT |
||||
using System; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
namespace PkmnLibAI.Generated |
||||
{ |
||||
internal static class DepthSearchAI |
||||
{ |
||||
/// <returns>DepthSearchAI *</returns> |
||||
[DllImport("libpkmnlib_ai", CallingConvention = CallingConvention.Cdecl, EntryPoint= "pkmnlibai_DepthSearchAI_Create")] |
||||
internal static extern IntPtr Create(); |
||||
|
||||
} |
||||
} |
@ -0,0 +1,14 @@ |
||||
// AUTOMATICALLY GENERATED, DO NOT EDIT |
||||
using System; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
namespace PkmnLibAI.Generated |
||||
{ |
||||
internal static class NaiveAI |
||||
{ |
||||
/// <returns>NaiveAI *</returns> |
||||
[DllImport("libpkmnlib_ai", CallingConvention = CallingConvention.Cdecl, EntryPoint= "pkmnlibai_NaiveAI_Create")] |
||||
internal static extern IntPtr Create(); |
||||
|
||||
} |
||||
} |
@ -0,0 +1,23 @@ |
||||
// AUTOMATICALLY GENERATED, DO NOT EDIT |
||||
using System; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
namespace PkmnLibAI.Generated |
||||
{ |
||||
internal static class PokemonAI |
||||
{ |
||||
/// <param name="p">PokemonAI *</param> |
||||
/// <returns>void</returns> |
||||
[DllImport("libpkmnlib_ai", CallingConvention = CallingConvention.Cdecl, EntryPoint= "pkmnlibai_PokemonAI_Delete")] |
||||
internal static extern void Delete(IntPtr p); |
||||
|
||||
/// <param name="out">BaseTurnChoice * &</param> |
||||
/// <param name="p">PokemonAI *</param> |
||||
/// <param name="battle">Battle *</param> |
||||
/// <param name="user">Pokemon *</param> |
||||
/// <returns>unsigned char</returns> |
||||
[DllImport("libpkmnlib_ai", CallingConvention = CallingConvention.Cdecl, EntryPoint= "pkmnlibai_PokemonAI_GetChoice")] |
||||
internal static extern byte GetChoice(ref IntPtr @out, IntPtr p, IntPtr battle, IntPtr user); |
||||
|
||||
} |
||||
} |
@ -0,0 +1,14 @@ |
||||
// AUTOMATICALLY GENERATED, DO NOT EDIT |
||||
using System; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
namespace PkmnLibAI.Generated |
||||
{ |
||||
internal static class RandomAI |
||||
{ |
||||
/// <returns>RandomAI *</returns> |
||||
[DllImport("libpkmnlib_ai", CallingConvention = CallingConvention.Cdecl, EntryPoint= "pkmnlibai_RandomAI_Create")] |
||||
internal static extern IntPtr Create(); |
||||
|
||||
} |
||||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue