From 413b2a0e020075e7caab31a9730ba5d16634bdb1 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Sat, 27 Apr 2019 00:50:32 -0700 Subject: [PATCH] Removed Poolable dependency to be added again in the future if necessary --- core/src/com/riiablo/item/PropertyList.java | 1 - core/src/com/riiablo/item/Stat.java | 26 ++++++--------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/core/src/com/riiablo/item/PropertyList.java b/core/src/com/riiablo/item/PropertyList.java index e1b2bca5..69f8c605 100644 --- a/core/src/com/riiablo/item/PropertyList.java +++ b/core/src/com/riiablo/item/PropertyList.java @@ -50,7 +50,6 @@ public class PropertyList implements Iterable { } public void clear() { - for (Stat stat : props.values()) Stat.free(stat); props.clear(); } diff --git a/core/src/com/riiablo/item/Stat.java b/core/src/com/riiablo/item/Stat.java index cdeb40fd..53a89610 100644 --- a/core/src/com/riiablo/item/Stat.java +++ b/core/src/com/riiablo/item/Stat.java @@ -3,9 +3,6 @@ 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; import com.riiablo.CharacterClass; import com.riiablo.Riiablo; @@ -18,7 +15,7 @@ import com.riiablo.codec.util.BitStream; import java.util.Arrays; @SuppressWarnings("unused") -public class Stat implements Comparable, Pool.Poolable { +public class Stat implements Comparable { private static final String TAG = "Stat"; public static final int strength = 0; @@ -458,10 +455,12 @@ public class Stat implements Comparable, Pool.Poolable { } } - private static final Pool POOL = Pools.get(Stat.class, 256); + static Stat obtain() { + return new Stat(); // POOL.obtain(); + } static Stat obtain(int stat, BitStream bitStream) { - return POOL.obtain()._obtain(stat, bitStream); + return obtain()._obtain(stat, bitStream); } static Stat obtain(int stat, int value) { @@ -469,19 +468,11 @@ public class Stat implements Comparable, Pool.Poolable { } static Stat obtain(int stat, int param, int value) { - return POOL.obtain()._obtain(stat, param, value); + return obtain()._obtain(stat, param, value); } static Stat obtain(Stat src) { - return POOL.obtain()._obtain(src); - } - - static void free(Stat stat) { - POOL.free(stat); - } - - static void freeAll(Array stats) { - POOL.freeAll(stats); + return obtain()._obtain(src); } public int id; @@ -493,9 +484,6 @@ public class Stat implements Comparable, Pool.Poolable { Stat() {} - @Override - public void reset() {} - Stat _obtain(int stat, BitStream bitStream) { this.id = stat; entry = Riiablo.files.ItemStatCost.get(stat);