From 9f5303ba745c72e868124d94743ac8fe5f41aecb Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Sun, 8 Aug 2021 19:31:34 +0200 Subject: [PATCH] feat: added copy constructor to stat --- .../teamname/marvelous/gamelibrary/entities/Stat.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/entities/Stat.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/entities/Stat.java index 64f399d..09c5769 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/entities/Stat.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/entities/Stat.java @@ -36,6 +36,15 @@ public class Stat { this.value = value; } + /** + * Constructs a new {@link Stat} with the same values as the + * given {@link Stat} + * @param toCopy is the {@link Stat} to copy + */ + public Stat(Stat toCopy) { + this(toCopy.type, toCopy.value, toCopy.max); + } + public int getValue() { return value; }