Exemplo n.º 1
0
        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));
            }
        }
Exemplo n.º 2
0
        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);
            }
        }