From cacbac9152595fb53d27201c7e059a76267b0a39 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Wed, 1 Mar 2023 13:37:57 -0500 Subject: [PATCH] Android: Convert CheatItem to Kotlin --- .../features/cheats/ui/CheatItem.java | 49 ------------------- .../features/cheats/ui/CheatItem.kt | 29 +++++++++++ 2 files changed, 29 insertions(+), 49 deletions(-) delete mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatItem.java create mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatItem.kt diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatItem.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatItem.java deleted file mode 100644 index b293cd84d1..0000000000 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatItem.java +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -package org.dolphinemu.dolphinemu.features.cheats.ui; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - -import org.dolphinemu.dolphinemu.features.cheats.model.Cheat; - -public class CheatItem -{ - public static final int TYPE_CHEAT = 0; - public static final int TYPE_HEADER = 1; - public static final int TYPE_ACTION = 2; - - private final @Nullable Cheat mCheat; - private final int mString; - private final int mType; - - public CheatItem(@NonNull Cheat cheat) - { - mCheat = cheat; - mString = 0; - mType = TYPE_CHEAT; - } - - public CheatItem(int type, int string) - { - mCheat = null; - mString = string; - mType = type; - } - - @Nullable - public Cheat getCheat() - { - return mCheat; - } - - public int getString() - { - return mString; - } - - public int getType() - { - return mType; - } -} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatItem.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatItem.kt new file mode 100644 index 0000000000..55b13a5be5 --- /dev/null +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatItem.kt @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +package org.dolphinemu.dolphinemu.features.cheats.ui + +import org.dolphinemu.dolphinemu.features.cheats.model.Cheat + +class CheatItem { + val cheat: Cheat? + val string: Int + val type: Int + + constructor(cheat: Cheat) { + this.cheat = cheat + string = 0 + type = TYPE_CHEAT + } + + constructor(type: Int, string: Int) { + cheat = null + this.string = string + this.type = type + } + + companion object { + const val TYPE_CHEAT = 0 + const val TYPE_HEADER = 1 + const val TYPE_ACTION = 2 + } +}