Android: Convert InputMappingIntSetting to Kotlin

This commit is contained in:
Charles Lombardo 2023-06-10 05:15:23 -04:00
parent 60b3b1231b
commit cb9c670d85
2 changed files with 23 additions and 50 deletions

View File

@ -1,50 +0,0 @@
// SPDX-License-Identifier: GPL-2.0-or-later
package org.dolphinemu.dolphinemu.features.input.model;
import androidx.annotation.NonNull;
import org.dolphinemu.dolphinemu.features.input.model.controlleremu.NumericSetting;
import org.dolphinemu.dolphinemu.features.settings.model.AbstractIntSetting;
import org.dolphinemu.dolphinemu.features.settings.model.Settings;
public class InputMappingIntSetting implements AbstractIntSetting
{
private final NumericSetting mNumericSetting;
public InputMappingIntSetting(NumericSetting numericSetting)
{
mNumericSetting = numericSetting;
}
@Override
public int getInt()
{
return mNumericSetting.getIntValue();
}
@Override
public void setInt(@NonNull Settings settings, int newValue)
{
mNumericSetting.setIntValue(newValue);
}
@Override
public boolean isOverridden()
{
return false;
}
@Override
public boolean isRuntimeEditable()
{
return true;
}
@Override
public boolean delete(@NonNull Settings settings)
{
mNumericSetting.setIntValue(mNumericSetting.getIntDefaultValue());
return true;
}
}

View File

@ -0,0 +1,23 @@
// SPDX-License-Identifier: GPL-2.0-or-later
package org.dolphinemu.dolphinemu.features.input.model
import org.dolphinemu.dolphinemu.features.input.model.controlleremu.NumericSetting
import org.dolphinemu.dolphinemu.features.settings.model.AbstractIntSetting
import org.dolphinemu.dolphinemu.features.settings.model.Settings
class InputMappingIntSetting(private val numericSetting: NumericSetting) : AbstractIntSetting {
override val int: Int
get() = numericSetting.getIntValue()
override fun setInt(settings: Settings, newValue: Int) = numericSetting.setIntValue(newValue)
override val isOverridden: Boolean = false
override val isRuntimeEditable: Boolean = true
override fun delete(settings: Settings): Boolean {
numericSetting.setIntValue(numericSetting.getIntDefaultValue())
return true
}
}