Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #11490 from deReeperJosh/skylandersportalandroid
Android: Skylanders Portal UI
- Loading branch information
Showing
22 changed files
with
1,299 additions
and
505 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 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 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 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
32 changes: 32 additions & 0 deletions
32
...roid/app/src/main/java/org/dolphinemu/dolphinemu/features/skylanders/SkylanderConfig.java
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,32 @@ | ||
| // 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); | ||
| } |
37 changes: 37 additions & 0 deletions
37
...roid/app/src/main/java/org/dolphinemu/dolphinemu/features/skylanders/model/Skylander.java
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,37 @@ | ||
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| package org.dolphinemu.dolphinemu.features.skylanders.model; | ||
|
|
||
| public class Skylander | ||
| { | ||
| private SkylanderPair mPair; | ||
| private String mName; | ||
|
|
||
| public final static Skylander BLANK_SKYLANDER = new Skylander(-1, -1, "Blank"); | ||
|
|
||
| public Skylander(int id, int var, String name) | ||
| { | ||
| mPair = new SkylanderPair(id, var); | ||
| mName = name; | ||
| } | ||
|
|
||
| public String getName() | ||
| { | ||
| return mName; | ||
| } | ||
|
|
||
| public void setName(String name) | ||
| { | ||
| this.mName = name; | ||
| } | ||
|
|
||
| public int getId() | ||
| { | ||
| return mPair.getId(); | ||
| } | ||
|
|
||
| public int getVar() | ||
| { | ||
| return mPair.getVar(); | ||
| } | ||
| } |
54 changes: 54 additions & 0 deletions
54
.../app/src/main/java/org/dolphinemu/dolphinemu/features/skylanders/model/SkylanderPair.java
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,54 @@ | ||
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| package org.dolphinemu.dolphinemu.features.skylanders.model; | ||
|
|
||
| import androidx.annotation.Nullable; | ||
|
|
||
| public class SkylanderPair | ||
| { | ||
| private int mId; | ||
| private int mVar; | ||
|
|
||
| public SkylanderPair(int id, int var) | ||
| { | ||
| mId = id; | ||
| mVar = var; | ||
| } | ||
|
|
||
| public int getId() | ||
| { | ||
| return mId; | ||
| } | ||
|
|
||
| public void setId(int mId) | ||
| { | ||
| this.mId = mId; | ||
| } | ||
|
|
||
| public int getVar() | ||
| { | ||
| return mVar; | ||
| } | ||
|
|
||
| public void setVar(int mVar) | ||
| { | ||
| this.mVar = mVar; | ||
| } | ||
|
|
||
| @Override public int hashCode() | ||
| { | ||
| return (mId << 16) + mVar; | ||
| } | ||
|
|
||
| @Override public boolean equals(@Nullable Object obj) | ||
| { | ||
| if (!(obj instanceof SkylanderPair)) | ||
| return false; | ||
| SkylanderPair pairObj = (SkylanderPair) obj; | ||
| if (pairObj.getId() != mId) | ||
| return false; | ||
| if (pairObj.getVar() != mVar) | ||
| return false; | ||
| return true; | ||
| } | ||
| } |
Oops, something went wrong.