mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-01-19 16:57:20 +07:00
Clearing property list will now free all stat objects
This commit is contained in:
parent
069add223d
commit
e3c07e0934
@ -50,6 +50,7 @@ public class PropertyList implements Iterable<Stat> {
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
for (Stat stat : props.values()) Stat.free(stat);
|
||||
props.clear();
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.riiablo.item;
|
||||
import com.google.common.primitives.UnsignedInts;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.Pool;
|
||||
import com.badlogic.gdx.utils.Pools;
|
||||
import com.riiablo.CharData;
|
||||
@ -475,6 +476,14 @@ public class Stat implements Comparable<Stat>, Pool.Poolable {
|
||||
return POOL.obtain()._obtain(src);
|
||||
}
|
||||
|
||||
static void free(Stat stat) {
|
||||
POOL.free(stat);
|
||||
}
|
||||
|
||||
static void freeAll(Array<Stat> stats) {
|
||||
POOL.freeAll(stats);
|
||||
}
|
||||
|
||||
public int id;
|
||||
public int param;
|
||||
public ItemStatCost.Entry entry;
|
||||
|
Loading…
Reference in New Issue
Block a user