-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCombatLogDataContext.cs
83 lines (64 loc) · 2.26 KB
/
CombatLogDataContext.cs
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright (c) 2024, Todd Taylor (https://github.com/zxeltor)
// All rights reserved.
//
// This source code is licensed under the Apache-2.0-style license found in the
// LICENSE file in the root directory of this source tree.
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using zxeltor.StoCombat.Lib.Model.CombatLog;
using zxeltor.StoCombat.Lib.Parser;
namespace zxeltor.StoCombat.Lib;
public class CombatLogDataContext : INotifyPropertyChanged
{
#region Private Fields
private ObservableCollection<Combat>? _combatList;
private CombatLogParseSettings? _combatLogParseSettings;
private Combat? _selectedCombat;
private CombatEntity? _selectedCombatEntity;
private CombatEvent? _selectedCombatEvent;
#endregion
#region Public Properties
public Combat? SelectedCombat
{
get => this._selectedCombat;
set => this.SetField(ref this._selectedCombat, value);
}
public CombatEntity? SelectedCombatEntity
{
get => this._selectedCombatEntity;
set => this.SetField(ref this._selectedCombatEntity, value);
}
public CombatEvent? SelectedCombatEvent
{
get => this._selectedCombatEvent;
set => this.SetField(ref this._selectedCombatEvent, value);
}
public CombatLogParseSettings? CombatLogParseSettings
{
get => this._combatLogParseSettings;
set => this.SetField(ref this._combatLogParseSettings, value);
}
public ObservableCollection<Combat>? CombatList
{
get => this._combatList;
set => this.SetField(ref this._combatList, value);
}
#endregion
#region Public Members
public event PropertyChangedEventHandler? PropertyChanged;
#endregion
#region Other Members
protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null)
{
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
protected bool SetField<T>(ref T field, T value, [CallerMemberName] string? propertyName = null)
{
if (EqualityComparer<T>.Default.Equals(field, value)) return false;
field = value;
this.OnPropertyChanged(propertyName);
return true;
}
#endregion
}