Implemented structured logging into gem props

This commit is contained in:
Collin Smith 2020-08-19 22:23:24 -07:00
parent e0da8aaa02
commit 320ea8d28f

View File

@ -5,6 +5,7 @@ import com.badlogic.gdx.utils.GdxRuntimeException;
import com.riiablo.Riiablo;
import com.riiablo.codec.excel.Gems;
import com.riiablo.codec.excel.ItemEntry;
import com.riiablo.log.Log;
public class ItemUtils {
private ItemUtils() {}
@ -29,9 +30,16 @@ public class ItemUtils {
// TODO: basic optimization to have a pre-prepared immutable prop list for each gem type
static PropertyList[] getGemProps(Gems.Entry gem) {
PropertyList[] props = new PropertyList[Item.NUM_GEMPROPS];
props[Item.GEMPROPS_WEAPON] = PropertyList.obtain().add(gem.weaponModCode, gem.weaponModParam, gem.weaponModMin, gem.weaponModMax);
props[Item.GEMPROPS_ARMOR ] = PropertyList.obtain().add(gem.helmModCode, gem.helmModParam, gem.helmModMin, gem.helmModMax);
props[Item.GEMPROPS_SHIELD] = PropertyList.obtain().add(gem.shieldModCode, gem.shieldModParam, gem.shieldModMin, gem.shieldModMax);
try {
Log.put("propList", "GEMPROPS_WEAPON");
props[Item.GEMPROPS_WEAPON] = PropertyList.obtain().add(gem.weaponModCode, gem.weaponModParam, gem.weaponModMin, gem.weaponModMax);
Log.put("propList", "GEMPROPS_ARMOR");
props[Item.GEMPROPS_ARMOR] = PropertyList.obtain().add(gem.helmModCode, gem.helmModParam, gem.helmModMin, gem.helmModMax);
Log.put("propList", "GEMPROPS_SHIELD");
props[Item.GEMPROPS_SHIELD] = PropertyList.obtain().add(gem.shieldModCode, gem.shieldModParam, gem.shieldModMin, gem.shieldModMax);
} finally {
Log.remove("propList");
}
return props;
}
}