using System;
using Creatureliblibrary.Generated;
using PkmnLibSharp.Library.Moves;
using PkmnLibSharp.Utilities;

namespace PkmnLibSharp.Library
{
    public class LearnableMoves : PointerWrapper
    {
        internal LearnableMoves(IntPtr ptr) : base(ptr)
        {
        }

        public static LearnableMoves Create(byte maxLevel)
        {
            var ptr = IntPtr.Zero;
            LearnableAttacks.Construct(ref ptr, maxLevel);
            return new LearnableMoves(ptr);
        }

        public void AddLevelAttack(byte level, MoveData move)
        {
            LearnableAttacks.AddLevelAttack(Ptr, level, move.Ptr);
        }

        protected override void DeletePtr()
        {
            LearnableAttacks.Destruct(Ptr);
        }
    }
}