()
| 657 | } |
| 658 | |
| 659 | @Override |
| 660 | public PCClass clone() |
| 661 | { |
| 662 | PCClass aClass = null; |
| 663 | |
| 664 | try |
| 665 | { |
| 666 | aClass = (PCClass) super.clone(); |
| 667 | |
| 668 | List<KnownSpellIdentifier> ksl = getListFor(ListKey.KNOWN_SPELLS); |
| 669 | if (ksl != null) |
| 670 | { |
| 671 | aClass.removeListFor(ListKey.KNOWN_SPELLS); |
| 672 | for (KnownSpellIdentifier ksi : ksl) |
| 673 | { |
| 674 | aClass.addToListFor(ListKey.KNOWN_SPELLS, ksi); |
| 675 | } |
| 676 | } |
| 677 | Map<AttackType, Integer> acmap = getMapFor(MapKey.ATTACK_CYCLE); |
| 678 | if (acmap != null && !acmap.isEmpty()) |
| 679 | { |
| 680 | aClass.removeMapFor(MapKey.ATTACK_CYCLE); |
| 681 | for (Map.Entry<AttackType, Integer> me : acmap.entrySet()) |
| 682 | { |
| 683 | aClass.addToMapFor(MapKey.ATTACK_CYCLE, me.getKey(), me.getValue()); |
| 684 | } |
| 685 | } |
| 686 | |
| 687 | aClass.levelMap = new TreeMap<>(); |
| 688 | for (Map.Entry<Integer, PCClassLevel> me : levelMap.entrySet()) |
| 689 | { |
| 690 | aClass.levelMap.put(me.getKey(), me.getValue().clone()); |
| 691 | } |
| 692 | } |
| 693 | catch (CloneNotSupportedException exc) |
| 694 | { |
| 695 | ShowMessageDelegate.showMessageDialog(exc.getMessage(), Constants.APPLICATION_NAME, MessageType.ERROR); |
| 696 | } |
| 697 | |
| 698 | return aClass; |
| 699 | } |
| 700 | |
| 701 | /* |
| 702 | * PCCLASSLEVELONLY Since this is really only something that will be done |
no test coverage detected