Added getter and checker for stat ids

This commit is contained in:
Collin Smith 2020-09-03 18:53:13 -07:00
parent fa7e066ee1
commit 8b06f92f54

View File

@ -32,6 +32,18 @@ public final class StatListBuilder {
return stats.get(list);
}
/** @see StatList#indexOf(int, short) */
public StatGetter get(short stat) {
index = stats.indexOf(list, stat);
if (index < 0) return null;
return tuple.update(index);
}
/** @see StatList#contains(int, short) */
public boolean contains(short stat) {
return stats.contains(list, stat);
}
/** @see StatList#get(int) */
public StatGetter last() {
if (index < 0) throw new IllegalStateException("cannot retrieve last stat when no stats have been added yet!");