Modification to have the skillSlots seen has as a Map<Integer,ClassSkill> rather than a List<ClassSkill>

This commit is contained in:
Ka0rX 2023-03-19 13:42:21 +01:00
parent 2ec66e92ef
commit 7538b66673
3 changed files with 11 additions and 3 deletions

View File

@ -220,6 +220,14 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
return new HashMap(skillTreePoints);
}
@Override
public Map<Integer, ClassSkill> mapBoundSkills() {
Map<Integer,ClassSkill> result= new HashMap<>();
for(int slot:boundSkills.keySet())
result.put(slot,boundSkills.get(slot).getClassSkill());
return result;
}
public void clearSkillTreePoints() {
skillTreePoints.clear();
}

View File

@ -43,7 +43,7 @@ public interface ClassDataContainer {
Map<String, Integer> mapSkillTreePoints();
List<ClassSkill> getBoundSkills();
Map<Integer,ClassSkill> mapBoundSkills();
Map<SkillTreeNode, Integer> getNodeLevels();

View File

@ -128,8 +128,8 @@ public class DefaultPlayerData implements ClassDataContainer {
}
@Override
public List<ClassSkill> getBoundSkills() {
return new ArrayList<>();
public Map<Integer,ClassSkill> mapBoundSkills() {
return new HashMap<>();
}
public void apply(PlayerData player) {