aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Ava/UI/Models/CheatModel.cs
blob: 3917d4b6ddb61a1c7a567f4bb277e4b7d5ba3acc (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
38
39
40
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[1..^7];
    }
}