Skip to content

Commit 61a54ae

Browse files
committed
Added get-only IsFinished property for convenience
1 parent 296cb45 commit 61a54ae

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • src/Codebreaker.ViewModels/Models

src/Codebreaker.ViewModels/Models/Game.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public partial class Game(
3838
/// Gets the end time of the game or null if it did not end yet. This value is set from a game guess anylzer after the game was ended.
3939
/// </summary>
4040
[ObservableProperty]
41-
private string? _endTime;
41+
[NotifyPropertyChangedFor(nameof(IsFinished))]
4242
private DateTime? _endTime;
4343

4444
/// <summary>
@@ -57,6 +57,11 @@ public partial class Game(
5757
/// </summary>
5858
public int MaxMoves { get; private set; } = maxMoves;
5959

60+
/// <summary>
61+
/// Gets a boolean value indicating if the game is finished.
62+
/// </summary>
63+
public bool IsFinished => EndTime is not null;
64+
6065
/// <summary>
6166
/// Did the player win the game?
6267
/// </summary>

0 commit comments

Comments
 (0)