From ff24b9f516195ff7e0875ef3401ec1ac25578098 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Thu, 10 Sep 2020 16:45:00 -0700 Subject: [PATCH] Created Attributes#getCopy(short) to return a (temp) copy of the specified stat --- core/src/com/riiablo/attributes/Attributes.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/com/riiablo/attributes/Attributes.java b/core/src/com/riiablo/attributes/Attributes.java index 8a6dc4ec..0245479e 100644 --- a/core/src/com/riiablo/attributes/Attributes.java +++ b/core/src/com/riiablo/attributes/Attributes.java @@ -228,6 +228,11 @@ public final class Attributes implements Iterable { return agg.get(stat); } + public StatRef getCopy(final short stat) { + final StatRef ref = agg.get(stat); + return ref != null ? ref.copy() : null; + } + public StatRef set(final short stat, final short srcStat) { return agg.set(stat, srcStat); }