private Tyres createVehicleTyres()
        {
            var tyres = new Tyres();

            tyres.Add("Front DS", new Tyre()
            {
                maxPsi = 40, minPsi = 10
            });
            tyres.Add("Front PS", new Tyre()
            {
                maxPsi = 40, minPsi = 10
            });
            tyres.Add("Rear DS", new Tyre()
            {
                maxPsi = 35, minPsi = 10
            });
            tyres.Add("Rear PS", new Tyre()
            {
                maxPsi = 35, minPsi = 10
            });

            return(tyres);
        }
Ejemplo n.º 2
0
 public CreateStrategyModel(int strategyId, int raceLen, IList <TyreStrategy> strats, IList <Tyre> tyres)
 {
     StrategyId = strategyId;
     RaceLen    = raceLen;
     if (strats != null)
     {
         foreach (var strat in strats)
         {
             StrategyTyres.Add(strat);
         }
     }
     if (tyres != null)
     {
         foreach (var tyre in tyres)
         {
             Tyres.Add(tyre);
         }
     }
 }
Ejemplo n.º 3
0
    public Car(string model, int engSpeed, int engPower, int cargoWeight, string cargoType,
               double tyre1PS, int tyre1Age, double tyre2PS, int tyre2Age, double tyre3PS, int tyre3Age, double tyre4PS, int tyre4Age)
    {
        this.Model  = model;
        this.Engine = new Engine(engSpeed, engPower);
        this.Cargo  = new Cargo(cargoWeight, cargoType);
        this.Tyres  = new List <Tyre>();

        Tyre firstTyre = new Tyre(tyre1PS, tyre1Age);

        Tyres.Add(firstTyre);
        Tyre secondTyre = new Tyre(tyre2PS, tyre2Age);

        Tyres.Add(secondTyre);
        Tyre thirdTyre = new Tyre(tyre3PS, tyre3Age);

        Tyres.Add(thirdTyre);
        Tyre fourthTyre = new Tyre(tyre4PS, tyre4Age);

        Tyres.Add(fourthTyre);
    }