Android: Convert SkylanderConfig to Kotlin
This commit is contained in:
parent
71e82d76b5
commit
bbc1951afb
|
@ -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<SkylanderPair, String> LIST_SKYLANDERS;
|
||||
public static final Map<String, SkylanderPair> REVERSE_LIST_SKYLANDERS;
|
||||
|
||||
static
|
||||
{
|
||||
LIST_SKYLANDERS = getSkylanderMap();
|
||||
REVERSE_LIST_SKYLANDERS = getInverseSkylanderMap();
|
||||
}
|
||||
|
||||
public static native Map<SkylanderPair, String> getSkylanderMap();
|
||||
|
||||
public static native Map<String, SkylanderPair> getInverseSkylanderMap();
|
||||
|
||||
public static native boolean removeSkylander(int slot);
|
||||
|
||||
public static native Pair<Integer, String> loadSkylander(int slot, String fileName);
|
||||
|
||||
public static native Pair<Integer, String> createSkylander(int id, int var, String fileName,
|
||||
int slot);
|
||||
}
|
|
@ -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<SkylanderPair, String> = getSkylanderMap()
|
||||
var REVERSE_LIST_SKYLANDERS: Map<String, SkylanderPair> = getInverseSkylanderMap()
|
||||
|
||||
private external fun getSkylanderMap(): Map<SkylanderPair, String>
|
||||
private external fun getInverseSkylanderMap(): Map<String, SkylanderPair>
|
||||
|
||||
@JvmStatic
|
||||
external fun removeSkylander(slot: Int): Boolean
|
||||
|
||||
@JvmStatic
|
||||
external fun loadSkylander(slot: Int, fileName: String?): Pair<Int?, String?>?
|
||||
|
||||
@JvmStatic
|
||||
external fun createSkylander(
|
||||
id: Int,
|
||||
variant: Int,
|
||||
fileName: String,
|
||||
slot: Int
|
||||
): Pair<Int, String>
|
||||
}
|
Loading…
Reference in New Issue