| 1 | package com.rox.input; | |
| 2 | ||
| 3 | /** | |
| 4 | * Bundles all 4 controller slots plus the Four Score enablement flag into the one parameter threaded | |
| 5 | * through {@link com.rox.NES}/{@link com.rox.mem.NESMemoryBus} - matches how | |
| 6 | * {@link com.rox.video.VideoOutput} was added as one bundled param per pluggable-device layer, not | |
| 7 | * one param per slot. | |
| 8 | */ | |
| 9 | public class ControllerConfiguration { | |
| 10 | /** All 4 slots absent, Four Score disabled - the default for callers that don't care about input. */ | |
| 11 | public static final ControllerConfiguration NONE = | |
| 12 | new ControllerConfiguration(Controller.NONE, Controller.NONE, Controller.NONE, Controller.NONE, false); | |
| 13 | ||
| 14 | private final Controller player1; | |
| 15 | private final Controller player2; | |
| 16 | private final Controller player3; | |
| 17 | private final Controller player4; | |
| 18 | private final boolean fourScoreEnabled; | |
| 19 | ||
| 20 | public ControllerConfiguration(final Controller player1, final Controller player2, | |
| 21 | final Controller player3, final Controller player4, | |
| 22 | final boolean fourScoreEnabled){ | |
| 23 | this.player1 = player1; | |
| 24 | this.player2 = player2; | |
| 25 | this.player3 = player3; | |
| 26 | this.player4 = player4; | |
| 27 | this.fourScoreEnabled = fourScoreEnabled; | |
| 28 | } | |
| 29 | ||
| 30 | /** 2-player setup, Four Score disabled - the common case. */ | |
| 31 | public static ControllerConfiguration twoPlayers(final Controller player1, final Controller player2){ | |
| 32 |
1
1. twoPlayers : replaced return value with null for com/rox/input/ControllerConfiguration::twoPlayers → KILLED |
return new ControllerConfiguration(player1, player2, Controller.NONE, Controller.NONE, false); |
| 33 | } | |
| 34 | ||
| 35 | public Controller player1(){ | |
| 36 |
1
1. player1 : replaced return value with null for com/rox/input/ControllerConfiguration::player1 → KILLED |
return player1; |
| 37 | } | |
| 38 | ||
| 39 | public Controller player2(){ | |
| 40 |
1
1. player2 : replaced return value with null for com/rox/input/ControllerConfiguration::player2 → KILLED |
return player2; |
| 41 | } | |
| 42 | ||
| 43 | public Controller player3(){ | |
| 44 |
1
1. player3 : replaced return value with null for com/rox/input/ControllerConfiguration::player3 → KILLED |
return player3; |
| 45 | } | |
| 46 | ||
| 47 | public Controller player4(){ | |
| 48 |
1
1. player4 : replaced return value with null for com/rox/input/ControllerConfiguration::player4 → KILLED |
return player4; |
| 49 | } | |
| 50 | ||
| 51 | public boolean fourScoreEnabled(){ | |
| 52 |
2
1. fourScoreEnabled : replaced boolean return with false for com/rox/input/ControllerConfiguration::fourScoreEnabled → KILLED 2. fourScoreEnabled : replaced boolean return with true for com/rox/input/ControllerConfiguration::fourScoreEnabled → KILLED |
return fourScoreEnabled; |
| 53 | } | |
| 54 | } | |
Mutations | ||
| 32 |
1.1 |
|
| 36 |
1.1 |
|
| 40 |
1.1 |
|
| 44 |
1.1 |
|
| 48 |
1.1 |
|
| 52 |
1.1 2.2 |