Exemple #1
0
        public IActionResult Index()
        {
            var uiSettings     = UISettings.Default;
            var engineSettings = Chess.Uci.Connector.Settings.Default;

            var model = new SettingsModel
            {
                UISettings = new SettingsModel.UISettingsModel
                {
                    Language           = uiSettings.Language,
                    AvailableLanguages = _localizationService.GetAvailableLanguages()
                                         .Select(x => new SelectListItem
                    {
                        Text     = x,
                        Value    = x,
                        Selected = uiSettings.Language == x
                    }).ToList()
                },
                EngineSettings = new SettingsModel.EngineSettingsModel
                {
                    Threads    = engineSettings.Threads,
                    EnginePath = engineSettings.EnginePath,
                    MinThreads = 1,
                    MaxThreads = Environment.ProcessorCount
                }
            };

            return(View(model));
        }