#if NETFRAMEWORK
using PKHeX.Core;
using PKHeX.Drawing.PokeSprite;

namespace SysBot.Pokemon.WinForms
{
    public static class InitUtil
    {
        public static void InitializeStubs(ProgramMode mode)
        {
            if (mode is ProgramMode.SCVI)
            return;

            SaveFile sav8 = mode switch
            {
                ProgramMode.SWSH => new SAV8SWSH(),
                ProgramMode.BDSP => new SAV8BS(),
                ProgramMode.LA   => new SAV8LA(),
                _                => throw new System.ArgumentOutOfRangeException(nameof(mode)),
            };

            SetUpSpriteCreator(sav8);
        }

        private static void SetUpSpriteCreator(SaveFile sav)
        {
            SpriteUtil.Initialize(sav);
            StreamSettings.CreateSpriteFile = (pk, fn) =>
            {
                var png = pk.Sprite();
                png.Save(fn);
            };
        }
    }
}
#endif
