cleanup: optimize imports, remove unused code, fix warnings

This commit is contained in:
2021-06-01 19:26:29 +02:00
parent 4d467d6d95
commit e88476eb10
9 changed files with 33 additions and 27 deletions

View File

@ -45,6 +45,8 @@ public class GameInstance {
result.addAll(result2);
result.add(GameLogic.buildGameStateEvent(_state));
return Optional.of(result);
}
@ -102,6 +104,10 @@ public class GameInstance {
manager.applyEvents(events);
}
protected GameState getState() {
return _state;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -429,7 +429,7 @@ class GameLogic {
* Verifies that a {@link Character} is alive.
*/
private static void requireAlive(Character entity) throws InvalidRequestException {
if(!entity.isAlive() || !entity.isActive()) {
if(!entity.isAlive()) {
throw new InvalidRequestException();
}
}

View File

@ -1,7 +1,9 @@
package uulm.teamname.marvelous.gamelibrary.gamelogic;
import uulm.teamname.marvelous.gamelibrary.IntVector2;
import uulm.teamname.marvelous.gamelibrary.entities.*;
import uulm.teamname.marvelous.gamelibrary.entities.Entity;
import uulm.teamname.marvelous.gamelibrary.entities.EntityID;
import uulm.teamname.marvelous.gamelibrary.entities.StoneType;
import uulm.teamname.marvelous.gamelibrary.json.config.CharacterConfig;
import uulm.teamname.marvelous.gamelibrary.json.config.PartyConfig;
import uulm.teamname.marvelous.gamelibrary.json.config.ScenarioConfig;

View File

@ -12,7 +12,7 @@ class GameStateManager {
private final GameState state;
/** The queue of {@link Event}s to be applied during {@link Request} processing */
private final ArrayDeque<Event> queue = new ArrayDeque<Event>();
private final ArrayDeque<Event> queue = new ArrayDeque<>();
/**
* Constructs a new {@link GameStateManager}.

View File

@ -1,9 +0,0 @@
package uulm.teamname.marvelous.gamelibrary.gamelogic;
/** Specifies a participant type. */
public enum ParticipantType {
None,
Player1,
Player2,
Spectator
}