Exemple #1
0
 public void BallBowled(string outcome, int runs)
 {
     if (outcome != "Wide" && outcome != "No Ball")
     {
         OnStrike.FaceBall();
         Bowler.BallBowled();
         Overs += 0.1;
         OversConverter();
     }
     if (outcome == "Runs")
     {
         Runs(runs);
     }
     if (outcome == "Byes")
     {
         Batting.AddByes(runs);
         if (runs % 2 != 0)
         {
             BatsmenSwap();
         }
     }
     if (outcome == "Leg Byes")
     {
         Batting.AddLegByes(runs);
         if (runs % 2 != 0)
         {
             BatsmenSwap();
         }
     }
     if (outcome == "Wide")
     {
         Batting.AddWides(runs);
         if (runs - 1 % 2 != 0)
         {
             BatsmenSwap();
         }
         Bowler.ConcedeRuns(runs);
     }
     if (outcome == "No Ball")
     {
         if (runs > 1)
         {
             int batRuns = runs - 1;
             Batting.AddNoBalls(1);
             OnStrike.ScoreRuns(batRuns);
             if (batRuns % 2 != 0)
             {
                 BatsmenSwap();
             }
         }
         else
         {
             Batting.AddNoBalls(runs);
         }
         Bowler.ConcedeRuns(runs);
     }
     Batting.CalcRuns();
     EndOfOverCheck();
     InEndCheck();
 }
Exemple #2
0
 public void Runs(int runs)
 {
     OnStrike.ScoreRuns(runs);
     Bowler.ConcedeRuns(runs);
     if (runs % 2 != 0)
     {
         BatsmenSwap();
     }
 }