Пример #1
0
        private List <InsRule> ParseRules(List <string> rulesExpressions)
        {
            List <InsRule> rules = new List <InsRule>();

            foreach (var ruleExpr in rulesExpressions)
            {
                InsRule rule = new InsRule(ruleExpr);
                rules.Add(rule);
            }
            return(rules);
        }
Пример #2
0
        internal bool CheckInsRule(InsRule rule)
        {
            // Проверка, общая инсоляция квартиры (TotalRoomIns) больше или равна требуемому правилу?
            bool res = TotalInsPts >= rule.TotalInsPoints;

            return(res);
            //foreach (var req in rule.Requirements)
            //{
            //    var roomIns = TotalRoomIns.Where(r => r.InsIndex.CompareTo(req.InsIndex)>=0).Sum(s=>s.CountLighting);
            //    if (roomIns < req.CountLighting)
            //    {
            //        return false;
            //    }
            //}
            //return true;
        }