mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-15 18:27:57 +07:00
Created StatList#add(int,StatGetter) to add stats
This commit is contained in:
@ -263,6 +263,11 @@ public final class StatList {
|
|||||||
// max
|
// max
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int add(int list, StatGetter stat) {
|
||||||
|
final int index = indexOf(list, stat.id(), stat.param());
|
||||||
|
return add(index, stat.value());
|
||||||
|
}
|
||||||
|
|
||||||
public void addAll(int list, StatList src, int srcList) {
|
public void addAll(int list, StatList src, int srcList) {
|
||||||
assertMutable();
|
assertMutable();
|
||||||
final int srcStartOffset = src.startingOffset(srcList);
|
final int srcStartOffset = src.startingOffset(srcList);
|
||||||
|
@ -71,6 +71,10 @@ public final class StatListGetter implements Iterable<StatGetter> {
|
|||||||
return tuple.set(stats, index);
|
return tuple.set(stats, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void add(StatGetter stat) {
|
||||||
|
stats.add(list, stat);
|
||||||
|
}
|
||||||
|
|
||||||
public void addAll(StatListGetter src) {
|
public void addAll(StatListGetter src) {
|
||||||
stats.addAll(list, src.stats, src.list);
|
stats.addAll(list, src.stats, src.list);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user