aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Ava/Ui/Models/CheatModel.cs
blob: cdab27cd84e3c97a6cc995bcba3becae576b0f9d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using Ryujinx.Ava.Ui.ViewModels;
using System;

namespace Ryujinx.Ava.Ui.Models
{
    public class CheatModel : BaseModel
    {
        private bool _isEnabled;

        public event EventHandler<bool> EnableToggled;

        public CheatModel(string name, string buildId, bool isEnabled)
        {
            Name = name;
            BuildId = buildId;
            IsEnabled = isEnabled;
        }

        public bool IsEnabled
        {
            get => _isEnabled;
            set
            {
                _isEnabled = value;
                EnableToggled?.Invoke(this, _isEnabled);
                OnPropertyChanged();
            }
        }

        public string BuildId { get; }

        public string BuildIdKey => $"{BuildId}-{Name}";
        public string Name { get; }

        public string CleanName => Name.Substring(1, Name.Length - 8);
    }
}