Exemplo n.º 1
0
        void Turn()
        {
            ICard card1 = user1.deck.GetRandomCard();
            ICard card2 = user2.deck.GetRandomCard();

            float card1EffectiveDamage = card1.CombatBehavior(card2);
            float card2EffectiveDamage = card2.CombatBehavior(card1);

            log.Add(String.Format("Round: {0}", round));

            if (card1EffectiveDamage > card2EffectiveDamage)
            {
                log.Add(String.Format("Player1: {0}({1}-->{2}) has won against Player2: {3}({4}-->{5})", card1.name, card1.damage, card1EffectiveDamage, card2.name, card2.damage, card2EffectiveDamage));
                user2.deck.RemoveCard();
                user1.deck.AddCard(card2);
                log.Add(String.Format("{0} has been transferred to Player 1\n", card2.name));
                return;
            }

            log.Add(String.Format("Player2: {0}({1}-->{2}) has won against Player1: {3}({4}-->{5})", card2.name, card2.damage, card2EffectiveDamage, card1.name, card1.damage, card1EffectiveDamage));
            user1.deck.RemoveCard();
            user2.deck.AddCard(card1);
            log.Add(String.Format("{0} has been transferred to Player 2\n", card1.name));
        }