Exemple #1
0
    public void Set(BladeAndSoulGossipCards.Suit suit)
    {
        List <string> propertys = new List <string>();

        propertys.Add(string.Format("{0} : {1}", "最大合成 ", _Max(suit.Cards)));
        foreach (var v in suit.Values)
        {
            var description = v.Id.GetEnumDescription();
            var value       = v.Value;
            propertys.Add(string.Format("{0} : {1}", description, value));
        }


        List <string> cards = new List <string>();;

        foreach (var card in suit.Cards)
        {
            cards.Add(string.Format("{0} : {1}", card.No, card.ToDescription()));
        }


        PropertyDescription.text = string.Join("\n", propertys.ToArray());
        CardDescription.text     = string.Join("\n", cards.ToArray());
    }
        private static List <Suit> _SingThread(PropertyValue[] filterPropertys, int outAmount, Property[] propertys, Card[] cards1, Card[] cards2, Card[] cards3, Card[] cards4, Card[] cards5, Card[] cards6, Card[] cards7, Card[] cards8, System.Int64 total)
        {
            int count = 0;

            Regulus.Utility.TimeCounter timeCounter = new Regulus.Utility.TimeCounter();

            List <Suit> suits = new List <Suit>();


            foreach (var card1 in cards1)
            {
                foreach (var card2 in cards2)
                {
                    foreach (var card3 in cards3)
                    {
                        foreach (var card4 in cards4)
                        {
                            foreach (var card5 in cards5)
                            {
                                foreach (var card6 in cards6)
                                {
                                    foreach (var card7 in cards7)
                                    {
                                        foreach (var card8 in cards8)
                                        {
                                            if (timeCounter.Second > 1)
                                            {
                                                var orders = suits.OrderBy((suit) => suit.GetValue(propertys[0]));
                                                foreach (var property in propertys.Skip(1))
                                                {
                                                    orders = orders.ThenBy((suit) => suit.GetValue(property));
                                                }

                                                suits = orders.ToList();

                                                if (suits.Count > outAmount)
                                                {
                                                    suits.RemoveRange(0, suits.Count - outAmount);
                                                }

                                                System.Console.WriteLine(string.Format("{0}/{1}...{2}", count, total, suits.Count));

                                                timeCounter.Reset();
                                            }

                                            var s = new Suit(card1, card2, card3, card4, card5, card6, card7, card8);

                                            bool pass = (from filter in filterPropertys
                                                         where s.GetValue(filter) < filter.Value
                                                         select false).Count() == 0;

                                            if (pass)
                                            {
                                                suits.Add(s);
                                            }
                                            count++;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            var result = suits.OrderByDescending((suit) => suit.GetValue(propertys[0]));

            foreach (var property in propertys.Skip(1))
            {
                result = result.ThenByDescending((suit) => suit.GetValue(property));
            }

            suits = result.ToList();
            return(suits);
        }