(Card lki)
| 998 | } |
| 999 | |
| 1000 | public CombatLki saveLKI(Card lki) { |
| 1001 | if (!lki.isLKI()) { |
| 1002 | lki = CardCopyService.getLKICopy(lki); |
| 1003 | } |
| 1004 | FCollectionView<AttackingBand> attackersBlocked = null; |
| 1005 | final AttackingBand attackingBand = getBandOfAttacker(lki); |
| 1006 | final boolean isAttacker = attackingBand != null; |
| 1007 | if (isAttacker) { |
| 1008 | boolean found = false; |
| 1009 | for (AttackingBand ab : attackedByBands.get().values()) { |
| 1010 | if (ab.contains(lki)) { |
| 1011 | found = true; |
| 1012 | break; |
| 1013 | } |
| 1014 | } |
| 1015 | if (!found) { |
| 1016 | return null; |
| 1017 | } |
| 1018 | } else { |
| 1019 | attackersBlocked = getAttackingBandsBlockedBy(lki); |
| 1020 | if (attackersBlocked.isEmpty()) { |
| 1021 | return null; // card was not even in combat |
| 1022 | } |
| 1023 | } |
| 1024 | lkiCache.get().add(lki); |
| 1025 | final FCollectionView<AttackingBand> relatedBands = isAttacker ? new FCollection<>(attackingBand) : attackersBlocked; |
| 1026 | return new CombatLki(isAttacker, relatedBands); |
| 1027 | } |
| 1028 | } |
no test coverage detected