// Main Constructor public Freezer (int Price, int OverallVolume, int Weight, int Height, int Width, int Depth, string Name, string Manufacturer, string Color, string ProducingCountry, bool Display, bool DefrostSystem, bool RehangingDoors, byte[] DeviceImage, InstallationMethodType InstallationMethod, ControlType ControlType, int NoiseLevel, string Refrigerant, EnergyClassType EnergyClass, int UsefulVolume, int ShelvesAmount, int BoxesAmount, int AutonomousColdStorage, int FreezingPower, bool IceGenerator, bool FastFreezing, bool EcoMode, FreezerType DeviceType) : base (Price, OverallVolume, Weight, Height, Width, Depth, Name, Manufacturer, Color, ProducingCountry, Display, DefrostSystem, RehangingDoors, DeviceImage, InstallationMethod, ControlType, NoiseLevel, Refrigerant, EnergyClass) { // Int this.UsefulVolume = UsefulVolume; this.ShelvesAmount = ShelvesAmount; this.BoxesAmount = BoxesAmount; this.AutonomousColdStorage = AutonomousColdStorage; this.FreezingPower = FreezingPower; // Bool this.IceGenerator = IceGenerator; this.FastFreezing = FastFreezing; this.EcoMode = EcoMode; // Enum this.DeviceType = DeviceType; }
// Main Constructor public Fridge (int Price, int OverallVolume, int Weight, int Height, int Width, int Depth, string Name, string Manufacturer, string Color, string ProducingCountry, bool Display, bool DefrostSystem, bool RehangingDoors, byte[] DeviceImage, InstallationMethodType InstallationMethod, ControlType ControlType, int NoiseLevel, string Refrigerant, EnergyClassType EnergyClass, int CompressorsAmount, int FridgeUsefulVolume, int FreezerUsefulVolume, bool FreshnessZone, bool MiniBar, FreezerLocationType FreezerLocation, CompressorType CompressorType, FridgeType DeviceType) : base (Price, OverallVolume, Weight, Height, Width, Depth, Name, Manufacturer, Color, ProducingCountry, Display, DefrostSystem, RehangingDoors, DeviceImage, InstallationMethod, ControlType, NoiseLevel, Refrigerant, EnergyClass) { // Int this.CompressorsAmount = CompressorsAmount; this.FridgeUsefulVolume = FridgeUsefulVolume; this.FreezerUsefulVolume = FreezerUsefulVolume; // Bool this.FreshnessZone = FreshnessZone; this.MiniBar = MiniBar; // Enums this.DeviceType = DeviceType; this.CompressorType = CompressorType; this.FreezerLocation = FreezerLocation; }
// Main Constructor public Device (int Price, int OverallVolume, int Weight, int Height, int Width, int Depth, string Name, string Manufacturer, string Color, string ProducingCountry, bool Display, bool DefrostSystem, bool RehangingDoors, byte[] DeviceImage, InstallationMethodType InstallationMethod, ControlType ControlType, int NoiseLevel, string Refrigerant, EnergyClassType EnergyClass) { // Int this.Price = Price; this.OverallVolume = OverallVolume; this.Weight = Weight; this.Height = Height; this.Width = Width; this.Depth = Depth; // String this.Name = Name; this.Manufacturer = Manufacturer; this.Color = Color; this.ProducingCountry = ProducingCountry; // Bool this.Display = Display; this.DefrostSystem = DefrostSystem; this.RehangingDoors = RehangingDoors; // Image this.DeviceImage = DeviceImage; // Enums this.InstallationMethod = InstallationMethod; this.ControlType = ControlType; // IFeatures this.NoiseLevel = NoiseLevel; this.Refrigerant = Refrigerant; this.EnergyClass = EnergyClass; }
//METHODS protected EnergyClassType calcEnergyClass(double factor) { EnergyClassType res = new EnergyClassType(); double kpl = _kmPrLiter*factor; if(_year < 2010) { if(_fuel == FuelType.Diesel) { if(kpl >= 23) res = EnergyClassType.A; else if(kpl >= 18) res = EnergyClassType.B; else if(kpl >= 13) res = EnergyClassType.C; else res = EnergyClassType.D; } else { if(kpl >= 18) res = EnergyClassType.A; else if(kpl >= 14) res = EnergyClassType.B; else if(kpl >= 10) res = EnergyClassType.C; else res = EnergyClassType.D; } } else { if(_fuel == FuelType.Diesel) { if(kpl >= 25) res = EnergyClassType.A; else if(kpl >= 20) res = EnergyClassType.B; else if(kpl >= 15) res = EnergyClassType.C; else res = EnergyClassType.D; } else { if(kpl >= 20) res = EnergyClassType.A; else if(kpl >= 16) res = EnergyClassType.B; else if(kpl >= 12) res = EnergyClassType.C; else res = EnergyClassType.D; } } return res; }