VPetSolution支持1.10版本

This commit is contained in:
ZouJin 2024-02-26 17:12:54 +08:00
parent a0d2933d15
commit 813fd373fe
3 changed files with 8 additions and 31 deletions

View File

@ -124,10 +124,10 @@ public class SaveModel : ObservableClass<SaveModel>
#endregion #endregion
#region Mode #region Mode
private VPet_Simulator.Core.GameSave.ModeType _mode; private VPet_Simulator.Core.IGameSave.ModeType _mode;
[ReflectionProperty(nameof(VPet_Simulator.Core.GameSave.Mode))] [ReflectionProperty(nameof(VPet_Simulator.Core.IGameSave.Mode))]
public VPet_Simulator.Core.GameSave.ModeType Mode public VPet_Simulator.Core.IGameSave.ModeType Mode
{ {
get => _mode; get => _mode;
set => SetProperty(ref _mode, value); set => SetProperty(ref _mode, value);
@ -219,7 +219,7 @@ public class SaveModel : ObservableClass<SaveModel>
} }
} }
private void LoadSave(VPet_Simulator.Core.GameSave save) private void LoadSave(VPet_Simulator.Core.IGameSave save)
{ {
ReflectionUtils.SetValue(save, this); ReflectionUtils.SetValue(save, this);
} }

View File

@ -51,20 +51,20 @@ public class InteractiveSettingModel : ObservableClass<InteractiveSettingModel>
#endregion #endregion
#region CalFunState #region CalFunState
private GameSave.ModeType _calFunState; private IGameSave.ModeType _calFunState;
/// <summary> /// <summary>
/// 非计算模式下默认模式 /// 非计算模式下默认模式
/// </summary> /// </summary>
[ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.CalFunState))] [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.CalFunState))]
public GameSave.ModeType CalFunState public IGameSave.ModeType CalFunState
{ {
get => _calFunState; get => _calFunState;
set => SetProperty(ref _calFunState, value); set => SetProperty(ref _calFunState, value);
} }
public ObservableCollection<GameSave.ModeType> ModeTypes { get; } = public ObservableCollection<IGameSave.ModeType> ModeTypes { get; } =
new(Enum.GetValues(typeof(GameSave.ModeType)).Cast<GameSave.ModeType>()); new(Enum.GetValues(typeof(IGameSave.ModeType)).Cast<IGameSave.ModeType>());
#endregion #endregion
#region LastCacheDate #region LastCacheDate

View File

@ -28,29 +28,6 @@ public static class Extensions
return source.IndexOf(value, comparisonType) >= 0; return source.IndexOf(value, comparisonType) >= 0;
} }
public static TSource MaxBy<TSource, TKey>(
this IEnumerable<TSource> source,
Func<TSource, TKey> keySelector
)
{
using IEnumerator<TSource> e = source.GetEnumerator();
if (e.MoveNext() is false)
return default;
TSource value = e.Current;
TKey key = keySelector(value);
while (e.MoveNext())
{
TSource nextValue = e.Current;
TKey nextKey = keySelector(nextValue);
if (Comparer<TKey>.Default.Compare(nextKey, key) > 0)
{
key = nextKey;
value = nextValue;
}
}
return value;
}
//public static string GetSourceFile(this BitmapImage image) //public static string GetSourceFile(this BitmapImage image)
//{ //{
// return ((FileStream)image.StreamSource).Name; // return ((FileStream)image.StreamSource).Name;