mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
VPetSolution支持1.10版本
This commit is contained in:
parent
a0d2933d15
commit
813fd373fe
@ -124,10 +124,10 @@ public class SaveModel : ObservableClass<SaveModel>
|
||||
#endregion
|
||||
|
||||
#region Mode
|
||||
private VPet_Simulator.Core.GameSave.ModeType _mode;
|
||||
private VPet_Simulator.Core.IGameSave.ModeType _mode;
|
||||
|
||||
[ReflectionProperty(nameof(VPet_Simulator.Core.GameSave.Mode))]
|
||||
public VPet_Simulator.Core.GameSave.ModeType Mode
|
||||
[ReflectionProperty(nameof(VPet_Simulator.Core.IGameSave.Mode))]
|
||||
public VPet_Simulator.Core.IGameSave.ModeType Mode
|
||||
{
|
||||
get => _mode;
|
||||
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);
|
||||
}
|
||||
|
@ -51,20 +51,20 @@ public class InteractiveSettingModel : ObservableClass<InteractiveSettingModel>
|
||||
#endregion
|
||||
|
||||
#region CalFunState
|
||||
private GameSave.ModeType _calFunState;
|
||||
private IGameSave.ModeType _calFunState;
|
||||
|
||||
/// <summary>
|
||||
/// 非计算模式下默认模式
|
||||
/// </summary>
|
||||
[ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.CalFunState))]
|
||||
public GameSave.ModeType CalFunState
|
||||
public IGameSave.ModeType CalFunState
|
||||
{
|
||||
get => _calFunState;
|
||||
set => SetProperty(ref _calFunState, value);
|
||||
}
|
||||
|
||||
public ObservableCollection<GameSave.ModeType> ModeTypes { get; } =
|
||||
new(Enum.GetValues(typeof(GameSave.ModeType)).Cast<GameSave.ModeType>());
|
||||
public ObservableCollection<IGameSave.ModeType> ModeTypes { get; } =
|
||||
new(Enum.GetValues(typeof(IGameSave.ModeType)).Cast<IGameSave.ModeType>());
|
||||
#endregion
|
||||
|
||||
#region LastCacheDate
|
||||
|
@ -28,29 +28,6 @@ public static class Extensions
|
||||
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)
|
||||
//{
|
||||
// return ((FileStream)image.StreamSource).Name;
|
||||
|
Loading…
Reference in New Issue
Block a user