/// <summary> /// Søgefunktion der finder alle tørretumblere med et angivet energimærke. /// </summary> /// <param name="rating">Energiklasse</param> /// <returns>foundItems</returns> public List <InventoryEntry> SearchForEnergyRating(EnergyRating rating) { List <InventoryEntry> foundItems = new List <InventoryEntry>(); IEnumerable <InventoryEntry> temp = _stock.Where(invEntry => invEntry.Item is Dryer && ((Dryer)(invEntry.Item)).GetEnergyRating() == rating); foundItems = temp.ToList <InventoryEntry>(); return(foundItems); }
/// <summary> /// Vigtig hjælpemetode, som beregner energiklassen for en hvilken som helst type /// af tørretumbler. /// </summary> /// <param name="energyThreshold"></param> /// <returns></returns> protected EnergyRating TumbleDryerEnergyRating(List <double> energyThreshold) { //Sorterer grænseværdierne så de er i ordnet rækkefølge, hvilket de burde være i forvejen! energyThreshold.Sort(); //Sætter resultatet til den ringeste energiklasse EnergyRating result = EnergyRating.G; //Løber grænseværdierne igennem, en for en. Hvis strømforbruget ligger under grænseværdien //opdateres result enum, med den energiklasse der knytter sig til grænseværdien. foreach (double Threshold in energyThreshold) { if (RelativePowerConsumption() <= Threshold) { result = (EnergyRating)energyThreshold.IndexOf(Threshold); break; } } return(result); }
/// <summary> /// Initializes a new instance of the <see cref="AdditionalFeatures" /> class. /// </summary> /// <param name="priceOfPreviousSale">priceOfPreviousSale.</param> /// <param name="dateOfPreviousSale">dateOfPreviousSale.</param> /// <param name="leaseholdOrFreehold">leaseholdOrFreehold.</param> /// <param name="wallType">wallType.</param> /// <param name="wallInsulation">wallInsulation.</param> /// <param name="wallEnergyEfficiency">wallEnergyEfficiency.</param> /// <param name="roofType">roofType.</param> /// <param name="roofInsulation">roofInsulation.</param> /// <param name="roofEnergyEfficiency">roofEnergyEfficiency.</param> /// <param name="windowGlazingType">windowGlazingType.</param> /// <param name="windowEnergyEfficiency">windowEnergyEfficiency.</param> /// <param name="currentEnergyRating">currentEnergyRating.</param> /// <param name="potentialEnergyRating">potentialEnergyRating.</param> /// <param name="annualHeatingCostInPounds">annualHeatingCostInPounds.</param> /// <param name="annualHotWaterCostInPounds">annualHotWaterCostInPounds.</param> /// <param name="annualLightingCostInPounds">annualLightingCostInPounds.</param> /// <param name="annualEnergyConsumptionInKWh">annualEnergyConsumptionInKWh.</param> /// <param name="floorHeightInFoot">floorHeightInFoot.</param> /// <param name="builtForm">builtForm.</param> public AdditionalFeatures(int?priceOfPreviousSale = default(int?), DateTime?dateOfPreviousSale = default(DateTime?), LeaseholdOrFreehold leaseholdOrFreehold = default(LeaseholdOrFreehold), WallType wallType = default(WallType), WallInsulation wallInsulation = default(WallInsulation), EnergyEfficiency wallEnergyEfficiency = default(EnergyEfficiency), RoofType roofType = default(RoofType), RoofInsulation roofInsulation = default(RoofInsulation), EnergyEfficiency roofEnergyEfficiency = default(EnergyEfficiency), WindowGlazingType windowGlazingType = default(WindowGlazingType), EnergyEfficiency windowEnergyEfficiency = default(EnergyEfficiency), EnergyRating currentEnergyRating = default(EnergyRating), EnergyRating potentialEnergyRating = default(EnergyRating), int?annualHeatingCostInPounds = default(int?), int?annualHotWaterCostInPounds = default(int?), int?annualLightingCostInPounds = default(int?), int?annualEnergyConsumptionInKWh = default(int?), float?floorHeightInFoot = default(float?), BuiltForm builtForm = default(BuiltForm)) { this.PriceOfPreviousSale = priceOfPreviousSale; this.DateOfPreviousSale = dateOfPreviousSale; this.LeaseholdOrFreehold = leaseholdOrFreehold; this.WallType = wallType; this.WallInsulation = wallInsulation; this.WallEnergyEfficiency = wallEnergyEfficiency; this.RoofType = roofType; this.RoofInsulation = roofInsulation; this.RoofEnergyEfficiency = roofEnergyEfficiency; this.WindowGlazingType = windowGlazingType; this.WindowEnergyEfficiency = windowEnergyEfficiency; this.CurrentEnergyRating = currentEnergyRating; this.PotentialEnergyRating = potentialEnergyRating; this.AnnualHeatingCostInPounds = annualHeatingCostInPounds; this.AnnualHotWaterCostInPounds = annualHotWaterCostInPounds; this.AnnualLightingCostInPounds = annualLightingCostInPounds; this.AnnualEnergyConsumptionInKWh = annualEnergyConsumptionInKWh; this.FloorHeightInFoot = floorHeightInFoot; this.BuiltForm = builtForm; }