refactor: extracted UpdateTimer method
This commit is contained in:
parent
4e66a4eb24
commit
6a8de34c67
@ -92,11 +92,11 @@ public class Lobby {
|
||||
badRequests = 0;
|
||||
}
|
||||
|
||||
updateTimer(game.state.getActiveCharacter().type);
|
||||
|
||||
updateTimer();
|
||||
}
|
||||
|
||||
void updateTimer(EntityType currentActiveCharacterType) {
|
||||
void updateTimer() {
|
||||
var currentActiveCharacterType = game.state.getActiveCharacter().type;
|
||||
if (pauseSegment.isPaused()) {
|
||||
turnTimer.clear();
|
||||
} else if (currentActiveCharacterType == EntityType.P1) {
|
||||
|
@ -35,13 +35,13 @@ class LobbyTest {
|
||||
};
|
||||
var characterConfig = mock(CharacterConfig.class);
|
||||
|
||||
lobby = new Lobby(
|
||||
lobby = spy(new Lobby(
|
||||
gameID,
|
||||
connection,
|
||||
partyConfig,
|
||||
characterConfig,
|
||||
scenarioConfig
|
||||
);
|
||||
));
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -51,9 +51,10 @@ class LobbyTest {
|
||||
new RequestBuilder(RequestType.MoveRequest).buildGameRequest()
|
||||
};
|
||||
var playerConnection = mock(WebSocket.class);
|
||||
doNothing().when(lobby).updateTimer();
|
||||
|
||||
Participant playerOne = new Participant(playerConnection, ParticipantType.PlayerOne, "P1");
|
||||
lobby.receiveRequests(requests, playerOne);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user