Example #1
0
        public bool ContainsRoyalFlush(List <Card> cards)
        {
            var royalRanks         = new Rank[] { Rank.Ten, Rank.Jack, Rank.Queen, Rank.King, Rank.Ace };
            var royallyRankedCards = cards.Where(c => royalRanks.Contains(c.Rank)).ToList();

            return(ContainsFlush(royallyRankedCards));
        }
            public Summon(Node Summon, Server.Server server)
            {
                if (Summon.child.Count < 3)
                {
                    return;
                }
                this.server = server;
                var raw_data = Summon["raw_data"];
                var baseInfo = raw_data["base"].Data.Replace(' ', '#');

                Rank = HttpUtil.GetElement(baseInfo, "等级#", "#");

                成长率   = Convert.ToDouble(HttpUtil.GetElement(baseInfo, "成长率#", "#"));
                Name  = raw_data["name"].Data;
                CDesc = Summon["cDesc"].Data;
                变色    = CDesc.Contains("变色");
                var skillInfo = raw_data["skill"].Data.Replace(";", "#r");

                HaveSpecialSkill = !skillInfo.Contains("未觉醒");
                var skillRaw = HttpUtil.GetAllElements(skillInfo, "技能", "#r");

                if (skillInfo.Contains("技能修炼"))
                {
                    修炼 = true;
                    var tmp = HttpUtil.GetElement(skillInfo, "修炼(", ")");
                    修炼参数1 = HttpUtil.GetElementLeft(tmp, "/");
                    修炼参数2 = tmp.Substring(修炼参数1.Length + 1);
                }
                if (skillInfo.Contains("神兽技能格"))
                {
                    神兽 = true;
                }
                Skills = new List <Skill>();
                foreach (var skill in skillRaw)
                {
                    var thisSkill = new Skill(skill);
                    if (thisSkill.Valid)
                    {
                        Skills.Add(thisSkill);
                    }
                }
                if (CDesc.Contains("饰品"))
                {
                    饰品品质 = HttpUtil.GetElement(CDesc, "品质:", "#");
                }
                else
                {
                    饰品品质 = "-1";
                }
                foreach (var rankRule in InvalidRankRule)
                {
                    if (Rank.Contains(rankRule.Key))
                    {
                        return;
                    }
                }
                if (InvalidNameRule.ContainsKey(Name))
                {
                    return;
                }
                foreach (var cDesRule in InvalidcDesRule)
                {
                    if (CDesc.Contains(cDesRule.Key))
                    {
                        return;
                    }
                }
                valid = true;
            }