diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingDoubleSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingDoubleSetting.java deleted file mode 100644 index 0311e6d2b3..0000000000 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingDoubleSetting.java +++ /dev/null @@ -1,51 +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.AbstractFloatSetting; -import org.dolphinemu.dolphinemu.features.settings.model.Settings; - -// Yes, floats are not the same thing as doubles... They're close enough, though -public class InputMappingDoubleSetting implements AbstractFloatSetting -{ - private final NumericSetting mNumericSetting; - - public InputMappingDoubleSetting(NumericSetting numericSetting) - { - mNumericSetting = numericSetting; - } - - @Override - public float getFloat() - { - return (float) mNumericSetting.getDoubleValue(); - } - - @Override - public void setFloat(@NonNull Settings settings, float newValue) - { - mNumericSetting.setDoubleValue(newValue); - } - - @Override - public boolean isOverridden() - { - return false; - } - - @Override - public boolean isRuntimeEditable() - { - return true; - } - - @Override - public boolean delete(@NonNull Settings settings) - { - mNumericSetting.setDoubleValue(mNumericSetting.getDoubleDefaultValue()); - return true; - } -} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingDoubleSetting.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingDoubleSetting.kt new file mode 100644 index 0000000000..e2da062250 --- /dev/null +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/InputMappingDoubleSetting.kt @@ -0,0 +1,25 @@ +// 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.AbstractFloatSetting +import org.dolphinemu.dolphinemu.features.settings.model.Settings + +// Yes, floats are not the same thing as doubles... They're close enough, though +class InputMappingDoubleSetting(private val numericSetting: NumericSetting) : AbstractFloatSetting { + override val float: Float + get() = numericSetting.getDoubleValue().toFloat() + + override fun setFloat(settings: Settings, newValue: Float) = + numericSetting.setDoubleValue(newValue.toDouble()) + + override val isOverridden: Boolean = false + + override val isRuntimeEditable: Boolean = true + + override fun delete(settings: Settings): Boolean { + numericSetting.setDoubleValue(numericSetting.getDoubleDefaultValue()) + return true + } +}