Exemplo n.º 1
0
        public void CheckResourceCard(PlayerState p, Card c)
        {
            if (Log(p))
            {
                Console.WriteLine("\n--------------------------------------------------------------------------------------------------------");

                ResourceCard card      = (ResourceCard)c;
                int[]        resources = card.getResources();
                Console.WriteLine("[{0}] [Card.getResources ({1})] ", _class.GetType().Name, card.hasTradableResources());
                for (int index = 0; index < resources.Count(); index++)
                {
                    Console.Write("[{0} : {1}] ", ((Resource)index).ToString(), resources[index]);
                }
                Console.WriteLine();
                Console.WriteLine("--------------------------------------------------------------------------------------------------------\n");
            }
        }
Exemplo n.º 2
0
        /*
         * Input: A Player
         *
         * Output: void -> Given a player, This is the helper function to resetResources.
         * This looks through the list of played cards and adds special card values to a temporary
         * list of special resources.
         */
        public void resetSpecialResourceSingular(PlayerState p)
        {
            List <ResourceCard> tempList = new List <ResourceCard>();

            for (int i = 0; i < p.getPlayedCards().Count; i++)
            {
                if (p.getPlayedCards()[i].getType() < 3)
                {
                    ResourceCard c = (ResourceCard)p.getPlayedCards()[i];

                    if (((c.getNumber() > 7) && (c.getNumber() < 14)))
                    {
                        tempList.Add(c);
                    }
                }
            }
            if (p.getBoard().getName() == "WB2")
            {
                if (p.getBoard().getCurrentWonderLevel() > 0)
                {
                    if (p.getBoard().getCurrentWonderLevel() > 1)
                    {
                        wonderBoardExceptionManGood  = true;
                        wonderBoardExceptionResource = true;
                    }
                    else
                    {
                        for (int j = 0; j < 7; j++)
                        {
                            wonderBoardExceptionResource = true;
                        }
                    }
                }
            }
            if ((p.getBoard().getName() == "WB1") && (p.getBoard().getCurrentWonderLevel() > 1))
            {
                wonderBoardExceptionResource = true;
            }
            SResources[p.getName()] = tempList;
        }