Previous commit should have removed need for scratch, since the ops are no longer multiplicative

This commit is contained in:
Collin Smith 2019-04-06 14:49:08 -07:00
parent 512b6eb55a
commit e5fa9025fa

View File

@ -7,7 +7,7 @@ import com.riiablo.Riiablo;
import com.riiablo.codec.excel.ItemStatCost; import com.riiablo.codec.excel.ItemStatCost;
public class Attributes { public class Attributes {
static final PropertyList scratch = new PropertyList(); //static final PropertyList scratch = new PropertyList();
final PropertyList base = new PropertyList(); final PropertyList base = new PropertyList();
final PropertyList agg = new PropertyList(); final PropertyList agg = new PropertyList();
final PropertyList rem = new PropertyList(); final PropertyList rem = new PropertyList();
@ -48,7 +48,7 @@ public class Attributes {
public void update(CharData charData) { public void update(CharData charData) {
// aggregates all property lists (necessary because otherwise operations are multiplicative) // aggregates all property lists (necessary because otherwise operations are multiplicative)
scratch.clear(); /*scratch.clear();
for (PropertyList list : propertyLists) { for (PropertyList list : propertyLists) {
if (list == null) continue; if (list == null) continue;
for (Stat stat : list) { for (Stat stat : list) {
@ -58,17 +58,21 @@ public class Attributes {
} }
update(charData, scratch); update(charData, scratch);
*/
for (PropertyList list : propertyLists) {
if (list != null) update(charData, list);
}
} }
private void update(CharData charData, PropertyList list) { private void update(CharData charData, PropertyList list) {
for (Stat stat : list) { for (Stat stat : list) {
if (stat.entry.op > 0) { if (stat.entry.op > 0) {
boolean empty = !op(charData, stat, stat.entry); boolean empty = !op(charData, stat, stat.entry);
if (empty) rem.add(stat); //.copy() if (empty) rem.add(stat.copy());
} else if (base.get(stat.hash) == null) { } else if (base.get(stat.hash) == null) {
rem.add(stat); //.copy() rem.add(stat.copy());
} else { } else {
agg.add(stat); //.copy() agg.add(stat.copy());
mod.set(stat.stat); mod.set(stat.stat);
} }
} }