Exemple #1
0
 public static void Place_cards(List <Card> all, ref bool P1play, Card current_card, List <Card> AI_cards, Image pile_img, List <Card> players_cards, StackPanel AI_deck)
 {
     if (players_cards.Count() > 4)
     {
         foreach (Card card in AI_cards)
         {
             GameRules.AI_try_place_cards(all, card, current_card, pile_img, AI_deck, ref P1play);
             if (P1play == true)
             {
                 break;
             }
         }
     }
 }
Exemple #2
0
        private void Place_card_Click(object sender, RoutedEventArgs e)  // places card if possible
        {
            //  Animation.ShowAnimation(general);
            Button b = (Button)sender;

            if (player1turn == true)
            {
                dynamic item = b.DataContext;
                Card    crd  = item;
                GameRules.Try_place_cards(UnoCards, crd, current, general, b, deck);
                player1turn = false;
                while (player1turn == false)
                {
                    Opponent_place.Place_cards(UnoCards, ref player1turn, current, Opponent_cards, general, player1, op_deck);
                    player1turn = true;
                }
            }
        }