Esempio n. 1
0
 private void OnReset(object sender, EventArgs e)
 {
     Score = new EventScore();
 }
Esempio n. 2
0
 private void OnZero(object sender, EventArgs e)
 {
     EventScore score = new EventScore();
       score.Zero();
       Score = score;
 }
Esempio n. 3
0
 public void Reset()
 {
     Score = new EventScore();
 }
Esempio n. 4
0
 public void SetScore(Team team, int round, EventScore score)
 {
     lock (teams_)
     team.Scores[round - 1] = score;
 }
Esempio n. 5
0
        public void SetScore(int round, bool clear)
        {
            Team team = (Team)team_.SelectedItem;
            undo_team_ = team;
            undo_round_ = round;
            undo_score_ = team.Scores[round - 1];
            undo_.Text = clear ? "Undo Clear" : "Undo Set";
            undo_.Enabled = true;

            team_data_.SetScore(team, round, clear ? null : score_control_.Score);
            Save();
            UpdateScore(round);
            score_control_.Reset();
        }
Esempio n. 6
0
        public void TestGetScoresComplex()
        {
            EventScore score_zero = new EventScore();
              score_zero.Zero();

              Team team1 = new Team("1", string.Empty);

              Team team2 = new Team("2", string.Empty);
              team2.Scores[0] = score_zero;
              team2.Scores[2] = score_zero;

              Team team3 = new Team("3", string.Empty);
              team3.Scores[1] = score_zero;

              /* TODO
              Team team4 = new Team("4", string.Empty);
              team4.Scores[0] = score_zero.Clone();  // 10
              team4.Scores[0].YellowBacteriaInBase = 1;
              team4.Scores[0].BallsTouchingMat = 1;
              team4.Scores[1] = score_zero.Clone();  // 10
              team4.Scores[1].YellowBacteriaInBase = 1;
              team4.Scores[1].BallsTouchingMat = 1;
              team4.Scores[2] = score_zero.Clone();  // 40
              team4.Scores[2].TrailerLocation = TrailerLocationEnum.Dock;
              team4.Scores[2].ThermometerSpindleFullyDropped = YesNo.Yes;

              Team team5 = new Team("5", string.Empty);
              team5.Scores[0] = score_zero.Clone();  // 40
              team5.Scores[0].TrailerLocation = TrailerLocationEnum.Dock;
              team5.Scores[0].ThermometerSpindleFullyDropped = YesNo.Yes;
              team5.Scores[1] = score_zero.Clone();  // 20
              team5.Scores[1].TrailerLocation = TrailerLocationEnum.Dock;
              team5.Scores[2] = score_zero.Clone();  // 10
              team5.Scores[2].YellowBacteriaInBase = 1;
              team5.Scores[2].BallsTouchingMat = 1;

              Team team6 = new Team("6", string.Empty);
              team6.Scores[0] = score_zero.Clone();  // 20
              team6.Scores[0].TrailerLocation = TrailerLocationEnum.Dock;
              team6.Scores[1] = score_zero.Clone();  // 40
              team6.Scores[1].TrailerLocation = TrailerLocationEnum.Dock;
              team6.Scores[1].ThermometerSpindleFullyDropped = YesNo.Yes;
              team6.Scores[2] = score_zero.Clone();  // 20
              team6.Scores[2].TrailerLocation = TrailerLocationEnum.Dock;

              Team team7 = new Team("7", string.Empty);
              team7.Scores[0] = team5.Scores[0].Clone();
              team7.Scores[1] = team5.Scores[1].Clone();
              team7.Scores[2] = team5.Scores[2].Clone();

              TeamData team_data = new TeamData();
              team_data.Teams = new Team[] {team1, team2, team3, team4, team5, team6,
                                    team7};
              ScoreRow[] scores = team_data.GetScores();
              Assert.AreEqual(7, scores.Length);
              Assert.AreEqual("6", scores[0].Number);
              Assert.AreEqual(1, scores[0].Rank);
              Assert.AreEqual("5", scores[1].Number);
              Assert.AreEqual(2, scores[1].Rank);
              Assert.AreEqual("7", scores[2].Number);
              Assert.AreEqual(2, scores[2].Rank);
              Assert.AreEqual("4", scores[3].Number);
              Assert.AreEqual(4, scores[3].Rank);
              Assert.AreEqual("2", scores[4].Number);
              Assert.AreEqual(5, scores[4].Rank);
              Assert.AreEqual("3", scores[5].Number);
              Assert.AreEqual(6, scores[5].Rank);
              Assert.AreEqual("1", scores[6].Number);
              Assert.AreEqual(7, scores[6].Rank);
              */
        }
Esempio n. 7
0
        public void TestGetScoresEqual()
        {
            EventScore score_zero = new EventScore();
              score_zero.Zero();

              Team team1 = new Team("1", string.Empty);

              Team team2 = new Team("2", string.Empty);
              team2.Scores[0] = score_zero;
              team2.Scores[2] = score_zero;

              Team team3 = new Team("3", string.Empty);
              team3.Scores[1] = score_zero;

              Team team4 = new Team("4", string.Empty);
              team4.Scores[0] = score_zero;
              team4.Scores[1] = score_zero;
              team4.Scores[2] = score_zero;

              TeamData team_data = new TeamData();
              team_data.Teams = new Team[] {team1, team2, team3, team4};
              ScoreRow[] scores = team_data.GetScores();
              Assert.AreEqual(4, scores.Length);
              Assert.AreEqual("4", scores[0].Number);
              Assert.AreEqual(1, scores[0].Rank);
              Assert.AreEqual("2", scores[1].Number);
              Assert.AreEqual(1, scores[0].Rank);
              Assert.AreEqual("3", scores[2].Number);
              Assert.AreEqual(1, scores[0].Rank);
              Assert.AreEqual("1", scores[3].Number);
              Assert.AreEqual(1, scores[0].Rank);
        }