Android: Convert CheatItem to Kotlin

This commit is contained in:
Charles Lombardo 2023-03-01 13:37:57 -05:00
parent 5f5c95e7da
commit cacbac9152
2 changed files with 29 additions and 49 deletions

View File

@ -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;
}
}

View File

@ -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
}
}