Simplify Monster skills with Set instead of List

Doable now with MobSkillId records
This commit is contained in:
P0nk
2022-09-03 13:30:44 +02:00
parent c47ca4d6a4
commit 7cdaabf6f8
5 changed files with 37 additions and 53 deletions

View File

@@ -41,7 +41,7 @@ public class MonsterStats {
public Map<Element, ElementalEffectiveness> resistance = new HashMap<>();
public List<Integer> revives = Collections.emptyList();
public byte tagColor, tagBgColor;
public List<MobSkillId> skills = new ArrayList<>();
public Set<MobSkillId> skills = new HashSet<>();
public Pair<Integer, Integer> cool = null;
public BanishInfo banish = null;
public List<loseItem> loseItem = null;
@@ -190,17 +190,12 @@ public class MonsterStats {
this.tagBgColor = (byte) tagBgColor;
}
public void setSkills(List<MobSkillId> skills) {
for (int i = this.skills.size(); i < skills.size(); i++) {
this.skills.add(null);
}
for (int i = 0; i < skills.size(); i++) {
this.skills.set(i, skills.get(i));
}
public void setSkills(Set<MobSkillId> skills) {
this.skills = skills;
}
public List<MobSkillId> getSkills() {
return Collections.unmodifiableList(this.skills);
public Set<MobSkillId> getSkills() {
return Collections.unmodifiableSet(this.skills);
}
public int getNoSkills() {