mirror of
https://github.com/libretro/MesenCE.git
synced 2026-11-10 11:11:32 -10:00
Also fixes DX11.0 support (for Win7 PCs that aren't fully updated), which stopped working after the recent variable refresh rate changes
27 lines
606 B
C#
27 lines
606 B
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using Mesen.Utilities;
|
|
using System;
|
|
using System.Text.Json;
|
|
|
|
namespace Mesen.Config
|
|
{
|
|
public partial class BaseConfig<T> : ObservableObject where T : class
|
|
{
|
|
public T Clone()
|
|
{
|
|
if(this is T obj) {
|
|
return JsonHelper.Clone<T>(obj);
|
|
} else {
|
|
throw new InvalidCastException();
|
|
}
|
|
}
|
|
|
|
public bool IsIdentical(T other)
|
|
{
|
|
string a = JsonSerializer.Serialize(this, this.GetType(), MesenSerializerContext.Default);
|
|
string b = JsonSerializer.Serialize(other, this.GetType(), MesenSerializerContext.Default);
|
|
return a == b;
|
|
}
|
|
}
|
|
}
|