using System;
using System.Collections.Generic;
using System.Text;
namespace TrackerLibrary.Models
{
///
/// Represents one match in the tournament.
///
public class MatchupModel
{
///
/// The unique identifier for the matchup
///
public int Id { get; set; }
///
/// The set of teams that were involved in this match.
///
public List Entries { get; set; } = new List();
///
/// The Id from database that will be used to lookup the winner
///
public int WinnerId { get; set; }
///
/// The winner of the match.
///
public TeamModel Winner { get; set; }
///
/// Which round this match is a part of.
///
public int MatchupRound { get; set; }
public string DisplayName
{
get
{
string output = "";
foreach (MatchupEntryModel me in Entries)
{
if (me.TeamCompeting != null)
{
if (output.Length == 0)
{
output = me.TeamCompeting.TeamName;
}
else
{
output += $" vs. {me.TeamCompeting.TeamName}";
}
}
else
{
output = "Matchup not yet Determined";
break;
}
}
return output;
}
}
}
}