From 96eb258410c624303c5782464968ea458bf74a7c Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 26 Jan 2018 20:37:41 -0500 Subject: [PATCH] runelite-api: add Script --- .../main/java/net/runelite/api/Script.java | 32 +++++++++++++++ .../net/runelite/rs/api/RSCacheableNode.java | 2 +- .../java/net/runelite/rs/api/RSScript.java | 39 +++++++++++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 runelite-api/src/main/java/net/runelite/api/Script.java create mode 100644 runescape-api/src/main/java/net/runelite/rs/api/RSScript.java diff --git a/runelite-api/src/main/java/net/runelite/api/Script.java b/runelite-api/src/main/java/net/runelite/api/Script.java new file mode 100644 index 0000000000..eefe0dd08a --- /dev/null +++ b/runelite-api/src/main/java/net/runelite/api/Script.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018 Abex + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.api; + +public interface Script extends Node +{ + int[] getIntOperands(); + + int[] getInstructions(); +} diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSCacheableNode.java b/runescape-api/src/main/java/net/runelite/rs/api/RSCacheableNode.java index 53882ccb73..2b9f3a7030 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSCacheableNode.java +++ b/runescape-api/src/main/java/net/runelite/rs/api/RSCacheableNode.java @@ -26,7 +26,7 @@ package net.runelite.rs.api; import net.runelite.mapping.Import; -public interface RSCacheableNode +public interface RSCacheableNode extends RSNode { @Import("next") RSCacheableNode getNext(); diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSScript.java b/runescape-api/src/main/java/net/runelite/rs/api/RSScript.java new file mode 100644 index 0000000000..5bf9a0d094 --- /dev/null +++ b/runescape-api/src/main/java/net/runelite/rs/api/RSScript.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2018 Abex + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.rs.api; + +import net.runelite.api.Script; +import net.runelite.mapping.Import; + +public interface RSScript extends Script, RSCacheableNode +{ + @Import("intOperands") + @Override + int[] getIntOperands(); + + @Import("instructions") + @Override + int[] getInstructions(); +}