示例#1
0
        void DoArrayBuilder()
        {
            Permutations <int> intPer = new Permutations <int>(new int[] { 0, 1, 2, 3, 4 }, GenerateOption.WithoutRepetition);

            //生成颜色数组
            foreach (IList <int> item in intPer)
            {
                if (ConditionService.Verify14(item))
                {
                    int[] ts = new int[5];
                    item.CopyTo(ts, 0);
                    _Colors.Add(ts);
                }
            }
            //生成国家数组
            foreach (IList <int> item in intPer)
            {
                if (ConditionService.Verify08(item))
                {
                    int[] ts = new int[5];
                    item.CopyTo(ts, 0);
                    _Nationals.Add(ts);
                }
            }
            //生成饮料数组
            foreach (IList <int> item in intPer)
            {
                if (ConditionService.Verify09(item))
                {
                    int[] ts = new int[5];
                    item.CopyTo(ts, 0);
                    _Drinks.Add(ts);
                }
            }
            //生成宠物数组
            foreach (IList <int> item in intPer)
            {
                int[] ts = new int[5];
                item.CopyTo(ts, 0);
                _Pets.Add(ts);
            }
            //生成香烟数组
            foreach (IList <int> item in intPer)
            {
                int[] ts = new int[5];
                item.CopyTo(ts, 0);
                _Cigarettes.Add(ts);
            }
            this.SetTotalLabel(_Colors.Count * _Nationals.Count * _Drinks.Count * _Pets.Count * _Cigarettes.Count);
            //_count = _Colors.Count + _Nationals.Count + _Drinks.Count + _Pets.Count + _Cigarettes.Count;
        }
示例#2
0
        public bool Verify()
        {
            if (!ConditionService.VerifySmoker(this))
            {
                return(false);
            }
            if (!ConditionService.VerifyNational(this))
            {
                return(false);
            }
            if (!ConditionService.VerifyColor(this))
            {
                return(false);
            }

            return(true);
        }