From 8b06f92f54e25336ab44121d173f382ab0e078b1 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Thu, 3 Sep 2020 18:53:13 -0700 Subject: [PATCH] Added getter and checker for stat ids --- core/src/com/riiablo/attributes/StatListBuilder.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/com/riiablo/attributes/StatListBuilder.java b/core/src/com/riiablo/attributes/StatListBuilder.java index e9cc3f42..faf69bb1 100644 --- a/core/src/com/riiablo/attributes/StatListBuilder.java +++ b/core/src/com/riiablo/attributes/StatListBuilder.java @@ -32,6 +32,18 @@ public final class StatListBuilder { return stats.get(list); } + /** @see StatList#indexOf(int, short) */ + public StatGetter get(short stat) { + index = stats.indexOf(list, stat); + if (index < 0) return null; + return tuple.update(index); + } + + /** @see StatList#contains(int, short) */ + public boolean contains(short stat) { + return stats.contains(list, stat); + } + /** @see StatList#get(int) */ public StatGetter last() { if (index < 0) throw new IllegalStateException("cannot retrieve last stat when no stats have been added yet!");