Esempio n. 1
0
        public PlayResult RunPlay(BallLocation ball, int lineToGain, OffensivePlay offensivePlay, DefensivePlay defensivePlay, bool teamOnePossesion)
        {
            field     = new FieldObject(this);
            this.ball = ball;
            SetUpPlay(lineToGain, offensivePlay, defensivePlay, teamOnePossesion);


            if (offensivePlay.GetPlayType() != OffensivePlayType.PASS)
            {
                return(DoRun(offensivePlay, defensivePlay));
            }
            else
            {
                return(DoPass(offensivePlay, defensivePlay));
            }
        }
Esempio n. 2
0
        private void PlayGame()
        {
            ball       = new BallLocation(75, 80);
            down       = 1;
            lineToGain = 105;

            while (quarterTime > 0)
            {
                DoDrive(false);
            }

            quarter++;
            quarterTime += 60 * 15;

            while (quarterTime > 0)
            {
                DoDrive(true);
            }

            ball       = new BallLocation(75, 80);
            down       = 1;
            lineToGain = 105;

            quarterTime = 60 * 15;
            quarter++;
            teamOnePossession = !firstPos;

            while (quarterTime > 0)
            {
                DoDrive(false);
            }

            quarter++;
            quarterTime += 60 * 15;

            while (quarterTime > 0)
            {
                DoDrive(true);
            }

            while (GetTeamOneScore() == GetTeamTwoScore())
            {
                quarter     = 5;
                quarterTime = 60 * 10;

                DoDrive(true);
                if (Math.Abs(GetTeamOneScore() - GetTeamTwoScore()) == 7)
                {
                    return;
                }
                DoDrive(true);

                while (quarterTime > 0 && GetTeamOneScore() - GetTeamTwoScore() == 0)
                {
                    DoDrive(true);
                }

                if (!playoffs)
                {
                    return;
                }
            }
        }
Esempio n. 3
0
 public PlayResult(BallLocation ball, bool turnover, bool touchdown)
 {
     this.ball      = ball;
     this.turnover  = turnover;
     this.touchdown = touchdown;
 }