Exemple #1
0
        public Form1()
        {
            //MouseInputManager.Click(514, 396);

            var cardsTest = new CardsTest();
            var cards     = cardsTest.GetNextPlayerCards(13);
            var parser    = new CardTypeParser();
            var result    = parser.Parse(cards);

            using (var fs = new FileStream("result.txt", FileMode.Truncate))
            {
                using (var sw = new StreamWriter(fs))
                {
                    var resultDisplay = "";
                    cards.ForEach(card => resultDisplay += card.ToString());
                    sw.WriteLine(resultDisplay);

                    CardTypeResult best = null;
                    result.ForEach(ctr =>
                    {
                        if (best == null)
                        {
                            best = ctr;
                        }
                        else
                        {
                            best = best.Compare(ctr) >= 0 ? best : ctr;
                        }
                    });

                    var tmp = "";

                    best.CardTypeHead.GetCards().ToList().ForEach(card => tmp += card.ToString());
                    tmp += "(" + best.CardTypeHead.GetCardEmType() + ")   ";

                    best.CardTypeMiddle.GetCards()
                    .ToList()
                    .ForEach(card => tmp += card.ToString());
                    tmp += "(" + best.CardTypeMiddle.GetCardEmType() + ")   ";

                    best.CardTypeTail.GetCards().ToList().ForEach(card => tmp += card.ToString());
                    tmp += "(" + best.CardTypeTail.GetCardEmType() + ")";

                    sw.WriteLine(tmp);
                }
            }

            InitializeComponent();
        }
Exemple #2
0
 public int Compare(CardTypeResult c)
 {
     return(CardTypeHead.Compare(c.CardTypeHead, EmRegionCompare.Head) +
            CardTypeMiddle.Compare(c.CardTypeMiddle, EmRegionCompare.Body) +
            CardTypeTail.Compare(c.CardTypeTail, EmRegionCompare.Tail));
 }