@@ -8,7 +8,7 @@ namespace Brainf_ckSharp.Shared.Models.Console.Controls;
8
8
/// <summary>
9
9
/// A model that represents a group of 4 contiguous memory cells
10
10
/// </summary>
11
- public sealed class Brainf_ckMemoryCellChunk : ObservableObject
11
+ public sealed partial class Brainf_ckMemoryCellChunk : ObservableObject
12
12
{
13
13
/// <summary>
14
14
/// Creates a new <see cref="Brainf_ckMemoryCellChunk"/> instance with the specified parameters
@@ -27,49 +27,29 @@ public Brainf_ckMemoryCellChunk(IReadOnlyMachineState state, int offset)
27
27
this . selectedIndex = state . Position ;
28
28
}
29
29
30
- private Brainf_ckMemoryCell zero ;
31
-
32
30
/// <summary>
33
31
/// Gets the first memory cell
34
32
/// </summary>
35
- public Brainf_ckMemoryCell Zero
36
- {
37
- get => this . zero ;
38
- set => SetProperty ( ref this . zero , value ) ;
39
- }
40
-
41
- private Brainf_ckMemoryCell one ;
33
+ [ ObservableProperty ]
34
+ private Brainf_ckMemoryCell zero ;
42
35
43
36
/// <summary>
44
37
/// Gets the second memory cell
45
38
/// </summary>
46
- public Brainf_ckMemoryCell One
47
- {
48
- get => this . one ;
49
- set => SetProperty ( ref this . one , value ) ;
50
- }
51
-
52
- private Brainf_ckMemoryCell two ;
39
+ [ ObservableProperty ]
40
+ private Brainf_ckMemoryCell one ;
53
41
54
42
/// <summary>
55
43
/// Gets the third memory cell
56
44
/// </summary>
57
- public Brainf_ckMemoryCell Two
58
- {
59
- get => this . two ;
60
- set => SetProperty ( ref this . two , value ) ;
61
- }
62
-
63
- private Brainf_ckMemoryCell three ;
45
+ [ ObservableProperty ]
46
+ private Brainf_ckMemoryCell two ;
64
47
65
48
/// <summary>
66
49
/// Gets the fourth memory cell
67
50
/// </summary>
68
- public Brainf_ckMemoryCell Three
69
- {
70
- get => this . three ;
71
- set => SetProperty ( ref this . three , value ) ;
72
- }
51
+ [ ObservableProperty ]
52
+ private Brainf_ckMemoryCell three ;
73
53
74
54
/// <summary>
75
55
/// Gets the offset of the first memory cell in the chunk with respect to the source memory state
@@ -79,10 +59,10 @@ public Brainf_ckMemoryCell Three
79
59
/// <summary>
80
60
/// Gets whether or not the current position is within the current chunk
81
61
/// </summary>
82
- public bool IsChunkSelected => this . zero . IsSelected ||
83
- this . one . IsSelected ||
84
- this . two . IsSelected ||
85
- this . three . IsSelected ;
62
+ public bool IsChunkSelected => Zero . IsSelected ||
63
+ One . IsSelected ||
64
+ Two . IsSelected ||
65
+ Three . IsSelected ;
86
66
87
67
private int selectedIndex ;
88
68
0 commit comments