-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathTurnResult.cs
More file actions
38 lines (35 loc) · 1.06 KB
/
Copy pathTurnResult.cs
File metadata and controls
38 lines (35 loc) · 1.06 KB
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
namespace Game
{
/// <summary>
/// Stores the result of a player's turn.
/// </summary>
public record TurnResult
{
/// <summary>
/// Gets the code guessed by the player.
/// </summary>
public Code Guess { get; }
/// <summary>
/// Gets the number of black pegs resulting from the guess.
/// </summary>
public int Blacks { get; }
/// <summary>
/// Gets the number of white pegs resulting from the guess.
/// </summary>
public int Whites { get; }
/// <summary>
/// Initializes a new instance of the TurnResult record.
/// </summary>
/// <param name="guess">
/// The player's guess.
/// </param>
/// <param name="blacks">
/// The number of black pegs.
/// </param>
/// <param name="whites">
/// The number of white pegs.
/// </param>
public TurnResult(Code guess, int blacks, int whites) =>
(Guess, Blacks, Whites) = (guess, blacks, whites);
}
}