コード例 #1
0
//Mouse Click to handle the boards that allows free play of card
        private void specialMoveButton_Click(object sender, EventArgs e)
        {
            if (player.getPlayedACard() == false)
            {
                int numCards = player.getHand().Count;

                for (int i = 0; i < player.getHand().Count; i++)
                {
                    Card  c   = player.getHand()[i];
                    Image img = (Image)playBoard.Children[(56 + i)];

                    if (img.ActualHeight > 150)//this is the selected card
                    {
                        if (img.Source != new BitmapImage(new Uri(@"pack://*****:*****@"pack://application:,,,/Images/EmptyCard.png", UriKind.RelativeOrAbsolute));
                            PlayerGameBoard play = new PlayerGameBoard(parent, player, game);
                        }
                    }
                }
            }
        }
コード例 #2
0
//A handler for the specific case of wb 9 special
        private void setFreePlay()
        {
            foreach (PlayerState p in players)
            {
                if (p.getBoard().getName().Equals("WB9"))
                {
                    WB9 wb = (WB9)p.getBoard();
                    if (wb.getCurrentWonderLevel() >= 2)
                    {
                        wb.setFreeBuild(true);
                    }
                }
            }
        }