public int GetGolfBallScore(Projectile golfBall) { int golfBallId = GetGolfBallId(golfBall); GolfBallTrackRecord golfBallTrackRecord = _hitRecords[golfBallId]; if (golfBallTrackRecord == null) { return(0); } return((int)((float)golfBallTrackRecord.GetAccumulatedScore() * ScoreAdjustment)); }
public void RecordSwing(Projectile golfBall) { _lastSwingPosition = golfBall.position; _lastHitGolfBall = golfBall; _lastRecordedSwingCount = (int)golfBall.ai[1]; _waitingForBallToSettle = true; int golfBallId = GetGolfBallId(golfBall); if (_hitRecords[golfBallId] == null || _lastRecordedSwingCount == 1) { _hitRecords[golfBallId] = new GolfBallTrackRecord(); } _hitRecords[golfBallId].RecordHit(golfBall.position); }
public int GetGolfBallScore(Projectile golfBall) { GolfBallTrackRecord hitRecord = this._hitRecords[this.GetGolfBallId(golfBall)]; return(hitRecord == null ? 0 : (int)((double)hitRecord.GetAccumulatedScore() * (double)this.ScoreAdjustment)); }