using PkmnLibSharp.Utilities;

namespace PkmnLibSharp.Battling
{
    public class AngelScriptResolver : ScriptResolver
    {
        public AngelScriptResolver() : base(Pkmnlib.Generated.AngelScriptResolver.Construct())
        {
        }

        public void Initialize(BattleLibrary library)
        {
            Pkmnlib.Generated.AngelScriptResolver.Initialize(Ptr, library.Ptr).Assert();
        }

        public void CreateScript(string name, string script)
        {
            Pkmnlib.Generated.AngelScriptResolver.CreateScript(Ptr, name.ToPtr(), script.ToPtr()).Assert();
        }

        public void FinalizeModule()
        {
            Pkmnlib.Generated.AngelScriptResolver.FinalizeModule(Ptr).Assert();
        }

        protected override void DeletePtr()
        {
            Pkmnlib.Generated.AngelScriptResolver.Destruct(Ptr).Assert();
        }
    }
}