using System;
using PkmnLibSharp.Utilities;

namespace PkmnLibSharp.Battling.Events
{
    public class DisplayTextEvent : EventData
    {
        internal DisplayTextEvent(EventDataKind kind, IntPtr ptr) : base(kind, ptr)
        {
        }

        public string Text
        {
            get
            {
                if (_text != null) return _text;
                _text = Creaturelib.Generated.DisplayTextEvent.GetText(Ptr).PtrString();
                return _text!;
            }
        }


        private string? _text;
        protected override void DeletePtr()
        {
            Creaturelib.Generated.DisplayTextEvent.Destruct(Ptr);
        }
    }
}