(Combat combat)
| 214 | } |
| 215 | |
| 216 | void updateCombat(Combat combat) { |
| 217 | if (combat == null) { |
| 218 | set(TrackableProperty.CombatView, null); |
| 219 | return; |
| 220 | } |
| 221 | |
| 222 | final CombatView combatView = new CombatView(combat.getAttackingPlayer().getGame().getTracker()); |
| 223 | for (final AttackingBand b : combat.getAttackingBands()) { |
| 224 | if (b == null) continue; |
| 225 | final GameEntity defender = combat.getDefenderByAttacker(b); |
| 226 | final List<Card> blockers = combat.getBlockers(b); |
| 227 | final boolean isBlocked = b.isBlocked() == Boolean.TRUE; |
| 228 | combatView.addAttackingBand( |
| 229 | CardView.getCollection(b.getAttackers()), |
| 230 | GameEntityView.get(defender), |
| 231 | isBlocked ? CardView.getCollection(blockers) : null, |
| 232 | CardView.getCollection(blockers)); |
| 233 | } |
| 234 | set(TrackableProperty.CombatView, combatView); |
| 235 | } |
| 236 | |
| 237 | //TODO: Find better ways to make this information available to all GUIs without using the Game class |
| 238 |
no test coverage detected