Exemple #1
0
        public Card getNextCard(PlayerState p, List <Card> hand)
        {
            Card cur = ult.playPrimary(p, hand);

            if (cur != null)
            {
                return(cur);
            }

            if (((p.getBoard().getName().Equals("WB1")) ||
                 (p.getBoard().getName().Equals("WB1")) &&
                 (p.getBoard().getCurrentWonderLevel() == 2)))
            {
                cur = ult.buildWonder(p, hand);
                if (cur != null)
                {
                    return(cur);
                }
            }


            cur = ult.playSecondary(p, hand);
            if (cur != null)
            {
                return(cur);
            }

            cur = ult.buildWonder(p, hand);
            if (cur != null)
            {
                return(cur);
            }

            return(ult.playAnyCard(p, hand));
        }
        public Card getNextCard(PlayerState p, List <Card> hand)
        {
            Card cur = ult.playPrimary(p, hand);

            if (cur != null)
            {
                return(cur);
            }

            //attempts to play wonder to increase science
            if ((p.getBoard().getName().Equals("WB3")) &&
                (p.getBoard().getCurrentWonderLevel() < 2) &&
                (ResourceManager.GetInstance().ValidateWonder(p)))
            {
                for (int i = 0; i < hand.Count; i++)
                {
                    if (hand[i].getType() != 6)
                    {
                        p.setWonderCards(hand[i]);
                        p.getBoard().incrementWonderLevel(p);
                        return(hand[i]);
                    }
                }
            }

            if ((p.getBoard().getName().Equals("WB4")) &&
                (p.getBoard().getCurrentWonderLevel() < 3) &&
                (ResourceManager.GetInstance().ValidateWonder(p)))
            {
                for (int i = 0; i < hand.Count; i++)
                {
                    if (hand[i].getType() != 6)
                    {
                        p.setWonderCards(hand[i]);
                        p.getBoard().incrementWonderLevel(p);
                        return(hand[i]);
                    }
                }
            }

            cur = ult.playSecondary(p, hand);
            if (cur != null)
            {
                return(cur);
            }

            cur = ult.buildWonder(p, hand);
            if (cur != null)
            {
                return(cur);
            }

            return(ult.playAnyCard(p, hand));
        }
        public Card getNextCard(PlayerState p, List <Card> hand)
        {
            PlayerState left  = ResourceManager.GetInstance().getGameState().getLeftPlayer(p);
            PlayerState right = ResourceManager.GetInstance().getGameState().getRightPlayer(p);
            int         age   = ResourceManager.GetInstance().getGameState().getAge();

            Card cur;

            //Checks to see if AI has enough MilitaryPower to win the
            //the battles at the end of the Age
            if ((left.getMilitaryPower() >= p.getMilitaryPower() - age) ||
                (right.getMilitaryPower() >= p.getMilitaryPower() - age))
            {
                cur = ult.playPrimary(p, hand);
                if (cur != null)
                {
                    return(cur);
                }
            }

            //attempts to play wonder to increase military
            if ((p.getBoard().getName().Equals("WB7")) &&
                (p.getBoard().getCurrentWonderLevel() < 2) &&
                (ResourceManager.GetInstance().ValidateWonder(p)))
            {
                for (int i = 0; i < hand.Count; i++)
                {
                    if (hand[i].getType() != 6)
                    {
                        p.setWonderCards(hand[i]);
                        p.getBoard().incrementWonderLevel(p);
                        return(hand[i]);
                    }
                }
            }

            if ((p.getBoard().getName().Equals("WB8")) &&
                (p.getBoard().getCurrentWonderLevel() < 2) &&
                (ResourceManager.GetInstance().ValidateWonder(p)))
            {
                for (int i = 0; i < hand.Count; i++)
                {
                    if (hand[i].getType() != 6)
                    {
                        p.setWonderCards(hand[i]);
                        p.getBoard().incrementWonderLevel(p);
                        return(hand[i]);
                    }
                }
            }

            cur = ult.playSecondary(p, hand);
            if (cur != null)
            {
                return(cur);
            }

            cur = ult.buildWonder(p, hand);
            if (cur != null)
            {
                return(cur);
            }

            return(ult.playAnyCard(p, hand));
        }