Esempio n. 1
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();
 }
Esempio n. 2
0
        public static BikeStats GetBikeStats(BikeType bikeType)
        {
            var stats = new BikeStats();

            switch (bikeType)
            {
            case BikeType.Road:
                stats = new BikeStats(RoadBikeSuspension, RoadBikeSpeed, RoadBikeWeightBonus);
                break;

            case BikeType.HMTB:
                stats = new BikeStats(HMTBSuspension, HMTBSpeed, HMTBWeightBonus);
                break;

            case BikeType.Gravel:
                stats = new BikeStats(GravelBikeSuspension, GravelBikeSpeed, GravelBikeWeightBonus);
                break;

            case BikeType.FSMTB:
                stats = new BikeStats(FSMTBSuspension, FSMTBSpeed, FSMTBWeightBonus);
                break;

            case BikeType.EBike:
                stats = new BikeStats(EBikeSuspension, EBikeSpeed, EBikeWeightBonus);
                break;

            case BikeType.City:
                stats = new BikeStats(CityBikeSuspension, CityBikeSpeed, CityBikeWeightBonus);
                break;

            default:
                break;
            }

            return(stats);
        }