/
bulkin
/
BModder
Обзор
Документация
Войти
/
bulkin
/
BModder
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
BModder.UI/Config/Config.cs
54 строки
1 KB
bulka-s
fix bugs
16 окт 2025, 18:54
16 окт 2025, 18:54
065decf
Код
Авторство
О чём код?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.Json.Serialization; using System.Threading.Tasks; namespace BModder.UI { public class Config { [JsonPropertyName("gameName")] public string? GameName { get; set; } [JsonPropertyName("mainFile")] public string? MainFile { get; set; } [JsonPropertyName("modsPath")] public string? ModsPath { get; set; } [JsonPropertyName("mods")] public List<Mod>? Mods { get; set; } public bool CheckConfig() { if (string.IsNullOrWhiteSpace(GameName)) { LogHelper.WriteLog("Game name is missing in config.", LogHelper.LogType.Error); return false; } if (string.IsNullOrWhiteSpace(MainFile)) { LogHelper.WriteLog("Main file (executable) is missing in config.", LogHelper.LogType.Error); return false; } if (string.IsNullOrWhiteSpace(ModsPath)) { LogHelper.WriteLog("Mods path is missing in config.", LogHelper.LogType.Warn); // можно не возвращать false, если это не критично } if (Mods == null || Mods.Count == 0) { LogHelper.WriteLog("No mods specified in config.", LogHelper.LogType.Warn); } return true; } } }