示例#1
0
        public void FuelVehicle(string vehicleID, eFuelType fuelType, float amountOfFuelToAdd)
        {
            PoweredByFuel powerType = m_VehiclesInGarage[vehicleID].PowerType as PoweredByFuel;

            if (powerType != null)
            {
                powerType.addFuel(fuelType, amountOfFuelToAdd);
            }
        }
示例#2
0
        public Truck(bool isElectricPoweredTruck)
        {
            m_VehicleWheels = new List <Wheel>();

            for (int i = 0; i < k_NumOfWheelsInTruck; i++)
            {
                Wheel wheelToAdd = new Wheel();
                wheelToAdd.MaximumAirPressure = k_MaxAirPressureInTruckWheel;
                m_VehicleWheels.Add(wheelToAdd);
            }

            TruckPowerType = new PoweredByFuel(k_FuelPoweredTruckFuelType, k_MaxFuelTankCapacityInFuelPoweredTruck);
        }
示例#3
0
        public Motorcycle(bool isElectricMotorcycle)
        {
            m_VehicleWheels = new List <Wheel>();

            for (int i = 0; i < k_NumOfWheelsInMotorcycle; i++)
            {
                Wheel wheelToAdd = new Wheel();
                wheelToAdd.MaximumAirPressure = k_MaxAirPressureInMotorcycleWheel;
                m_VehicleWheels.Add(wheelToAdd);
            }

            if (isElectricMotorcycle)
            {
                MotorcyclePowerType = new PoweredByElectricity(k_MaxBatteryCapacityInElectricMotorcycle);
            }
            else
            {
                MotorcyclePowerType = new PoweredByFuel(k_FuelPoweredMotorcycleeFuelType, k_MaxFuelTankCapacityInFuelPoweredMotorcycle);
            }
        }