public Community(int houses, ITime clock) { _usage = new PowerUsage(); Households = new List <Household>(); while (Households.Count < houses) { Households.Add(new Household(Households.Count, new Appliances(clock).Default, clock)); } }
public Household(int communityHouseCount, IEnumerable <Appliance> appliances, ITime clock) { _id = ++communityHouseCount; _appliances = new Appliances(clock); _usage = new PowerUsage(); foreach (var appliance in appliances) { _appliances.Add(appliance); } }