Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge pull request #11616 from t895/kotlin-skylanders
Android: Convert Skylanders code to Kotlin
- Loading branch information
Showing
11 changed files
with
200 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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> | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| package org.dolphinemu.dolphinemu.features.skylanders.model | ||
|
|
||
| class Skylander(id: Int, variant: Int, var name: String) { | ||
| private val pair: SkylanderPair = SkylanderPair(id, variant) | ||
|
|
||
| val id: Int get() = pair.id | ||
| val variant: Int get() = pair.variant | ||
|
|
||
| companion object { | ||
| @JvmField | ||
| val BLANK_SKYLANDER = Skylander(-1, -1, "Blank") | ||
| } | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| package org.dolphinemu.dolphinemu.features.skylanders.model | ||
|
|
||
| class SkylanderPair(var id: Int, var variant: Int) { | ||
| override fun hashCode(): Int { | ||
| return (id shl 16) + variant | ||
| } | ||
|
|
||
| override fun equals(other: Any?): Boolean { | ||
| if (other !is SkylanderPair) return false | ||
| if (other.id != id) return false | ||
| return other.variant == variant | ||
| } | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| package org.dolphinemu.dolphinemu.features.skylanders.ui | ||
|
|
||
| class SkylanderSlot(var label: String, val slotNum: Int) { | ||
| var portalSlot: Int = -1 | ||
| } |
Oops, something went wrong.