From f0cb9d40e2d959a0d3724e22eab34c9788e93118 Mon Sep 17 00:00:00 2001 From: Graham Date: Mon, 29 Jul 2019 14:10:01 +0100 Subject: [PATCH] Add constructor for cloning a Library --- asm/src/main/java/dev/openrs2/asm/Library.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/asm/src/main/java/dev/openrs2/asm/Library.java b/asm/src/main/java/dev/openrs2/asm/Library.java index b957f923..b6bde2d2 100644 --- a/asm/src/main/java/dev/openrs2/asm/Library.java +++ b/asm/src/main/java/dev/openrs2/asm/Library.java @@ -70,6 +70,14 @@ public final class Library implements Iterable { /* empty */ } + public Library(Library library) { + for (var clazz : library.classes.values()) { + var copy = new ClassNode(); + clazz.accept(copy); + add(copy); + } + } + public boolean contains(String name) { return classes.containsKey(name); }