コード例 #1
0
 public Vehicle(string i_VehicleModel, string i_LicencePlate, byte i_NumOfWheels, VehicleOwner i_Owner)
 {
     m_VehicleModel = i_VehicleModel;
     m_LicencePlate = i_LicencePlate;
     r_Wheels       = new Wheel[i_NumOfWheels];
     m_Owner        = i_Owner;
 }
コード例 #2
0
 public Motorcycle(string i_VehicleModel, string i_LicencePlate, float i_FuelLeft, float i_MaxFuel, byte i_NumOfWheels, eMotorcycleLicenceType i_LicenseType,
                   int i_EngineVolume, VehicleOwner i_Owner) :
     base(i_VehicleModel, i_LicencePlate, i_FuelLeft, i_MaxFuel, i_NumOfWheels, eFuelTypes.Octan96, i_Owner)
 {
     m_LicenseType  = i_LicenseType;
     m_EngineVolume = i_EngineVolume;
 }
コード例 #3
0
        public static void InsertNewVehicleToGarage(VehicleCreation.eVehicleTypes i_CreateVehicle, string i_VehicleModelName, string i_VehicleLicenceId, string i_WheelManufacturerName, float i_CurrentWheelPressure, string i_VehicleFirstParameter, string i_VehicleSecondParameter, string i_VehicleOwnerName, string i_VehicleOwnerPhone)
        {
            Vehicle      newVehicle   = VehicleCreation.CreateVehicle(i_CreateVehicle, i_VehicleModelName, i_VehicleLicenceId, i_WheelManufacturerName, i_VehicleFirstParameter, i_VehicleSecondParameter);
            VehicleOwner VehicleOwner = new VehicleOwner(i_VehicleOwnerName, i_VehicleOwnerPhone);

            newVehicle.UpdateAllCurrentWheelPressureOfVehicle(i_CurrentWheelPressure);

            sr_DictuonaryOfVehicleAndTheirOwners.Add(newVehicle, VehicleOwner); // Add to the 'VehicleGarage' dictionary
        }
コード例 #4
0
 public Vehicle(string i_LicenseNumber, string i_ModelName, Engine i_Engine)
 {
     r_LicenseNumber = i_LicenseNumber;
     r_ModelName     = i_ModelName;
     r_WheelsList    = new List <Wheel>();
     m_Owner         = new VehicleOwner();
     m_Engine        = i_Engine;
     m_VehicleStatus = eVehicleStatus.InRepair;
 }
コード例 #5
0
        public void StoreVehicle(Vehicle i_VehicleToStore, VehicleOwner i_OwnerToStore)
        {
            StoredVehicle newVehicle = new StoredVehicle(i_VehicleToStore, i_OwnerToStore);
            bool          isVehicleIdAlreadyRegistered = false;

            isVehicleIdAlreadyRegistered = m_StoredVehiclesDictionary.ContainsKey(i_VehicleToStore.GetHashCode());
            if (isVehicleIdAlreadyRegistered)
            {
                throw new ArgumentException(string.Format("ID: {0} is already registered.", i_VehicleToStore.ID));
            }

            m_StoredVehiclesDictionary.Add(i_VehicleToStore.GetHashCode(), newVehicle);
        }
コード例 #6
0
ファイル: Vehicle.cs プロジェクト: DanielleHas/Garage-Manager
        internal Vehicle(string i_ModelName, string i_LicensePlateNumber, VehicleOwner i_VehicleOwner, bool i_IsFuelBased, int i_NumOfWheels, eFuelTypes i_FuelType, float i_MaxAirPressure)
        {
            this.mr_ModelName          = i_ModelName;
            this.mr_LicensePlateNumber = i_LicensePlateNumber;
            this.m_Wheels         = new Wheel[i_NumOfWheels];
            this.m_MaxAirPressure = i_MaxAirPressure;
            this.mvr_IsFuelBased  = i_IsFuelBased;
            this.m_VehicleOwner   = i_VehicleOwner;

            if (this.mvr_IsFuelBased)
            {
                this.mr_FuelType = i_FuelType;
            }
        }
コード例 #7
0
        public void AddVehicle(int i_VehicleType, string i_ModelName, string i_LicensePlateNumber, string i_OwnerName, string i_OwnerPhoneNumber, bool i_IsFuelBased, Dictionary <string, string> i_ExtraFeatursDictionary)
        {
            Vehicle      newVehicle;
            VehicleOwner vehicleOwner;

            if (IsExistInGarage(i_LicensePlateNumber))
            {
                ChangeVehicleStatus(i_LicensePlateNumber, eStatusInGarage.Treatment);
            }
            else
            {
                vehicleOwner = new VehicleOwner(i_OwnerName, i_OwnerPhoneNumber);
                newVehicle   = CreateVehicle(i_VehicleType, i_ModelName, i_LicensePlateNumber, vehicleOwner, i_IsFuelBased, i_ExtraFeatursDictionary);
                AddVehicleToStatusList(newVehicle, eStatusInGarage.Treatment);
                newVehicle.Status = eStatusInGarage.Treatment;
            }
        }
コード例 #8
0
ファイル: CreateVehicle.cs プロジェクト: OrShilon/Garage
        public static ElectricMotorcycle CreateElectricMotorcycle(string i_VehicleModel, string i_LicencePlate, float i_BatteryLeft, eMotorcycleLicenceType i_LicenceType,
                                                                  int i_EngineVolume, string i_WheelMaker, float i_WheelCurrentPressure, VehicleOwner i_Owner)
        {
            ElectricMotorcycle electricMotorcycle = new ElectricMotorcycle(i_VehicleModel, i_LicencePlate, i_BatteryLeft, k_MotorcycleMaxBattery, k_MotorcycleNumOfWheels,
                                                                           i_LicenceType, i_EngineVolume, i_Owner);

            GenerateWheels(electricMotorcycle, k_MotorcycleMaxWheelPressure, i_WheelMaker, i_WheelCurrentPressure);

            return(electricMotorcycle);
        }
コード例 #9
0
ファイル: CreateVehicle.cs プロジェクト: OrShilon/Garage
        public static Motorcycle CreateMotorcycle(string i_VehicleModel, string i_LicencePlate, float i_FuelLeft, eMotorcycleLicenceType i_LicenceType,
                                                  int i_EngineVolume, string i_WheelMaker, float i_WheelCurrentPressure, VehicleOwner i_Owner)
        {
            Motorcycle motorcycle = new Motorcycle(i_VehicleModel, i_LicencePlate, i_FuelLeft, k_MotorcycleMaxFuel, k_MotorcycleNumOfWheels, i_LicenceType, i_EngineVolume, i_Owner);

            GenerateWheels(motorcycle, k_MotorcycleMaxWheelPressure, i_WheelMaker, i_WheelCurrentPressure);

            return(motorcycle);
        }
コード例 #10
0
ファイル: CreateVehicle.cs プロジェクト: OrShilon/Garage
        public static ElectricCar CreateElectricCar(string i_VehicleModel, string i_LicencePlate, float i_BatteryLeft, eCarColors i_Color, eNumOfDoors i_NumOfDoors,
                                                    string i_WheelMaker, float i_WheelCurrentPressure, VehicleOwner i_Owner)
        {
            ElectricCar electricCar = new ElectricCar(i_VehicleModel, i_LicencePlate, i_BatteryLeft, k_CarMaxBattery, i_Color, k_CarNumOfWheels, i_NumOfDoors, i_Owner);

            GenerateWheels(electricCar, k_CarMaxWheelPressure, i_WheelMaker, i_WheelCurrentPressure);

            return(electricCar);
        }
コード例 #11
0
ファイル: CreateVehicle.cs プロジェクト: OrShilon/Garage
        public static Car CreateCar(string i_VehicleModel, string i_LicencePlate, float i_FuelLeft, eCarColors i_Color, eNumOfDoors i_NumOfDoors,
                                    string i_WheelMaker, float i_WheelCurrentPressure, VehicleOwner i_Owner)
        {
            Car car = new Car(i_VehicleModel, i_LicencePlate, i_FuelLeft, k_CarMaxFuel, k_CarNumOfWheels, i_Color, i_NumOfDoors, i_Owner);

            GenerateWheels(car, k_CarMaxWheelPressure, i_WheelMaker, i_WheelCurrentPressure);

            return(car);
        }
コード例 #12
0
ファイル: Garage.cs プロジェクト: zvaigen/Garage
        public void InsertVehicleToTheGarage(string i_OwnerName, string i_OwnerPhoneNumber, Vehicle i_Vehicle)
        {
            VehicleOwner owner = new VehicleOwner(i_OwnerName, i_OwnerPhoneNumber);

            m_VehiclesInTheGarage.Add(i_Vehicle.LicenseNumber, new VehiclesInTheGarage(owner, i_Vehicle));
        }
コード例 #13
0
ファイル: Truck.cs プロジェクト: DanielleHas/Garage-Manager
        internal Truck(string i_ModelName, string i_LicensePlateNumber, bool i_IsFuelBased, VehicleOwner i_VehicleOwner, Dictionary <string, string> i_ExtraFeatursDictionary) : base(i_ModelName, i_LicensePlateNumber, i_VehicleOwner, i_IsFuelBased, k_NumOfWheels, k_FuelType, k_MaxAirPressure)
        {
            this.m_ExtraFeatursDictionary = i_ExtraFeatursDictionary;
            string o_Feature1Value;
            string o_Feature2Value;
            bool   v_IsSucceed = this.m_ExtraFeatursDictionary.TryGetValue(k_ExtraFearute1, out o_Feature1Value);

            if (v_IsSucceed)
            {
                SetDangerousMaterials(o_Feature1Value);
            }
            v_IsSucceed = this.m_ExtraFeatursDictionary.TryGetValue(k_ExtraFearute2, out o_Feature2Value);
            if (v_IsSucceed)
            {
                SetCarringWeight(o_Feature2Value);
            }
            if (i_IsFuelBased)
            {
                this.m_EnergyType = new Fuel(k_MaxCapacityOfFuel, 0, k_FuelType);
            }
        }
コード例 #14
0
ファイル: Car.cs プロジェクト: OrShilon/Garage
 public Car(string i_VehicleModel, string i_LicencePlate, float i_FuelLeft, float i_MaxFuel, byte i_NumOfWheels, eCarColors i_Color, eNumOfDoors i_NumOfDoors, VehicleOwner i_Owner) :
     base(i_VehicleModel, i_LicencePlate, i_FuelLeft, i_MaxFuel, i_NumOfWheels, eFuelTypes.Octan96, i_Owner)
 {
     m_Color      = i_Color;
     m_NumOfDoors = i_NumOfDoors;
 }
コード例 #15
0
        private const string k_ExtraFearute2 = "Energy capacity"; //TODO: eFeatures.Engine_Capacity.ToString();

        internal Motorcycle(string i_ModelName, string i_LicensePlateNumber, bool i_IsFuelBased, VehicleOwner i_VehicleOwner, Dictionary <string, string> i_ExtraFeatursDictionary) : base(i_ModelName, i_LicensePlateNumber, i_VehicleOwner, i_IsFuelBased, k_NumOfWheels, k_FuelType, k_MaxAirPressure)
        {
            this.m_ExtraFeatursDictionary = i_ExtraFeatursDictionary;
            string o_Feature1Value;
            string o_Feature2Value;
            bool   v_IsSucceed = this.m_ExtraFeatursDictionary.TryGetValue(k_ExtraFearute1, out o_Feature1Value);

            if (v_IsSucceed)
            {
                SetLicensType(o_Feature1Value);
            }
            v_IsSucceed = this.m_ExtraFeatursDictionary.TryGetValue(k_ExtraFearute2, out o_Feature2Value);
            if (v_IsSucceed)
            {
                SetEnergyCapacity(o_Feature2Value);
            }
            if (i_IsFuelBased)
            {
                this.m_EnergyType = new Fuel(k_MaxCapacityOfFuel, 0, k_FuelType);
            }
            else
            {
                this.m_EnergyType = new Battery(k_MaxCapacityOfBattery, 0);
            }
        }
コード例 #16
0
 public FuelVehicle(string i_VehicleModel, string i_LicencePlate, float i_FuelLeft, float i_MaxFuelTankCapacity, byte i_NumOfWheels, eFuelTypes i_FuelType, VehicleOwner i_Owner) :
     base(i_VehicleModel, i_LicencePlate, i_NumOfWheels, i_Owner)
 {
     m_FuelLeft            = i_FuelLeft;
     m_MaxFuelTankCapacity = i_MaxFuelTankCapacity;
     m_FuelType            = i_FuelType;
 }
コード例 #17
0
ファイル: ElectricVehicle.cs プロジェクト: OrShilon/Garage
 public ElectricVehicle(string i_VehicleModel, string i_LicencePlate, float i_BatteryLeft, float i_MaxBatteryHourCapacity, byte i_NumOfWheels, VehicleOwner i_Owner) :
     base(i_VehicleModel, i_LicencePlate, i_NumOfWheels, i_Owner)
 {
     m_BatteryLeft            = i_BatteryLeft;
     m_MaxBatteryHourCapacity = i_MaxBatteryHourCapacity;
 }
コード例 #18
0
 private Vehicle SetVehicle(string i_ModelName, string i_LicensePlateNumber, VehicleOwner vehicleOwner, bool i_IsFuelBased)
 {
     throw new NotImplementedException();
 }
コード例 #19
0
        /*
         * Creates a new vehicle according to the vehicle type
         */
        internal static Vehicle CreateVehicle(int i_VehicleType, string i_ModelName, string i_LicensePlateNumber, VehicleOwner i_Owner, bool i_IsFuelBased, Dictionary <string, string> i_ExtraFeatursDictionary)
        {
            Vehicle o_NewVehicle = null;

            switch ((eVehicleTypes)(i_VehicleType))
            {
            case eVehicleTypes.Car:
                o_NewVehicle = new Car(i_ModelName, i_LicensePlateNumber, i_IsFuelBased, i_Owner, i_ExtraFeatursDictionary);
                break;

            case eVehicleTypes.Motorcycle:
                o_NewVehicle = new Motorcycle(i_ModelName, i_LicensePlateNumber, i_IsFuelBased, i_Owner, i_ExtraFeatursDictionary);
                break;

            case eVehicleTypes.Truck:
                o_NewVehicle = new Truck(i_ModelName, i_LicensePlateNumber, i_IsFuelBased, i_Owner, i_ExtraFeatursDictionary);
                break;
            }

            return(o_NewVehicle);
        }
コード例 #20
0
ファイル: VehicleInGarage.cs プロジェクト: zvaigen/Garage
 public VehiclesInTheGarage(VehicleOwner i_VehicleOwner, Vehicle i_Vehicle)
 {
     m_VehicleOwner  = i_VehicleOwner;
     m_Vehicle       = i_Vehicle;
     m_VehicleStatus = Vehicle.eStatusOfVehicle.InRepair;
 }
コード例 #21
0
ファイル: CreateVehicle.cs プロジェクト: OrShilon/Garage
        public static Truck CreateTruck(string i_VehicleModel, string i_LicencePlate, float i_FuelLeft, bool i_CarryDangerousMaterials,
                                        float i_CargoVolume, string i_WheelMaker, float i_WheelCurrentPressure, VehicleOwner i_Owner)
        {
            Truck truck = new Truck(i_VehicleModel, i_LicencePlate, i_FuelLeft, k_TruckMaxFuel, k_TruckNumOfWheels, i_CarryDangerousMaterials, i_CargoVolume, i_Owner);

            GenerateWheels(truck, k_TruckMaxWheelPressure, i_WheelMaker, i_WheelCurrentPressure);

            return(truck);
        }
コード例 #22
0
ファイル: ElectricCar.cs プロジェクト: OrShilon/Garage
 public ElectricCar(string i_VehicleModel, string i_LicencePlate, float i_EnergyLeft, float i_MaxBattery, eCarColors i_Color, byte i_NumOfWheels, eNumOfDoors i_NumOfDoors, VehicleOwner i_Owner) :
     base(i_VehicleModel, i_LicencePlate, i_EnergyLeft, i_MaxBattery, i_NumOfWheels, i_Owner)
 {
     m_Color      = i_Color;
     m_NumOfDoors = i_NumOfDoors;
 }
コード例 #23
0
 public ElectricMotorcycle(string i_VehicleModel, string i_LicencePlate, float i_BatteryLeft, float i_MaxBattery, byte i_NumOfwheels, eMotorcycleLicenceType i_LicenseType, int i_EngineVolume, VehicleOwner i_Owner) :
     base(i_VehicleModel, i_LicencePlate, i_BatteryLeft, i_MaxBattery, i_NumOfwheels, i_Owner)
 {
     m_LicenseType  = i_LicenseType;
     m_EngineVolume = i_EngineVolume;
 }
コード例 #24
0
 public Truck(string i_VehicleModel, string i_LicencePlate, float i_FuelLeft, float i_MaxFuel, byte i_NumOfWheels, bool i_CarryDangerousMaterials, float i_CargoVolume, VehicleOwner i_Owner) :
     base(i_VehicleModel, i_LicencePlate, i_FuelLeft, i_MaxFuel, i_NumOfWheels, eFuelTypes.Soler, i_Owner)
 {
     m_CarryDangerousMaterials = i_CarryDangerousMaterials;
     m_CargoVolume             = i_CargoVolume;
 }