Example #1
0
        public static TrackStats GetTrackStats(TrackType trackType)
        {
            var stats = new TrackStats();

            switch (trackType)
            {
            case TrackType.Road:
                stats = new TrackStats(RoadTrackSuspensionRating, RoadTrackSpeedRating, RoadTrackWeightBonus, RoadTrackAverageSpeed);
                break;

            case TrackType.XC:
                stats = new TrackStats(XCTrackSuspensionRating, XCTrackSpeedRating, XCTrackWeightBonus, XCTrackAverageSpeed);
                break;

            case TrackType.Gravel:
                stats = new TrackStats(GravelTrackSuspensionRating, GravelTrackSpeedRating, GravelTrackWeightBonus, GravelTrackAverageSpeed);
                break;

            case TrackType.DH:
                stats = new TrackStats(DHTrackSuspensionRating, DHTrackSpeedRating, DHTrackWeightBonus, DHTrackAverageSpeed);
                break;

            default:
                break;
            }

            return(stats);
        }
Example #2
0
 public RaceLogic(Bike bike, Track track)
 {
     this.Bike       = bike;
     this.Track      = track;
     this.BikeStats  = RaceConstants.GetBikeStats(bike.Type);
     this.TrackStats = RaceConstants.GetTrackStats(track.Type);
     this.random     = new Random();
 }