From bbc1951afbc3f6be875a1ab8fcccd246207a3740 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Wed, 1 Mar 2023 17:13:58 -0500 Subject: [PATCH] Android: Convert SkylanderConfig to Kotlin --- .../features/skylanders/SkylanderConfig.java | 32 ------------------- .../features/skylanders/SkylanderConfig.kt | 28 ++++++++++++++++ 2 files changed, 28 insertions(+), 32 deletions(-) delete mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/skylanders/SkylanderConfig.java create mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/skylanders/SkylanderConfig.kt diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/skylanders/SkylanderConfig.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/skylanders/SkylanderConfig.java deleted file mode 100644 index 285e017a8f..0000000000 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/skylanders/SkylanderConfig.java +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -package org.dolphinemu.dolphinemu.features.skylanders; - -import android.util.Pair; - -import org.dolphinemu.dolphinemu.features.skylanders.model.SkylanderPair; - -import java.util.Map; - -public class SkylanderConfig -{ - public static final Map LIST_SKYLANDERS; - public static final Map REVERSE_LIST_SKYLANDERS; - - static - { - LIST_SKYLANDERS = getSkylanderMap(); - REVERSE_LIST_SKYLANDERS = getInverseSkylanderMap(); - } - - public static native Map getSkylanderMap(); - - public static native Map getInverseSkylanderMap(); - - public static native boolean removeSkylander(int slot); - - public static native Pair loadSkylander(int slot, String fileName); - - public static native Pair createSkylander(int id, int var, String fileName, - int slot); -} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/skylanders/SkylanderConfig.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/skylanders/SkylanderConfig.kt new file mode 100644 index 0000000000..b8cf8a4759 --- /dev/null +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/skylanders/SkylanderConfig.kt @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +package org.dolphinemu.dolphinemu.features.skylanders + +import android.util.Pair +import org.dolphinemu.dolphinemu.features.skylanders.model.SkylanderPair + +object SkylanderConfig { + var LIST_SKYLANDERS: Map = getSkylanderMap() + var REVERSE_LIST_SKYLANDERS: Map = getInverseSkylanderMap() + + private external fun getSkylanderMap(): Map + private external fun getInverseSkylanderMap(): Map + + @JvmStatic + external fun removeSkylander(slot: Int): Boolean + + @JvmStatic + external fun loadSkylander(slot: Int, fileName: String?): Pair? + + @JvmStatic + external fun createSkylander( + id: Int, + variant: Int, + fileName: String, + slot: Int + ): Pair +}