From 948f1a189c185bb797b06a2d29f9574f6fbf1d67 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Thu, 3 Sep 2020 18:34:34 -0700 Subject: [PATCH] Added static getter Stat#index(String) to get stat id from String name --- core/src/com/riiablo/attributes/Stat.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/com/riiablo/attributes/Stat.java b/core/src/com/riiablo/attributes/Stat.java index c1ac51ca..d6e5a20f 100644 --- a/core/src/com/riiablo/attributes/Stat.java +++ b/core/src/com/riiablo/attributes/Stat.java @@ -391,6 +391,10 @@ public class Stat { return Riiablo.files.ItemStatCost.get(stat); } + static short index(String stat) { + return (short) Riiablo.files.ItemStatCost.index(stat); + } + static boolean hasParams(short stat) { final ItemStatCost.Entry entry = entry(stat); return entry.Encode >= 1 && entry.Encode <= 3; // TODO: determine if stat requires params