| 1 | package io.github.some_example_name; | |
| 2 | ||
| 3 | /** | |
| 4 | * Pure logic for settings (no LibGDX). | |
| 5 | */ | |
| 6 | public class SettingsLogic { | |
| 7 | ||
| 8 | private float volume; | |
| 9 | ||
| 10 | public SettingsLogic(float initialVolume) { | |
| 11 |
2
1. <init> : changed conditional boundary → KILLED 2. <init> : negated conditional → KILLED |
if (initialVolume <= 0f) { |
| 12 | this.volume = 0.5f; | |
| 13 | } else { | |
| 14 | this.volume = clamp(initialVolume); | |
| 15 | } | |
| 16 | } | |
| 17 | ||
| 18 | public void setVolume(float volume) { | |
| 19 | this.volume = clamp(volume); | |
| 20 | } | |
| 21 | ||
| 22 | public float getVolume() { | |
| 23 |
1
1. getVolume : replaced float return with 0.0f for io/github/some_example_name/SettingsLogic::getVolume → KILLED |
return volume; |
| 24 | } | |
| 25 | ||
| 26 | private float clamp(float value) { | |
| 27 |
1
1. clamp : replaced float return with 0.0f for io/github/some_example_name/SettingsLogic::clamp → KILLED |
return Math.max(0.01f, Math.min(1f, value)); |
| 28 | } | |
| 29 | } | |
Mutations | ||
| 11 |
1.1 2.2 |
|
| 23 |
1.1 |
|
| 27 |
1.1 |