Ejemplo n.º 1
0
        void AddCardToTable(object sender, EventArgs e)
        {
            var button = (Button)sender;
            var card   = (Card)((Button)sender).Tag;

            if (Player1.Atacker && Player1.CanAtack(card, Table))
            {
                MoveCardToControl(button, AtackCardsOnTable);
                AccessChangesForButtons(true, true, true);
            }
            else if (Player1.Deffender && Player1.CanDeffend(card, Table.AtackCards.Count - 1, Coloda.Kozir, Table))
            {
                MoveCardToControl(button, DeffendCardsOnTable);
                AccessChangesForButtons(true, false, true);
            }
            else if (Player2.Deffender && Player2.CanDeffend(card, Table.AtackCards.Count - 1, Coloda.Kozir, Table))
            {
                MoveCardToControl(button, DeffendCardsOnTable);
                AccessChangesForButtons(true, false, true);
            }
            else if (Player2.Atacker && Player2.CanAtack(card, Table))
            {
                MoveCardToControl(button, AtackCardsOnTable);
                AccessChangesForButtons(true, true, true);
            }
        }