コード例 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="kicker">Player</param>
 /// <param name="distance">int</param>
 /// <param name="isExtraPoint">bool</param>
 public FieldGoal(Player kicker, int distance, bool isExtraPoint, KickPlayStatSheet gameStats)
 {
     this.principalBallcarrier = kicker;
     this.distance             = distance;
     this.isExtraPoint         = isExtraPoint;
     this.gameStats            = gameStats;
 }
コード例 #2
0
ファイル: ChainCrew.cs プロジェクト: mdbull/Football
        /// <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);
        }
コード例 #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sheets">StatSheet[]</param>
        /// <returns>StatSheet</returns>
        protected override StatSheet AggregateStatSheets(params StatSheet[] sheets)
        {
            KickPlayStatSheet ret = new KickPlayStatSheet((Player)this.entity);

            foreach (KickPlayStatSheet sheet in sheets)
            {
                ret.xpAttempted += sheet.xpAttempted;
                ret.xpMade      += sheet.xpMade;
                ret.fgAttempted += sheet.fgAttempted;
                ret.fgMade      += sheet.fgMade;
                ret.xpPercentage = CalculatePercentage(ret.xpAttempted, ret.xpMade);
                ret.fgPercentage = CalculatePercentage(ret.fgAttempted, ret.fgMade);
                if (sheet.longPlay > ret.LongPlay)
                {
                    ret.longPlay = sheet.LongPlay;
                }
            }
            return(ret);
        }