Beispiel #1
0
        //Find the worst and best result from a list of board results
        public static HearthstoneBoard[] findWorstAndBest(List <HearthstoneBoard> boards)
        {
            HearthstoneBoard best  = boards[0];
            HearthstoneBoard worst = boards[0];

            foreach (HearthstoneBoard b in boards)
            {
                if (b.getFinalizedDamage() > best.getFinalizedDamage())
                {
                    best = b;
                }
                if (b.getFinalizedDamage() < worst.getFinalizedDamage())
                {
                    worst = b;
                }
            }
            return(new HearthstoneBoard[] { best, worst });
        }