Example #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="fgAttempt">FieldGoal</param>
 private void OnFieldGoalAttempted(FieldGoal fgAttempt)
 {
     if (fieldGoalAttempted != null)
     {
         fieldGoalAttempted(new FieldGoalAttempedEventArgs(fgAttempt));
     }
 }
Example #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="fgAttempt">FieldGoal</param>
 public FieldGoalAttempedEventArgs(FieldGoal fgAttempt)
 {
     this.kicker    = fgAttempt.PrincipalBallcarrier;
     this.fgResult  = fgAttempt.FieldGoalResult;
     this.distance  = fgAttempt.PlayLength;
     this.report    = fgAttempt.PlayReport;
     this.isXp      = fgAttempt.IsExtraPoint;
     this.isBlocked = fgAttempt.IsBlocked;
 }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        private void ExecuteExtraPointAttempt()
        {
            Player            kicker          = this.teamInPossession.TeamOffense.GetPlayerAtPosition("K");
            int               indexOfKicker   = this.teamInPossession.GetIndexOfPlayer(kicker);
            KickPlayStatSheet kickerGameStats = (KickPlayStatSheet)game.GameStats[this.teamInPossession, indexOfKicker][StatTypes.Kicking];
            FieldGoal         fieldGoal       = new FieldGoal(kicker, 20, true, kickerGameStats);

            fieldGoal.Execute();
            FieldGoalResult fgResult = fieldGoal.FieldGoalResult;

            if (fgResult == FieldGoalResult.Good)
            {
                this.field.Scoreboard.AddScore(fieldGoal);
            }
            OnFieldGoalAttempted(fieldGoal);
        }