mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 07:10:42 -08:00
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
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);
|
|
}
|
|
}
|