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));
            }
        }
Beispiel #2
0
 /// <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.");
 }
Beispiel #3
0
 /// <inheritdoc />
 public override NodeMeasurement MeasureWinner(Tournaments.Graphics.IGraphics g, TournamentNameTable names, float textHeight, Score score)
 {
     //return this.MeasureTextBox(g, textHeight, "bye", score);
     return(null);
 }