예제 #1
0
        public static bool CanAttackerBeDealtLeathalDamage(AttackerEvaluationParameters p)
        {
            var attackerEvaluation = new AttackerEvaluation(p);
            var results            = attackerEvaluation.Evaluate();

            return(results.ReceivesLeathalDamage);
        }
예제 #2
0
        public static Card GetBlockerThatDealsLeathalDamageToAttacker(Card attacker, IEnumerable <Card> blockers)
        {
            var p = new AttackerEvaluationParameters(attacker, blockers);

            var performance = new AttackerEvaluation(p);
            var results     = performance.Evaluate();

            return(results.LeathalBlocker);
        }
예제 #3
0
        public static int GetAmountOfDamageThatNeedsToBePreventedToSafeAttackerFromDying(Card attacker,
                                                                                         IEnumerable <Card> blockers)
        {
            var p       = new AttackerEvaluationParameters(attacker, blockers);
            var results = new AttackerEvaluation(p).Evaluate();

            if (!results.ReceivesLeathalDamage)
            {
                return(0);
            }

            if (results.DeathTouchDamage > 0)
            {
                return(results.DeathTouchDamage);
            }

            var prevented = results.TotalDamage - attacker.Life + 1;

            return(prevented);
        }
예제 #4
0
        public static int GetAmountOfDamageThatWillBeDealtToAttacker(AttackerEvaluationParameters p)
        {
            var results = new AttackerEvaluation(p).Evaluate();

            return(results.TotalDamage);
        }
예제 #5
0
        public static Card GetBlockerThatDealsLeathalDamageToAttacker(Card attacker, IEnumerable<Card> blockers)
        {
            var p = new AttackerEvaluationParameters(attacker, blockers);

              var performance = new AttackerEvaluation(p);
              var results = performance.Evaluate();

              return results.LeathalBlocker;
        }
예제 #6
0
 public static int GetAmountOfDamageThatWillBeDealtToAttacker(AttackerEvaluationParameters p)
 {
     var results = new AttackerEvaluation(p).Evaluate();
       return results.TotalDamage;
 }
예제 #7
0
        public static int GetAmountOfDamageThatNeedsToBePreventedToSafeAttackerFromDying(Card attacker,
      IEnumerable<Card> blockers)
        {
            var p = new AttackerEvaluationParameters(attacker, blockers);
              var results = new AttackerEvaluation(p).Evaluate();

              if (!results.ReceivesLeathalDamage)
            return 0;

              if (results.DeathTouchDamage > 0)
            return results.DeathTouchDamage;

              var prevented = results.TotalDamage - attacker.Life + 1;
              return prevented;
        }
예제 #8
0
 public static bool CanAttackerBeDealtLeathalDamage(AttackerEvaluationParameters p)
 {
     var attackerEvaluation = new AttackerEvaluation(p);
       var results = attackerEvaluation.Evaluate();
       return results.ReceivesLeathalDamage;
 }