Changed GemAttributes to be a subclass of AggregatedAttributes

Gems require item_levelreq stat in their base and are more complex than originally thought
This commit is contained in:
Collin Smith
2020-09-05 18:29:31 -07:00
parent eb011ed471
commit 0bfa47bd83

View File

@ -1,12 +1,26 @@
package com.riiablo.attributes;
public class GemAttributes extends Attributes {
GemAttributes() {
super(StatList.obtain(StatListFlags.NUM_GEM_LISTS));
import com.riiablo.logger.LogManager;
import com.riiablo.logger.Logger;
public class GemAttributes extends AggregateAttributes {
private static final Logger log = LogManager.getLogger(GemAttributes.class);
int selected = -1;
public int selectedList() {
return selected;
}
@Override
public Attributes reset() {
throw new UnsupportedOperationException();
public void select(int selected) {
if (this.selected >= 0 && selected != this.selected) {
log.warn("this.selected(" + this.selected + ") already set");
}
this.selected = selected;
}
public StatListGetter selected() {
return list(selected);
}
}