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.TeamId];
                }
                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));
            }
        }
예제 #2
0
 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.");
 }
예제 #3
0
 public override NodeMeasurement MeasureWinner(Tournaments.Graphics.IGraphics g, TournamentNameTable names, float textHeight, Score score)
 {
     //return this.MeasureTextBox(g, textHeight, "bye", score);
     return(null);
 }
예제 #4
0
 public override void Render(Tournaments.Graphics.IGraphics g, TournamentNameTable names, float x, float y, float textHeight)
 {
     this.decider.RenderWinner(g, names, x, y, textHeight, this.Score);
 }
예제 #5
0
 public override NodeMeasurement Measure(Tournaments.Graphics.IGraphics g, TournamentNameTable names, float textHeight)
 {
     return(this.decider.MeasureWinner(g, names, textHeight, this.Score));
 }
예제 #6
0
 public override void RenderLoser(Tournaments.Graphics.IGraphics g, TournamentNameTable names, float x, float y, float textHeight, Score score)
 {
     throw new NotImplementedException();
 }
예제 #7
0
 public override NodeMeasurement MeasureLoser(Tournaments.Graphics.IGraphics g, TournamentNameTable names, float textHeight, Score score)
 {
     throw new NotImplementedException();
 }