Beispiel #1
0
        public void NewShotIfNotServe()
        {
            if (shotHistory.Count == 0)
            {
                return;
            }
            currentPlayerShooting = (currentPlayerShooting == 0) ? 1 : 0;
            Shot shot = ShotMaker.CreateShot(currentPlayerShooting, currentShot, advantage, shotHistory[shotHistory.Count - 1].type);

            currentShot = shot;
        }
Beispiel #2
0
        public Point(Score score, PointHistory history)
        {
            shotHistory = new List <HistoryShot>();
            pointOver   = false;
            advantage   = new Advantage();

            //TODO TOSS RIGHT THERE
            if (history.FirstPoint())
            {
                currentPlayerServing = 0;
                Serve serve = ShotMaker.CreateServe(currentPlayerServing, score);
                currentShot = serve;
            }
            else
            {
                currentPlayerServing = history.GetLastPointWinner();
                Serve serve = ShotMaker.CreateServe(currentPlayerServing, score);
                currentShot = serve;
            }
        }
Beispiel #3
0
 public (ShotCoord, ShotCoord) GetServingPositions(Score score)
 {
     return(ShotMaker.GetPlayerIntialPositions(currentPlayerServing, score));
 }