Fleshing out constructor

This commit is contained in:
2024-02-18 12:35:55 -05:00
parent ac06e7723f
commit b0542a5bc3
+7
View File
@@ -24,6 +24,8 @@ public class ItemTemplate {
public String obj_name = "";
public Vector3fImmutable obj_scale = new Vector3fImmutable();
public int obj_render_object;
public float combat_health_current;
public float combat_health_full;
public HashMap<String, Float> combat_attack_resist = new HashMap<>();
public ItemTemplate(JSONObject jsonObject) {
@@ -42,6 +44,11 @@ public class ItemTemplate {
obj_render_object = ((Long) jsonObject.get("obj_render_object")).intValue();
// Reading float values
combat_health_current = ((Double) jsonObject.get("combat_health_current")).floatValue();
combat_health_full = ((Double) jsonObject.get("combat_health_full")).floatValue();
// Reading a hashmap of floats
JSONObject resist_json = (JSONObject) jsonObject.get("combat_attack_resist");