Sets the PCClassLevel object associated with the given PCClass for the Player Character represented by the given CharID. Returns true if the set is successful. The set will be successful if the given PCClass is possessed by the given PlayerCharacter; false otherwise. The (numeric) class level for w
(CharID id, PCClass pcc, PCClassLevel pcl)
| 91 | * if the class level cannot be thrown |
| 92 | */ |
| 93 | public boolean setClassLevel(CharID id, PCClass pcc, PCClassLevel pcl) throws CloneNotSupportedException |
| 94 | { |
| 95 | Objects.requireNonNull(pcc, "Class cannot be null in setClassLevel"); |
| 96 | Objects.requireNonNull(pcl, "Class Level cannot be null in setClassLevel"); |
| 97 | ClassInfo info = getClassInfo(id); |
| 98 | if (info == null) |
| 99 | { |
| 100 | return false; |
| 101 | } |
| 102 | PCClassLevel old = info.getClassLevel(pcc, pcl.get(IntegerKey.LEVEL)); |
| 103 | boolean returnVal = info.setClassLevel(pcc, pcl); |
| 104 | support.fireClassLevelObjectChangeEvent(id, pcc, old, pcl); |
| 105 | return returnVal; |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * Returns the PCClassLevel object associated with the Player Character |