public override NodeMeasurement MeasureWinner(Tournaments.Graphics.IGraphics g, TournamentNameTable names, float textHeight, Score score) { string teamName = ""; if (this.IsDecided) { var winner = this.GetWinner(); if (winner != null) { teamName = names[winner.Id]; } else { teamName = "bye"; } } var t = this.MeasureTextBox(g, textHeight, teamName, score); var mA = this.nodeA.Measure(g, names, textHeight); var mB = this.nodeB.Measure(g, names, textHeight); if (mA == null && mB == null) { return(null); } else if (mB == null) { return(t); } else if (mA == null) { return(t); } else { var m = this.MeasureTree(g, names, textHeight, this.nodeA, this.nodeB); return(new NodeMeasurement(m.Width + t.Width, m.Height, m.CenterLine)); } }
/// <inheritdoc /> public override NodeMeasurement MeasureLoser(Tournaments.Graphics.IGraphics g, TournamentNameTable names, float textHeight, Score score) { throw new InvalidOperationException("Cannot determine a loser from a bye entry."); }
/// <inheritdoc /> public override NodeMeasurement MeasureWinner(Tournaments.Graphics.IGraphics g, TournamentNameTable names, float textHeight, Score score) { //return this.MeasureTextBox(g, textHeight, "bye", score); return(null); }