(final DeckBase clone)
| 241 | * @see forge.deck.DeckBase#cloneFieldsTo(forge.deck.DeckBase) |
| 242 | */ |
| 243 | @Override |
| 244 | protected void cloneFieldsTo(final DeckBase clone) { |
| 245 | super.cloneFieldsTo(clone); |
| 246 | final Deck result = (Deck) clone; |
| 247 | loadDeferredSections(); |
| 248 | // parts shouldn't be null |
| 249 | if (parts != null) { |
| 250 | for (Entry<DeckSection, CardPool> kv : parts.entrySet()) { |
| 251 | CardPool cp = new CardPool(); |
| 252 | result.parts.put(kv.getKey(), cp); |
| 253 | cp.addAll(kv.getValue()); |
| 254 | } |
| 255 | } |
| 256 | result.setAiHints(StringUtils.join(aiHints, " | ")); |
| 257 | result.setDraftNotes(draftNotes); |
| 258 | result.setDeckFormat(deckFormat); |
| 259 | result.setSourceUrl(sourceUrl); |
| 260 | //noinspection ConstantValue |
| 261 | if(tags != null) //Can happen deserializing old Decks. |
| 262 | result.tags.addAll(this.tags); |
| 263 | if(keyCards != null) |
| 264 | result.keyCards.addAll(this.keyCards); |
| 265 | } |
| 266 | |
| 267 | /* |
| 268 | * (non-Javadoc) |
no test coverage detected