()
| 126 | } |
| 127 | |
| 128 | @Override |
| 129 | public String toString() { |
| 130 | StringBuilder sb = new StringBuilder(); |
| 131 | for (GameEntity defender : attackableEntries.get()) { |
| 132 | CardCollection attackers = getAttackersOf(defender); |
| 133 | if (attackers.isEmpty()) { |
| 134 | continue; |
| 135 | } |
| 136 | sb.append(defender); |
| 137 | sb.append(" is being attacked by:\n"); |
| 138 | for (Card attacker : attackers) { |
| 139 | sb.append(" ").append(attacker).append("\n"); |
| 140 | for (Card blocker : getBlockers(attacker)) { |
| 141 | sb.append(" ... blocked by: ").append(blocker).append("\n"); |
| 142 | } |
| 143 | } |
| 144 | } |
| 145 | if (sb.length() == 0) { |
| 146 | return "<no attacks>"; |
| 147 | } |
| 148 | return sb.toString(); |
| 149 | } |
| 150 | |
| 151 | public void endCombat() { |
| 152 | //backup attackers and blockers |
no test coverage detected