Update to latest.
This commit is contained in:
parent
8369328719
commit
d542e75cd1
|
@ -9,7 +9,7 @@ namespace PkmnLibSharp.Battling
|
||||||
{
|
{
|
||||||
public class AngelScriptResolver : ScriptResolver
|
public class AngelScriptResolver : ScriptResolver
|
||||||
{
|
{
|
||||||
private readonly Dictionary<string, EvolutionScript?> _evolutionScriptCache =
|
private readonly Dictionary<string, EvolutionScript?> _evolutionScriptCache =
|
||||||
new Dictionary<string, EvolutionScript?>();
|
new Dictionary<string, EvolutionScript?>();
|
||||||
|
|
||||||
public AngelScriptResolver() : base(Pkmnlib.Generated.AngelScriptResolver.Construct())
|
public AngelScriptResolver() : base(Pkmnlib.Generated.AngelScriptResolver.Construct())
|
||||||
|
@ -29,11 +29,12 @@ namespace PkmnLibSharp.Battling
|
||||||
{
|
{
|
||||||
Pkmnlib.Generated.AngelScriptResolver.CreateScript(Ptr, name.ToPtr(), script.ToPtr()).Assert();
|
Pkmnlib.Generated.AngelScriptResolver.CreateScript(Ptr, name.ToPtr(), script.ToPtr()).Assert();
|
||||||
}
|
}
|
||||||
public Script LoadScript(ScriptCategory category, string name)
|
|
||||||
|
public Script LoadScript(PointerWrapper owner, ScriptCategory category, string name)
|
||||||
{
|
{
|
||||||
var ptr = IntPtr.Zero;
|
var ptr = IntPtr.Zero;
|
||||||
Pkmnlib.Generated.AngelScriptResolver
|
Pkmnlib.Generated.AngelScriptResolver
|
||||||
.LoadScript(ref ptr, Ptr, (Pkmnlib.ScriptCategory) category, name.ToPtr()).Assert();
|
.LoadScript(ref ptr, Ptr, owner.Ptr, (Pkmnlib.ScriptCategory)category, name.ToPtr()).Assert();
|
||||||
return new AngelscriptScript(ptr);
|
return new AngelscriptScript(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,6 +44,7 @@ namespace PkmnLibSharp.Battling
|
||||||
{
|
{
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ptr = IntPtr.Zero;
|
var ptr = IntPtr.Zero;
|
||||||
Pkmnlib.Generated.AngelScriptResolver.LoadEvolutionScript(ref ptr, Ptr, name.ToPtr()).Assert();
|
Pkmnlib.Generated.AngelScriptResolver.LoadEvolutionScript(ref ptr, Ptr, name.ToPtr()).Assert();
|
||||||
if (ptr == IntPtr.Zero)
|
if (ptr == IntPtr.Zero)
|
||||||
|
@ -50,6 +52,7 @@ namespace PkmnLibSharp.Battling
|
||||||
_evolutionScriptCache.Add(name, null);
|
_evolutionScriptCache.Add(name, null);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
s = new EvolutionScript(ptr);
|
s = new EvolutionScript(ptr);
|
||||||
_evolutionScriptCache.Add(name, s);
|
_evolutionScriptCache.Add(name, s);
|
||||||
return s;
|
return s;
|
||||||
|
@ -59,7 +62,7 @@ namespace PkmnLibSharp.Battling
|
||||||
{
|
{
|
||||||
var pinnedArray = GCHandle.Alloc(data, GCHandleType.Pinned);
|
var pinnedArray = GCHandle.Alloc(data, GCHandleType.Pinned);
|
||||||
var pointer = pinnedArray.AddrOfPinnedObject();
|
var pointer = pinnedArray.AddrOfPinnedObject();
|
||||||
Pkmnlib.Generated.AngelScriptResolver.LoadByteCodeFromMemory(Ptr, pointer, (ulong) data.Length).Assert();
|
Pkmnlib.Generated.AngelScriptResolver.LoadByteCodeFromMemory(Ptr, pointer, (ulong)data.Length).Assert();
|
||||||
pinnedArray.Free();
|
pinnedArray.Free();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,11 @@ namespace Creaturelib.Generated
|
||||||
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_BattleSide_Destruct")]
|
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_BattleSide_Destruct")]
|
||||||
internal static extern void Destruct(IntPtr p);
|
internal static extern void Destruct(IntPtr p);
|
||||||
|
|
||||||
|
/// <param name="p">BattleSide *</param>
|
||||||
|
/// <returns>Battle *</returns>
|
||||||
|
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_BattleSide_GetBattle")]
|
||||||
|
internal static extern IntPtr GetBattle(IntPtr p);
|
||||||
|
|
||||||
/// <param name="p">BattleSide *</param>
|
/// <param name="p">BattleSide *</param>
|
||||||
/// <returns>bool</returns>
|
/// <returns>bool</returns>
|
||||||
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_BattleSide_AllChoicesSet")]
|
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_BattleSide_AllChoicesSet")]
|
||||||
|
@ -95,5 +100,41 @@ namespace Creaturelib.Generated
|
||||||
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_BattleSide_SwapPositions")]
|
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_BattleSide_SwapPositions")]
|
||||||
internal static extern byte SwapPositions(ref byte @out, IntPtr p, byte a, byte b);
|
internal static extern byte SwapPositions(ref byte @out, IntPtr p, byte a, byte b);
|
||||||
|
|
||||||
|
/// <param name="p">BattleSide *</param>
|
||||||
|
/// <param name="key">const char *</param>
|
||||||
|
/// <returns>BattleScript *</returns>
|
||||||
|
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_BattleSide_GetVolatileScript")]
|
||||||
|
internal static extern IntPtr GetVolatileScript(IntPtr p, IntPtr key);
|
||||||
|
|
||||||
|
/// <param name="p">BattleSide *</param>
|
||||||
|
/// <param name="key">const char *</param>
|
||||||
|
/// <returns>unsigned char</returns>
|
||||||
|
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_BattleSide_AddVolatileScriptByName")]
|
||||||
|
internal static extern byte AddVolatileScriptByName(IntPtr p, IntPtr key);
|
||||||
|
|
||||||
|
/// <param name="p">BattleSide *</param>
|
||||||
|
/// <param name="script">BattleScript *</param>
|
||||||
|
/// <returns>unsigned char</returns>
|
||||||
|
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_BattleSide_AddVolatileScript")]
|
||||||
|
internal static extern byte AddVolatileScript(IntPtr p, IntPtr script);
|
||||||
|
|
||||||
|
/// <param name="p">BattleSide *</param>
|
||||||
|
/// <param name="key">const char *</param>
|
||||||
|
/// <returns>unsigned char</returns>
|
||||||
|
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_BattleSide_RemoveVolatileScript")]
|
||||||
|
internal static extern byte RemoveVolatileScript(IntPtr p, IntPtr key);
|
||||||
|
|
||||||
|
/// <param name="p">BattleSide *</param>
|
||||||
|
/// <param name="script">BattleScript *</param>
|
||||||
|
/// <returns>unsigned char</returns>
|
||||||
|
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_BattleSide_RemoveVolatileScriptWithScript")]
|
||||||
|
internal static extern byte RemoveVolatileScriptWithScript(IntPtr p, IntPtr script);
|
||||||
|
|
||||||
|
/// <param name="p">BattleSide *</param>
|
||||||
|
/// <param name="key">const char *</param>
|
||||||
|
/// <returns>bool</returns>
|
||||||
|
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_BattleSide_HasVolatileScript")]
|
||||||
|
internal static extern byte HasVolatileScript(IntPtr p, IntPtr key);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,5 +7,6 @@ namespace Creaturelib
|
||||||
internal enum HistoryElementKind : byte
|
internal enum HistoryElementKind : byte
|
||||||
{
|
{
|
||||||
AttackUse = 0,
|
AttackUse = 0,
|
||||||
|
Damage = 1,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,5 +16,11 @@ namespace Creaturelib.Generated
|
||||||
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_HistoryHandler_GetLastUsedAttack")]
|
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_HistoryHandler_GetLastUsedAttack")]
|
||||||
internal static extern IntPtr GetLastUsedAttack(IntPtr p);
|
internal static extern IntPtr GetLastUsedAttack(IntPtr p);
|
||||||
|
|
||||||
|
/// <param name="p">const HistoryHolder *</param>
|
||||||
|
/// <param name="c">const Creature *</param>
|
||||||
|
/// <returns>const HistoryElement *</returns>
|
||||||
|
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_HistoryHandler_GetLastDamageOnTarget")]
|
||||||
|
internal static extern IntPtr GetLastDamageOnTarget(IntPtr p, IntPtr c);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,11 +23,12 @@ namespace Creaturelib.Generated
|
||||||
|
|
||||||
/// <param name="out">BattleScript * &</param>
|
/// <param name="out">BattleScript * &</param>
|
||||||
/// <param name="p">ScriptResolver *</param>
|
/// <param name="p">ScriptResolver *</param>
|
||||||
|
/// <param name="owner">void *</param>
|
||||||
/// <param name="category">ScriptCategory</param>
|
/// <param name="category">ScriptCategory</param>
|
||||||
/// <param name="scriptName">const char *</param>
|
/// <param name="scriptName">const char *</param>
|
||||||
/// <returns>unsigned char</returns>
|
/// <returns>unsigned char</returns>
|
||||||
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_ScriptResolver_LoadScript")]
|
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_ScriptResolver_LoadScript")]
|
||||||
internal static extern byte LoadScript(ref IntPtr @out, IntPtr p, ScriptCategory category, IntPtr scriptName);
|
internal static extern byte LoadScript(ref IntPtr @out, IntPtr p, IntPtr owner, ScriptCategory category, IntPtr scriptName);
|
||||||
|
|
||||||
/// <param name="out">ItemUseScript * &</param>
|
/// <param name="out">ItemUseScript * &</param>
|
||||||
/// <param name="p">ScriptResolver *</param>
|
/// <param name="p">ScriptResolver *</param>
|
||||||
|
|
|
@ -35,11 +35,12 @@ namespace Pkmnlib.Generated
|
||||||
|
|
||||||
/// <param name="out">BattleScript * &</param>
|
/// <param name="out">BattleScript * &</param>
|
||||||
/// <param name="p">AngelScriptResolver *</param>
|
/// <param name="p">AngelScriptResolver *</param>
|
||||||
|
/// <param name="owner">void *</param>
|
||||||
/// <param name="category">ScriptCategory</param>
|
/// <param name="category">ScriptCategory</param>
|
||||||
/// <param name="scriptName">const char *</param>
|
/// <param name="scriptName">const char *</param>
|
||||||
/// <returns>unsigned char</returns>
|
/// <returns>unsigned char</returns>
|
||||||
[DllImport("libpkmnLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "PkmnLib_AngelScriptResolver_LoadScript")]
|
[DllImport("libpkmnLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "PkmnLib_AngelScriptResolver_LoadScript")]
|
||||||
internal static extern byte LoadScript(ref IntPtr @out, IntPtr p, ScriptCategory category, IntPtr scriptName);
|
internal static extern byte LoadScript(ref IntPtr @out, IntPtr p, IntPtr owner, ScriptCategory category, IntPtr scriptName);
|
||||||
|
|
||||||
/// <param name="out">const EvolutionScript * &</param>
|
/// <param name="out">const EvolutionScript * &</param>
|
||||||
/// <param name="p">AngelScriptResolver *</param>
|
/// <param name="p">AngelScriptResolver *</param>
|
||||||
|
@ -97,5 +98,17 @@ namespace Pkmnlib.Generated
|
||||||
[DllImport("libpkmnLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "PkmnLib_AngelScriptResolver_RegisterGlobalMethod")]
|
[DllImport("libpkmnLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "PkmnLib_AngelScriptResolver_RegisterGlobalMethod")]
|
||||||
internal static extern byte RegisterGlobalMethod(IntPtr p, IntPtr decl, IntPtr func);
|
internal static extern byte RegisterGlobalMethod(IntPtr p, IntPtr decl, IntPtr func);
|
||||||
|
|
||||||
|
/// <param name="p">AngelScriptResolver *</param>
|
||||||
|
/// <param name="word">const char *</param>
|
||||||
|
/// <returns>void</returns>
|
||||||
|
[DllImport("libpkmnLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "PkmnLib_AngelScriptResolver_DefineWord")]
|
||||||
|
internal static extern void DefineWord(IntPtr p, IntPtr word);
|
||||||
|
|
||||||
|
/// <param name="p">AngelScriptResolver *</param>
|
||||||
|
/// <param name="port">unsigned short</param>
|
||||||
|
/// <returns>void</returns>
|
||||||
|
[DllImport("libpkmnLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "PkmnLib_AngelScriptResolver_AddDebugger")]
|
||||||
|
internal static extern void AddDebugger(IntPtr p, ushort port);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,8 +122,8 @@ namespace Pkmnlib.Generated
|
||||||
/// <param name="index">long unsigned int</param>
|
/// <param name="index">long unsigned int</param>
|
||||||
/// <param name="out">const EffectParameter * &</param>
|
/// <param name="out">const EffectParameter * &</param>
|
||||||
/// <returns>unsigned char</returns>
|
/// <returns>unsigned char</returns>
|
||||||
[DllImport("libpkmnLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "PkmnLib_EvolutionData_GetData")]
|
[DllImport("libpkmnLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "PkmnLib_EvolutionData_GetDataAt")]
|
||||||
internal static extern byte GetData(IntPtr data, ulong index, ref IntPtr @out);
|
internal static extern byte GetDataAt(IntPtr data, ulong index, ref IntPtr @out);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
// AUTOMATICALLY GENERATED, DO NOT EDIT
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
|
namespace Pkmnlib
|
||||||
|
{
|
||||||
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
|
internal enum HistoryElementKind : byte
|
||||||
|
{
|
||||||
|
AttackUse = 0,
|
||||||
|
Damage = 1,
|
||||||
|
}
|
||||||
|
}
|
|
@ -122,7 +122,7 @@ namespace PkmnLibSharp.Library.Evolution
|
||||||
public EffectParameter GetData(ulong index)
|
public EffectParameter GetData(ulong index)
|
||||||
{
|
{
|
||||||
var ptr = IntPtr.Zero;
|
var ptr = IntPtr.Zero;
|
||||||
Pkmnlib.Generated.EvolutionData.GetData(Ptr, index, ref ptr).Assert();
|
Pkmnlib.Generated.EvolutionData.GetDataAt(Ptr, index, ref ptr).Assert();
|
||||||
if (TryResolvePointer(ptr, out EffectParameter? parameter))
|
if (TryResolvePointer(ptr, out EffectParameter? parameter))
|
||||||
return parameter!;
|
return parameter!;
|
||||||
return new EffectParameter(ptr);
|
return new EffectParameter(ptr);
|
||||||
|
|
BIN
PkmnLibSharp/Native/Linux/libArbutils.so (Stored with Git LFS)
BIN
PkmnLibSharp/Native/Linux/libArbutils.so (Stored with Git LFS)
Binary file not shown.
BIN
PkmnLibSharp/Native/Linux/libCreatureLib.so (Stored with Git LFS)
BIN
PkmnLibSharp/Native/Linux/libCreatureLib.so (Stored with Git LFS)
Binary file not shown.
BIN
PkmnLibSharp/Native/Linux/libpkmnLib.so (Stored with Git LFS)
BIN
PkmnLibSharp/Native/Linux/libpkmnLib.so (Stored with Git LFS)
Binary file not shown.
BIN
PkmnLibSharp/Native/Linux/libpkmnlib_ai.so (Stored with Git LFS)
BIN
PkmnLibSharp/Native/Linux/libpkmnlib_ai.so (Stored with Git LFS)
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
Loading…
Reference in New Issue