Exemplo n.º 1
0
    public void CalculateData(int roundID)
    {
        ArrayList balls = dbm.ReadDBDataFromRound(roundID);

        team  = new Team();
        enemy = new Team();

        foreach (Ball b in balls)
        {
            AddBall(b);
        }

        // PrintScore();

        team_serve_pb.total   = team.t_serve_score;
        enemy_serve_pb.total  = enemy.t_serve_score;
        team_attack_pb.total  = team.t_attack_score;
        enemy_attack_pb.total = enemy.t_attack_score;

        // Player Board
        foreach (Player p in team.players)
        {
            team_serve_pb.GeneratePlayerResult(p, team, 0);
            team_attack_pb.GeneratePlayerResult(p, team, 1);

            team_score_tbl.GeneratePlayerRecord(p);  // Score Table
        }

        team_score_tbl.GenerateTeamRecord();        // Score Table
        teamScore.InitPieChart(team, 4);            // Pie for Score
        teamFail.InitPieChart(team, 6);             // Pie for Fail
        teamPieSideBoard.SetupPanel(team);

        // Player Board
        foreach (Player e in enemy.players)
        {
            enemy_serve_pb.GeneratePlayerResult(e, enemy, 0);
            enemy_attack_pb.GeneratePlayerResult(e, enemy, 1);
            enemy_score_tbl.GeneratePlayerRecord(e);  // Score Table
        }

        enemy_score_tbl.GenerateTeamRecord();       // Score Table
        enemyScore.InitPieChart(enemy, 4);          // Pie for Score
        enemyFail.InitPieChart(enemy, 6);           // Pie for Fail
        enemyPieSideBoard.SetupPanel(enemy);
    }