| 1 | package io.github.some_example_name; | |
| 2 | ||
| 3 | public class PlayerLogic { | |
| 4 | ||
| 5 | public enum Frame { | |
| 6 | FRONT, | |
| 7 | BACK, | |
| 8 | SIDE | |
| 9 | } | |
| 10 | ||
| 11 | public static class FrameState { | |
| 12 | public final Frame frame; | |
| 13 | public final boolean flipX; | |
| 14 | ||
| 15 | public FrameState(Frame frame, boolean flipX) { | |
| 16 | this.frame = frame; | |
| 17 | this.flipX = flipX; | |
| 18 | } | |
| 19 | } | |
| 20 | ||
| 21 | public static FrameState decideFrame(Player.Direction direction) { | |
| 22 | switch (direction) { | |
| 23 | case UP: | |
| 24 |
1
1. decideFrame : replaced return value with null for io/github/some_example_name/PlayerLogic::decideFrame → KILLED |
return new FrameState(Frame.BACK, false); |
| 25 | case DOWN: | |
| 26 |
1
1. decideFrame : replaced return value with null for io/github/some_example_name/PlayerLogic::decideFrame → KILLED |
return new FrameState(Frame.FRONT, false); |
| 27 | case LEFT: | |
| 28 |
1
1. decideFrame : replaced return value with null for io/github/some_example_name/PlayerLogic::decideFrame → KILLED |
return new FrameState(Frame.SIDE, false); |
| 29 | case RIGHT: | |
| 30 |
1
1. decideFrame : replaced return value with null for io/github/some_example_name/PlayerLogic::decideFrame → KILLED |
return new FrameState(Frame.SIDE, true); |
| 31 | case NORTHEAST: | |
| 32 |
1
1. decideFrame : replaced return value with null for io/github/some_example_name/PlayerLogic::decideFrame → KILLED |
return new FrameState(Frame.BACK, true); |
| 33 | case NORTHWEST: | |
| 34 |
1
1. decideFrame : replaced return value with null for io/github/some_example_name/PlayerLogic::decideFrame → KILLED |
return new FrameState(Frame.BACK, false); |
| 35 | case SOUTHEAST: | |
| 36 |
1
1. decideFrame : replaced return value with null for io/github/some_example_name/PlayerLogic::decideFrame → KILLED |
return new FrameState(Frame.FRONT, true); |
| 37 | case SOUTHWEST: | |
| 38 |
1
1. decideFrame : replaced return value with null for io/github/some_example_name/PlayerLogic::decideFrame → KILLED |
return new FrameState(Frame.FRONT, false); |
| 39 | default: | |
| 40 |
1
1. decideFrame : replaced return value with null for io/github/some_example_name/PlayerLogic::decideFrame → NO_COVERAGE |
return new FrameState(Frame.FRONT, false); |
| 41 | } | |
| 42 | } | |
| 43 | } | |
| 44 | ||
Mutations | ||
| 24 |
1.1 |
|
| 26 |
1.1 |
|
| 28 |
1.1 |
|
| 30 |
1.1 |
|
| 32 |
1.1 |
|
| 34 |
1.1 |
|
| 36 |
1.1 |
|
| 38 |
1.1 |
|
| 40 |
1.1 |