コード例 #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));
            }
        }
コード例 #2
0
ファイル: Household.cs プロジェクト: xcyi2017/forayu
        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);
            }
        }