Update to latest PkmnLib

This commit is contained in:
Deukhoofd 2020-07-08 13:50:51 +02:00
parent eb99fc5661
commit 5ad3e2e040
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
44 changed files with 119 additions and 118 deletions

View File

@ -29,7 +29,7 @@ namespace Creaturelibbattling.Generated
/// <param name="out">bool &</param> /// <param name="out">bool &</param>
/// <param name="p">Battle *</param> /// <param name="p">Battle *</param>
/// <param name="turnChoice">const BaseTurnChoice *</param> /// <param name="turnChoice">BaseTurnChoice *</param>
/// <returns>unsigned char</returns> /// <returns>unsigned char</returns>
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_CanUse")] [DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_CanUse")]
internal static extern byte CanUse(ref byte @out, IntPtr p, IntPtr turnChoice); internal static extern byte CanUse(ref byte @out, IntPtr p, IntPtr turnChoice);
@ -129,6 +129,16 @@ namespace Creaturelibbattling.Generated
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetSides")] [DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetSides")]
internal static extern IntPtr GetSides(IntPtr p); internal static extern IntPtr GetSides(IntPtr p);
/// <param name="p">const Battle *</param>
/// <returns>long unsigned int</returns>
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetPartiesCount")]
internal static extern ulong GetPartiesCount(IntPtr p);
/// <param name="p">const Battle *</param>
/// <returns>const BattleParty * *</returns>
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetParties")]
internal static extern IntPtr GetParties(IntPtr p);
/// <param name="p">Battle *</param> /// <param name="p">Battle *</param>
/// <param name="key">const char *</param> /// <param name="key">const char *</param>
/// <returns>Script *</returns> /// <returns>Script *</returns>

View File

@ -23,11 +23,6 @@ namespace Creaturelibbattling.Generated
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_BattleSide_AllChoicesSet")] [DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_BattleSide_AllChoicesSet")]
internal static extern byte AllChoicesSet(IntPtr p); internal static extern byte AllChoicesSet(IntPtr p);
/// <param name="p">BattleSide *</param>
/// <returns>const BaseTurnChoice * *</returns>
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_BattleSide_GetChoices")]
internal static extern IntPtr GetChoices(IntPtr p);
/// <param name="out">bool &</param> /// <param name="out">bool &</param>
/// <param name="p">BattleSide *</param> /// <param name="p">BattleSide *</param>
/// <returns>unsigned char</returns> /// <returns>unsigned char</returns>

View File

@ -21,9 +21,10 @@ namespace Creaturelibbattling.Generated
/// <param name="talent">unsigned char</param> /// <param name="talent">unsigned char</param>
/// <param name="attacks">LearnedAttack * *</param> /// <param name="attacks">LearnedAttack * *</param>
/// <param name="attacksNum">long unsigned int</param> /// <param name="attacksNum">long unsigned int</param>
/// <param name="allowedExperienceGain">bool</param>
/// <returns>unsigned char</returns> /// <returns>unsigned char</returns>
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Creature_Construct")] [DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Creature_Construct")]
internal static extern byte Construct(ref IntPtr @out, IntPtr library, IntPtr species, IntPtr variant, byte level, uint experience, uint uid, Gender gender, byte coloring, IntPtr heldItem, IntPtr nickname, byte secretTalent, byte talent, IntPtr attacks, ulong attacksNum); internal static extern byte Construct(ref IntPtr @out, IntPtr library, IntPtr species, IntPtr variant, byte level, uint experience, uint uid, Gender gender, byte coloring, IntPtr heldItem, IntPtr nickname, byte secretTalent, byte talent, IntPtr attacks, ulong attacksNum, byte allowedExperienceGain);
/// <param name="p">const Creature *</param> /// <param name="p">const Creature *</param>
/// <returns>void</returns> /// <returns>void</returns>
@ -40,6 +41,12 @@ namespace Creaturelibbattling.Generated
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Creature_GetVariant")] [DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Creature_GetVariant")]
internal static extern IntPtr GetVariant(IntPtr p); internal static extern IntPtr GetVariant(IntPtr p);
/// <param name="p">Creature *</param>
/// <param name="variant">const SpeciesVariant *</param>
/// <returns>unsigned char</returns>
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Creature_ChangeVariant")]
internal static extern byte ChangeVariant(IntPtr p, IntPtr variant);
/// <param name="p">const Creature *</param> /// <param name="p">const Creature *</param>
/// <returns>unsigned char</returns> /// <returns>unsigned char</returns>
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Creature_GetLevel")] [DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Creature_GetLevel")]
@ -120,16 +127,6 @@ namespace Creaturelibbattling.Generated
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Creature_GetNickname")] [DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Creature_GetNickname")]
internal static extern IntPtr GetNickname(IntPtr p); internal static extern IntPtr GetNickname(IntPtr p);
/// <param name="p">Creature *</param>
/// <returns>long unsigned int</returns>
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Creature_GetTypesCount")]
internal static extern ulong GetTypesCount(IntPtr p);
/// <param name="p">Creature *</param>
/// <returns>const unsigned char *</returns>
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Creature_GetTypes")]
internal static extern IntPtr GetTypes(IntPtr p);
/// <param name="p">Creature *</param> /// <param name="p">Creature *</param>
/// <param name="type">unsigned char</param> /// <param name="type">unsigned char</param>
/// <returns>bool</returns> /// <returns>bool</returns>
@ -214,9 +211,10 @@ namespace Creaturelibbattling.Generated
internal static extern ulong GetAttacksCount(IntPtr p); internal static extern ulong GetAttacksCount(IntPtr p);
/// <param name="p">Creature *</param> /// <param name="p">Creature *</param>
/// <param name="index">long unsigned int</param>
/// <returns>const LearnedAttack * *</returns> /// <returns>const LearnedAttack * *</returns>
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Creature_GetAttacks")] [DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Creature_GetAttack")]
internal static extern IntPtr GetAttacks(IntPtr p); internal static extern IntPtr GetAttack(IntPtr p, ulong index);
/// <param name="p">const Creature *</param> /// <param name="p">const Creature *</param>
/// <returns>const CreatureSpecies *</returns> /// <returns>const CreatureSpecies *</returns>

View File

@ -41,9 +41,9 @@ namespace Creaturelibbattling.Generated
/// <param name="target">Creature *</param> /// <param name="target">Creature *</param>
/// <param name="hitIndex">unsigned char</param> /// <param name="hitIndex">unsigned char</param>
/// <param name="hitData">HitData *</param> /// <param name="hitData">HitData *</param>
/// <returns>float</returns> /// <returns>unsigned char</returns>
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_DamageLibrary_GetStatModifier")] [DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_DamageLibrary_GetStatModifier")]
internal static extern float GetStatModifier(ref float @out, IntPtr p, IntPtr attack, IntPtr target, byte hitIndex, IntPtr hitData); internal static extern byte GetStatModifier(ref float @out, IntPtr p, IntPtr attack, IntPtr target, byte hitIndex, IntPtr hitData);
/// <param name="out">float &</param> /// <param name="out">float &</param>
/// <param name="p">const DamageLibrary *</param> /// <param name="p">const DamageLibrary *</param>
@ -51,9 +51,9 @@ namespace Creaturelibbattling.Generated
/// <param name="target">Creature *</param> /// <param name="target">Creature *</param>
/// <param name="hitIndex">unsigned char</param> /// <param name="hitIndex">unsigned char</param>
/// <param name="hitData">HitData *</param> /// <param name="hitData">HitData *</param>
/// <returns>float</returns> /// <returns>unsigned char</returns>
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_DamageLibrary_GetDamageModifier")] [DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_DamageLibrary_GetDamageModifier")]
internal static extern float GetDamageModifier(ref float @out, IntPtr p, IntPtr attack, IntPtr target, byte hitIndex, IntPtr hitData); internal static extern byte GetDamageModifier(ref float @out, IntPtr p, IntPtr attack, IntPtr target, byte hitIndex, IntPtr hitData);
} }
} }

View File

@ -7,7 +7,7 @@ namespace Creaturelibbattling.Generated
internal static class LearnedAttack internal static class LearnedAttack
{ {
/// <param name="out">LearnedAttack * &</param> /// <param name="out">LearnedAttack * &</param>
/// <param name="attack">AttackData *</param> /// <param name="attack">const AttackData *</param>
/// <param name="maxUses">unsigned char</param> /// <param name="maxUses">unsigned char</param>
/// <param name="learnMethod">AttackLearnMethod</param> /// <param name="learnMethod">AttackLearnMethod</param>
/// <returns>unsigned char</returns> /// <returns>unsigned char</returns>

View File

@ -34,7 +34,7 @@ namespace Creaturelibbattling.Generated
/// <param name="p">Script *</param> /// <param name="p">Script *</param>
/// <param name="choice">AttackTurnChoice *</param> /// <param name="choice">AttackTurnChoice *</param>
/// <param name="outAttack">CaseInsensitiveConstString *</param> /// <param name="outAttack">StringView *</param>
/// <returns>unsigned char</returns> /// <returns>unsigned char</returns>
[DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Script_ChangeAttack")] [DllImport("CreatureLibBattling", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Script_ChangeAttack")]
internal static extern byte ChangeAttack(IntPtr p, IntPtr choice, IntPtr outAttack); internal static extern byte ChangeAttack(IntPtr p, IntPtr choice, IntPtr outAttack);

View File

@ -4,7 +4,7 @@ using PkmnLibSharp.Utilities;
namespace PkmnLibSharp.Library namespace PkmnLibSharp.Library
{ {
public enum EffectParameterType public enum EffectParameterType : byte
{ {
None = 0, None = 0,
Bool = 1, Bool = 1,
@ -57,7 +57,7 @@ namespace PkmnLibSharp.Library
public string AsString() public string AsString()
{ {
IntPtr p = IntPtr.Zero; var p = IntPtr.Zero;
Creatureliblibrary.Generated.EffectParameter.AsString(Ptr, ref p).Assert(); Creatureliblibrary.Generated.EffectParameter.AsString(Ptr, ref p).Assert();
return p.PtrString(); return p.PtrString();
} }

BIN
PkmnLibSharp/Native/libArbutils.so (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
PkmnLibSharp/Native/libpkmnLib.so (Stored with Git LFS)

Binary file not shown.

View File

@ -22,7 +22,4 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="System.Collections.Immutable" Version="1.7.0" /> <PackageReference Include="System.Collections.Immutable" Version="1.7.0" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Battling" />
</ItemGroup>
</Project> </Project>

File diff suppressed because one or more lines are too long

View File

@ -49,6 +49,7 @@ def parse_function(function, classDict):
classDict[classKey].register_function(funcDef(function["name"], function["returns"], function["parameters"])) classDict[classKey].register_function(funcDef(function["name"], function["returns"], function["parameters"]))
def parse_type(type, enumSet): def parse_type(type, enumSet):
type = type.strip();
if (type == "void"): if (type == "void"):
return "void" return "void"
if (type == "unsigned char"): if (type == "unsigned char"):

File diff suppressed because one or more lines are too long