using System;
using VeloeMinecraftLauncher.Models.Entity;

namespace VeloeMinecraftLauncher.Utils.Downloader
{
    public class DownloaderParameters
    {
        public Actions Action { get; set; } = new Actions();

        public Parameters Parameter { get; set; } = new Parameters();

        public DataModels Data { get; set; } = new DataModels();

        public class Actions
        {

            /// <summary>
            /// Action for set downloading file status outside (on ui)
            /// </summary>
            public Action<string> DownloadingFileName { get; set; } = value => { };
            /// <summary>
            /// Action for set overall downloading status outside (on ui)
            /// </summary>
            public Action<string> TasksStatus { get; set; } = value => { };
            /// <summary>
            /// Action for set lock ui command
            /// </summary>
            public Action<bool> IsControlsEnabled { get; set; } = value => { };
            /// <summary>
            /// Action for set progress bar value outside (on ui)
            /// </summary>
            public Action<long> SetProgress { get; set; } = value => { };
        }

        public class Parameters
        {
            public bool DownloadJava { get; set; } = false;
            public bool InstallForge { get; set; } = false;
            public bool InstallOptifine { get; set; } = false;
            public bool InstallForgeOptifine { get; set; } = false;
            public bool InstallFabric { get; set; } = false;
        }

        public class DataModels
        {
            /// <summary>
            /// Selected version model from versions manifest json file
            /// </summary>
            public Entity.VersionManifest.Version? SelectedVersion { get; set; } = null;

            public Entity.Version.Version? VersionJson { get; set; } = null;

            /// <summary>
            /// Selected modpack from modpacks list json file
            /// </summary>
            public Modpack? SelectedModpack { get; set; } = null;
        }
    }
}
