LockerLogic.java

1
package io.github.some_example_name;
2
3
/**
4
 * Pure logic for Locker interaction and timers.
5
 */
6
public class LockerLogic {
7
8
    private boolean searched = false;
9
    private boolean showMessage = false;
10
11
    private float messageTimer = 0f;
12
13
    private float speedBoostTimer = 0f;
14
15
    /**
16
     * Called when the player successfully interacts with the locker.
17
     */
18
    public void searchLocker() {
19 1 1. searchLocker : negated conditional → KILLED
        if (!searched) {
20
            searched = true;
21
            showMessage = true;
22
            messageTimer = 0f;
23
            speedBoostTimer = 10f;
24
        }
25
    }
26
27
    /**
28
     * Update timers.
29
     */
30
    public void update(float delta) {
31 2 1. update : changed conditional boundary → SURVIVED
2. update : negated conditional → KILLED
        if (speedBoostTimer > 0f) {
32 1 1. update : Replaced float subtraction with addition → KILLED
            speedBoostTimer -= delta;
33
        }
34
35 1 1. update : negated conditional → KILLED
        if (showMessage) {
36 1 1. update : Replaced float addition with subtraction → KILLED
            messageTimer += delta;
37
            float messageDuration = 5f;
38 2 1. update : changed conditional boundary → SURVIVED
2. update : negated conditional → KILLED
            if (messageTimer >= messageDuration) {
39
                showMessage = false;
40
            }
41
        }
42
    }
43
44
    public boolean isSearched() {
45 2 1. isSearched : replaced boolean return with false for io/github/some_example_name/LockerLogic::isSearched → KILLED
2. isSearched : replaced boolean return with true for io/github/some_example_name/LockerLogic::isSearched → KILLED
        return searched;
46
    }
47
48
    public boolean isBoostActive() {
49 3 1. isBoostActive : negated conditional → KILLED
2. isBoostActive : changed conditional boundary → KILLED
3. isBoostActive : replaced boolean return with true for io/github/some_example_name/LockerLogic::isBoostActive → KILLED
        return speedBoostTimer > 0f;
50
    }
51
52
    public boolean shouldShowMessage() {
53 2 1. shouldShowMessage : replaced boolean return with false for io/github/some_example_name/LockerLogic::shouldShowMessage → KILLED
2. shouldShowMessage : replaced boolean return with true for io/github/some_example_name/LockerLogic::shouldShowMessage → KILLED
        return showMessage;
54
    }
55
}
56

Mutations

19

1.1
Location : searchLocker
Killed by : io.github.some_example_name.LockerLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.LockerLogicTest]/[method:messageVisibleBeforeFiveSeconds()]
negated conditional → KILLED

31

1.1
Location : update
Killed by : io.github.some_example_name.LockerLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.LockerLogicTest]/[method:boostExpiresAfterTenSeconds()]
negated conditional → KILLED

2.2
Location : update
Killed by : none
changed conditional boundary → SURVIVED

32

1.1
Location : update
Killed by : io.github.some_example_name.LockerLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.LockerLogicTest]/[method:boostExpiresAfterTenSeconds()]
Replaced float subtraction with addition → KILLED

35

1.1
Location : update
Killed by : io.github.some_example_name.LockerLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.LockerLogicTest]/[method:messageDisappearsAfterFiveSeconds()]
negated conditional → KILLED

36

1.1
Location : update
Killed by : io.github.some_example_name.LockerLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.LockerLogicTest]/[method:messageDisappearsAfterFiveSeconds()]
Replaced float addition with subtraction → KILLED

38

1.1
Location : update
Killed by : io.github.some_example_name.LockerLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.LockerLogicTest]/[method:messageVisibleBeforeFiveSeconds()]
negated conditional → KILLED

2.2
Location : update
Killed by : none
changed conditional boundary → SURVIVED

45

1.1
Location : isSearched
Killed by : io.github.some_example_name.LockerLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.LockerLogicTest]/[method:searchingLockerOnlyWorksOnce()]
replaced boolean return with false for io/github/some_example_name/LockerLogic::isSearched → KILLED

2.2
Location : isSearched
Killed by : io.github.some_example_name.LockerLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.LockerLogicTest]/[method:lockerIsNotSearchedInitially()]
replaced boolean return with true for io/github/some_example_name/LockerLogic::isSearched → KILLED

49

1.1
Location : isBoostActive
Killed by : io.github.some_example_name.LockerLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.LockerLogicTest]/[method:lockerIsNotSearchedInitially()]
negated conditional → KILLED

2.2
Location : isBoostActive
Killed by : io.github.some_example_name.LockerLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.LockerLogicTest]/[method:lockerIsNotSearchedInitially()]
changed conditional boundary → KILLED

3.3
Location : isBoostActive
Killed by : io.github.some_example_name.LockerLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.LockerLogicTest]/[method:lockerIsNotSearchedInitially()]
replaced boolean return with true for io/github/some_example_name/LockerLogic::isBoostActive → KILLED

53

1.1
Location : shouldShowMessage
Killed by : io.github.some_example_name.LockerLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.LockerLogicTest]/[method:messageVisibleBeforeFiveSeconds()]
replaced boolean return with false for io/github/some_example_name/LockerLogic::shouldShowMessage → KILLED

2.2
Location : shouldShowMessage
Killed by : io.github.some_example_name.LockerLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.LockerLogicTest]/[method:lockerIsNotSearchedInitially()]
replaced boolean return with true for io/github/some_example_name/LockerLogic::shouldShowMessage → KILLED

Active mutators

Tests examined


Report generated by PIT 1.15.0