//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); } } } } }
//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); } } } }
// Show the move buttons 86-89 private void showMoveButtons() { for (int i = 0; i < 3; i++) { Button b = (Button)playBoard.Children[86 + i]; b.Visibility = Visibility.Visible; } //ok lets see if player even has a board with special features if (player.getBoard().getName().Equals("WB9")) { WB9 b = (WB9)player.getBoard(); if (b.getCurrentWonderLevel() >= 2 && b.getFreeBuild()) { this.showSpecialMoveButton();//show it so the player can play a card for free. } } }
public void handleSpecialCase() { if (player.getBoard().getName().Equals("WB11")) { WB11 b = (WB11)player.getBoard(); if (b.getCurrentWonderLevel() == 2 && b.getFreeBuild()) { DiscardsWindow window = new DiscardsWindow(player, parent); window.Show(); b.setFreeBuild();//put back to false } } if (player.getBoard().getName().Equals("WB12")) { WB12 b = (WB12)player.getBoard(); if (b.getFreeBuild() == true && game.getDiscards().Count > 0) { b.setFreeBuild(false); DiscardsWindow window = new DiscardsWindow(player, parent); window.Show(); /*if (b.getCurrentWonderLevel() == 1) * { * * b.setFreeBuild();//put back to false * } * if (b.getCurrentWonderLevel() == 2) * { * DiscardsWindow window = new DiscardsWindow(player, parent); * window.Show(); * } * if (b.getCurrentWonderLevel() == 3) * { * DiscardsWindow window = new DiscardsWindow(player, parent); * window.Show(); * }*/ } } if (player.getBoard().getName().Equals("WB4")) { WB4 b = (WB4)player.getBoard(); Console.WriteLine("Current Wonder Level " + b.getCurrentWonderLevel() + " doubleCard: " + b.getDoubleCard() + " how many cards: " + player.getHand().Count); if (b.getCurrentWonderLevel() >= 2 && player.getHand().Count == 1)//on their last card { Console.WriteLine("Ok inside extra card " + " player name " + player.getName() + " how many cards: " + player.getHand().Count); PlayExtraCardWindow window = new PlayExtraCardWindow(player, parent, this, player.getHand()[0]); window.Show(); b.setDoubleCard();//put back to false } } if (player.getBoard().getName().Equals("WB9")) { WB9 b = (WB9)player.getBoard(); if (b.getCurrentWonderLevel() >= 2 && b.getFreeBuild()) { this.showSpecialMoveButton();//show it so the player can play a card for free. } } }