// AUTOMATICALLY GENERATED, DO NOT EDIT
using System;
using System.Runtime.InteropServices;

namespace Creaturelib.Generated
{
    internal static class Battle
    {
        /// <param name="out">Battle * &</param>
        /// <param name="library">const BattleLibrary *</param>
        /// <param name="partyArr">BattleParty * *</param>
        /// <param name="numberOfParties">long unsigned int</param>
        /// <param name="canFlee">bool</param>
        /// <param name="numberOfSides">unsigned char</param>
        /// <param name="creaturesPerSide">unsigned char</param>
        /// <param name="randomSeed">long unsigned int</param>
        /// <returns>unsigned char</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_Construct")]
        internal static extern byte Construct(ref IntPtr @out, IntPtr library, IntPtr partyArr, ulong numberOfParties, byte canFlee, byte numberOfSides, byte creaturesPerSide, ulong randomSeed);

        /// <param name="p">const Battle *</param>
        /// <returns>void</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_Destruct")]
        internal static extern void Destruct(IntPtr p);

        /// <param name="p">const Battle *</param>
        /// <returns>const BattleLibrary *</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetLibrary")]
        internal static extern IntPtr GetLibrary(IntPtr p);

        /// <param name="out">bool &</param>
        /// <param name="p">Battle *</param>
        /// <param name="turnChoice">BaseTurnChoice *</param>
        /// <returns>unsigned char</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_CanUse")]
        internal static extern byte CanUse(ref byte @out, IntPtr p, IntPtr turnChoice);

        /// <param name="out">bool &</param>
        /// <param name="p">Battle *</param>
        /// <param name="turnChoice">BaseTurnChoice *</param>
        /// <returns>unsigned char</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_TrySetChoice")]
        internal static extern byte TrySetChoice(ref byte @out, IntPtr p, IntPtr turnChoice);

        /// <param name="p">const Battle *</param>
        /// <returns>bool</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_CanFlee")]
        internal static extern byte CanFlee(IntPtr p);

        /// <param name="p">Battle *</param>
        /// <returns>unsigned char</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_CheckChoicesSetAndRun")]
        internal static extern byte CheckChoicesSetAndRun(IntPtr p);

        /// <param name="p">Battle *</param>
        /// <returns>unsigned int</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetCurrentTurn")]
        internal static extern uint GetCurrentTurn(IntPtr p);

        /// <param name="p">Battle *</param>
        /// <returns>unsigned int</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetCreaturesPerSide")]
        internal static extern uint GetCreaturesPerSide(IntPtr p);

        /// <param name="p">const Battle *</param>
        /// <returns>ChoiceQueue *</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetCurrentTurnQueue")]
        internal static extern IntPtr GetCurrentTurnQueue(IntPtr p);

        /// <param name="p">Battle *</param>
        /// <returns>BattleRandom *</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetRandom")]
        internal static extern IntPtr GetRandom(IntPtr p);

        /// <param name="out">bool &</param>
        /// <param name="p">const Battle *</param>
        /// <param name="c">Creature *</param>
        /// <returns>unsigned char</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_CreatureInField")]
        internal static extern byte CreatureInField(ref byte @out, IntPtr p, IntPtr c);

        /// <param name="out">Creature * &</param>
        /// <param name="p">const Battle *</param>
        /// <param name="side">unsigned char</param>
        /// <param name="target">unsigned char</param>
        /// <returns>unsigned char</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetCreature")]
        internal static extern byte GetCreature(ref IntPtr @out, IntPtr p, byte side, byte target);

        /// <param name="p">Battle *</param>
        /// <param name="side">unsigned char</param>
        /// <param name="target">unsigned char</param>
        /// <returns>unsigned char</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_ForceRecall")]
        internal static extern byte ForceRecall(IntPtr p, byte side, byte target);

        /// <param name="p">Battle *</param>
        /// <param name="side">unsigned char</param>
        /// <param name="target">unsigned char</param>
        /// <param name="c">Creature *</param>
        /// <returns>unsigned char</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_SwitchCreature")]
        internal static extern byte SwitchCreature(IntPtr p, byte side, byte target, IntPtr c);

        /// <param name="out">bool &</param>
        /// <param name="p">const Battle *</param>
        /// <param name="side">unsigned char</param>
        /// <param name="target">unsigned char</param>
        /// <returns>unsigned char</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_CanSlotBeFilled")]
        internal static extern byte CanSlotBeFilled(ref byte @out, IntPtr p, byte side, byte target);

        /// <param name="p">Battle *</param>
        /// <returns>unsigned char</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_ValidateBattleState")]
        internal static extern byte ValidateBattleState(IntPtr p);

        /// <param name="p">const Battle *</param>
        /// <returns>bool</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_HasEnded")]
        internal static extern byte HasEnded(IntPtr p);

        /// <param name="p">const Battle *</param>
        /// <returns>bool</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_HasConclusiveResult")]
        internal static extern byte HasConclusiveResult(IntPtr p);

        /// <param name="p">const Battle *</param>
        /// <returns>bool</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetWinningSide")]
        internal static extern byte GetWinningSide(IntPtr p);

        /// <param name="p">const Battle *</param>
        /// <returns>long unsigned int</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetSidesCount")]
        internal static extern ulong GetSidesCount(IntPtr p);

        /// <param name="p">const Battle *</param>
        /// <returns>const BattleSide * *</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetSides")]
        internal static extern IntPtr GetSides(IntPtr p);

        /// <param name="p">const Battle *</param>
        /// <returns>long unsigned int</returns>
        [DllImport("libCreatureLib", 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("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetParties")]
        internal static extern IntPtr GetParties(IntPtr p);

        /// <param name="p">Battle *</param>
        /// <param name="key">const char *</param>
        /// <returns>Script *</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetVolatileScript")]
        internal static extern IntPtr GetVolatileScript(IntPtr p, IntPtr key);

        /// <param name="p">Battle *</param>
        /// <param name="key">const char *</param>
        /// <returns>unsigned char</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_AddVolatileScriptByName")]
        internal static extern byte AddVolatileScriptByName(IntPtr p, IntPtr key);

        /// <param name="p">Battle *</param>
        /// <param name="script">Script *</param>
        /// <returns>unsigned char</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_AddVolatileScript")]
        internal static extern byte AddVolatileScript(IntPtr p, IntPtr script);

        /// <param name="p">Battle *</param>
        /// <param name="key">const char *</param>
        /// <returns>unsigned char</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_RemoveVolatileScript")]
        internal static extern byte RemoveVolatileScript(IntPtr p, IntPtr key);

        /// <param name="p">Battle *</param>
        /// <param name="script">Script *</param>
        /// <returns>unsigned char</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_RemoveVolatileScriptWithScript")]
        internal static extern byte RemoveVolatileScriptWithScript(IntPtr p, IntPtr script);

        /// <param name="p">Battle *</param>
        /// <param name="key">const char *</param>
        /// <returns>bool</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_HasVolatileScript")]
        internal static extern byte HasVolatileScript(IntPtr p, IntPtr key);

        /// <param name="p">Battle *</param>
        /// <param name="func">Function *</param>
        /// <returns>unsigned char</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_RegisterEventListener")]
        internal static extern byte RegisterEventListener(IntPtr p, IntPtr func);

        /// <param name="p">Battle *</param>
        /// <returns>const HistoryHolder *</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetHistory")]
        internal static extern IntPtr GetHistory(IntPtr p);

        /// <param name="p">const Battle *</param>
        /// <returns>long int</returns>
        [DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_Battle_GetLastTurnTimeMicroseconds")]
        internal static extern long GetLastTurnTimeMicroseconds(IntPtr p);

    }
}
