54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
namespace Koogle.Application.Games.Training;
|
|
|
|
/// <summary>
|
|
/// Game model for Training game type. Stores player statistics.
|
|
/// </summary>
|
|
public record TrainingGameModel
|
|
{
|
|
/// <summary>
|
|
/// Statistics for each player in the game.
|
|
/// </summary>
|
|
public Dictionary<Guid, TrainingPlayerStats> PlayerStatistics { get; init; } = new();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Statistics for a single player in a training game.
|
|
/// </summary>
|
|
public record TrainingPlayerStats
|
|
{
|
|
/// <summary>
|
|
/// Total number of throws made.
|
|
/// </summary>
|
|
public int ThrowCount { get; set; }
|
|
|
|
/// <summary>
|
|
/// Total number of pins have been cleared.
|
|
/// </summary>
|
|
public int ClearedCount { get; set; }
|
|
|
|
/// <summary>
|
|
/// Total number of pins knocked down.
|
|
/// </summary>
|
|
public int PinCount { get; set; }
|
|
|
|
/// <summary>
|
|
/// Number of circles (Kranz) scored - 8 outer pins down, center standing.
|
|
/// </summary>
|
|
public int CircleCount { get; set; }
|
|
|
|
/// <summary>
|
|
/// Number of strikes scored - all 9 pins knocked down.
|
|
/// </summary>
|
|
public int StrikeCount { get; set; }
|
|
|
|
/// <summary>
|
|
/// Number of gutters (Rinne) - no pins knocked down.
|
|
/// </summary>
|
|
public int GutterCount { get; set; }
|
|
|
|
/// <summary>
|
|
/// Calculates the average pins per throw.
|
|
/// </summary>
|
|
public double Average => ThrowCount > 0 ? (double)PinCount / ThrowCount : 0;
|
|
}
|