summaryrefslogtreecommitdiff
path: root/Source/Android/app/src/main/java
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-03-01 13:35:43 -0500
committerCharles Lombardo <clombardo169@gmail.com>2023-03-01 13:35:43 -0500
commit1b61f2c22319ea2899bdd5f3212e30a88045bf0c (patch)
tree64dd5ba819fa18cf52156e0ce4f4570834f42854 /Source/Android/app/src/main/java
parentfbc617c917abbbe992eac7ed879f2bd710d2e7f6 (diff)
Android: Convert Cheat to Kotlin
Diffstat (limited to 'Source/Android/app/src/main/java')
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/Cheat.java53
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/Cheat.kt42
2 files changed, 42 insertions, 53 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/Cheat.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/Cheat.java
deleted file mode 100644
index 142931b9cb..0000000000
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/Cheat.java
+++ /dev/null
@@ -1,53 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-
-package org.dolphinemu.dolphinemu.features.cheats.model;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-
-public interface Cheat
-{
- int TRY_SET_FAIL_CODE_MIXED_ENCRYPTION = -3;
- int TRY_SET_FAIL_NO_CODE_LINES = -2;
- int TRY_SET_FAIL_NO_NAME = -1;
- int TRY_SET_SUCCESS = 0;
- // Result codes greater than 0 represent an error on the corresponding code line (one-indexed)
-
- boolean supportsCreator();
-
- boolean supportsNotes();
-
- boolean supportsCode();
-
- @NonNull
- String getName();
-
- @NonNull
- default String getCreator()
- {
- return "";
- }
-
- @NonNull
- default String getNotes()
- {
- return "";
- }
-
- @NonNull
- default String getCode()
- {
- return "";
- }
-
- int trySet(@NonNull String name, @NonNull String creator, @NonNull String notes,
- @NonNull String code);
-
- boolean getUserDefined();
-
- boolean getEnabled();
-
- void setEnabled(boolean enabled);
-
- void setChangedCallback(@Nullable Runnable callback);
-}
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/Cheat.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/Cheat.kt
new file mode 100644
index 0000000000..848acf3ea1
--- /dev/null
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/Cheat.kt
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+package org.dolphinemu.dolphinemu.features.cheats.model
+
+interface Cheat {
+ fun supportsCreator(): Boolean
+
+ fun supportsNotes(): Boolean
+
+ fun supportsCode(): Boolean
+
+ fun getName(): String = ""
+
+ fun getCreator(): String = ""
+
+ fun getNotes(): String = ""
+
+ fun getCode(): String = ""
+
+ fun setCheat(
+ name: String,
+ creator: String,
+ notes: String,
+ code: String
+ ): Int
+
+ fun getUserDefined(): Boolean
+
+ fun getEnabled(): Boolean
+
+ fun setEnabled(isChecked: Boolean)
+
+ fun setChangedCallback(callback: Runnable?)
+
+ companion object {
+ // Result codes greater than 0 represent an error on the corresponding code line (one-indexed)
+ const val TRY_SET_FAIL_CODE_MIXED_ENCRYPTION = -3
+ const val TRY_SET_FAIL_NO_CODE_LINES = -2
+ const val TRY_SET_FAIL_NO_NAME = -1
+ const val TRY_SET_SUCCESS = 0
+ }
+}