using FastMember; using HKW.HKWUtils.Observable; using System.ComponentModel; using System.Windows; using VPet.Solution.Properties; using VPet_Simulator.Core; using VPet_Simulator.Windows.Interface; namespace VPet.Solution.Models; public class SettingsModel : ObservableClass { private GraphicsSettingsModel _graphicsSettings; public GraphicsSettingsModel GraphicsSettings { get => _graphicsSettings; set => SetProperty(ref _graphicsSettings, value); } public SettingsModel(Setting setting) { GraphicsSettings = LoadGraphicsSettings(setting); } private GraphicsSettingsModel LoadGraphicsSettings(Setting setting) { var graphicsSettings = new GraphicsSettingsModel(); var sourceAccessor = ObjectAccessor.Create(setting); var targetAccessor = ObjectAccessor.Create(graphicsSettings); foreach (var property in typeof(GraphicsSettingsModel).GetProperties()) targetAccessor[property.Name] = sourceAccessor[property.Name]; return graphicsSettings; } private double _voiceVolume; /// /// 播放声音大小 /// public double VoiceVolume { get => _voiceVolume; set => SetProperty(ref _voiceVolume, value); } /// /// 数据收集是否被禁止(当日) /// public bool DiagnosisDayEnable { get; } = true; private bool _diagnosis; /// /// 是否启用数据收集 /// public bool Diagnosis { get => _diagnosis; set => SetProperty(ref _diagnosis, value); } private GameSave.ModeType _calFunState; /// /// 非计算模式下默认模式 /// public GameSave.ModeType CalFunState { get => _calFunState; set => SetProperty(ref _calFunState, value); } private int _diagnosisInterval; /// /// 数据收集频率 /// public int DiagnosisInterval { get => _diagnosisInterval; set => SetProperty(ref _diagnosisInterval, value); } private int _autoSaveInterval; /// /// 自动保存频率 (min) /// public int AutoSaveInterval { get => _autoSaveInterval; set => SetProperty(ref _autoSaveInterval, value); } private int _backupSaveMaxNum; /// /// 备份保存最大数量 /// public int BackupSaveMaxNum { get => _backupSaveMaxNum; set => SetProperty(ref _backupSaveMaxNum, value); } private bool _petHelper; /// /// 是否显示宠物帮助窗口 /// public bool PetHelper { get => _petHelper; set => SetProperty(ref _petHelper, value); } private DateTime _lastCacheDate; /// /// 上次清理缓存日期 /// public DateTime LastCacheDate { get => _lastCacheDate; set => SetProperty(ref _lastCacheDate, value); } private int _saveTimes; /// /// 储存顺序次数 /// public int SaveTimes { get => _saveTimes; set => SetProperty(ref _saveTimes, value); } private int _pressLength; /// /// 按多久视为长按 单位毫秒 /// public int PressLength { get => _pressLength; set => SetProperty(ref _pressLength, value); } private int _interactionCycle; /// /// 互动周期 /// public int InteractionCycle { get => _interactionCycle; set => SetProperty(ref _interactionCycle, value); } private double _logicInterval; /// /// 计算间隔 (秒) /// public double LogicInterval { get => _logicInterval; set => SetProperty(ref _logicInterval, value); } private double _petHelpLeft; /// /// 计算间隔 /// public double PetHelpLeft { get => _petHelpLeft; set => SetProperty(ref _petHelpLeft, value); } private double _petHelpTop; /// /// 计算间隔 /// public double PetHelpTop { get => _petHelpTop; set => SetProperty(ref _petHelpTop, value); } private bool _allowMove; /// /// 允许移动事件 /// public bool AllowMove { get => _allowMove; set => SetProperty(ref _allowMove, value); } private bool _smartMove; /// /// 智能移动 /// public bool SmartMove { get => _smartMove; set => SetProperty(ref _smartMove, value); } private bool _enableFunction; /// /// 启用计算等数据功能 /// public bool EnableFunction { get => _enableFunction; set => SetProperty(ref _enableFunction, value); } private int _smartMoveInterval; /// /// 智能移动周期 (秒) /// public int SmartMoveInterval { get => _smartMoveInterval; set => SetProperty(ref _smartMoveInterval, value); } private bool _messageBarOutside; /// /// 消息框外置 /// public bool MessageBarOutside { get => _messageBarOutside; set => SetProperty(ref _messageBarOutside, value); } private string _petGraph; /// /// 桌宠选择内容 /// public string PetGraph { get => _petGraph; set => SetProperty(ref _petGraph, value); } private double _musicCatch; /// /// 当实时播放音量达到该值时运行音乐动作 /// public double MusicCatch { get => _musicCatch; set => SetProperty(ref _musicCatch, value); } private double _musicMax; /// /// 当实时播放音量达到该值时运行特殊音乐动作 /// public double MusicMax { get => _musicMax; set => SetProperty(ref _musicMax, value); } private bool _autoBuy; /// /// 允许桌宠自动购买食品 /// public bool AutoBuy { get => _autoBuy; set => SetProperty(ref _autoBuy, value); } private bool _autoGift; /// /// 允许桌宠自动购买礼物 /// public bool AutoGift { get => _autoGift; set => SetProperty(ref _autoGift, value); } private bool _moveAreaDefault; public bool MoveAreaDefault { get => _moveAreaDefault; set => SetProperty(ref _moveAreaDefault, value); } private System.Drawing.Rectangle _moveArea; public System.Drawing.Rectangle MoveArea { get => _moveArea; set => SetProperty(ref _moveArea, value); } }