using System.Collections.Generic;
namespace LaDOSE.Entity
{
///
/// Every recorded meeting between two players, broken down per game.
/// Not an entity: computed in memory by StatisticsService and mapped to
/// PlayerVersusDTO by AutoMapper, same as .
/// Property names must stay identical to the DTO's, the mapping is by convention.
///
/// A carries no game of its own — the game comes from the
/// the set belongs to, and that Tournament.GameId is
/// nullable. Sets behind a bracket with no game are counted in
/// and excluded from everything else, because a
/// per-game breakdown cannot say anything about them.
///
public class PlayerVersus
{
public int PlayerAId { get; set; }
/// Gamertag, falling back to Name, else "#<id>".
public string PlayerA { get; set; }
public int PlayerBId { get; set; }
public string PlayerB { get; set; }
/// Meetings in a bracket whose game is known — the sum of the rows below.
public int Sets { get; set; }
/// Of those, the ones with a determinable winner (unequal scores).
public int DecidedSets { get; set; }
public int WinsA { get; set; }
public int WinsB { get; set; }
///
/// Meetings dropped because the bracket has no game attached. Reported rather
/// than hidden: it is the difference between "they never met" and "we cannot
/// tell which game they met in".
///
public int UnknownGameSets { get; set; }
/// One row per game they actually met in, most-played first.
public List Games { get; set; } = new List();
}
/// One game's slice of a .
public class VersusGameStats
{
public int GameId { get; set; }
/// Game.Name, or "#<id>" when the game row is gone.
public string Game { get; set; }
public string GameLongName { get; set; }
/// Meetings in this game, decided or not.
public int Sets { get; set; }
/// Meetings with a determinable winner. Always equals WinsA + WinsB.
public int DecidedSets { get; set; }
public int WinsA { get; set; }
public int WinsB { get; set; }
/// Individual games won inside the decided sets (a DQ, stored as -1, clamps to 0).
public int GamesWonA { get; set; }
public int GamesWonB { get; set; }
}
///
/// A player who can be picked for a versus lookup, i.e. one with at least one set
/// in a bracket whose game is known. Offering anyone else would mean offering
/// players the breakdown must then report as empty.
///
public class PlayerOption
{
public int Id { get; set; }
/// Gamertag, falling back to Name, else "#<id>".
public string Name { get; set; }
/// Sets in a bracket with a known game, whoever the opponent was.
public int Sets { get; set; }
}
}