refactor: unify comment styles

feat: add entity list class
This commit is contained in:
2021-04-30 20:54:34 +02:00
parent 67a7ab35f9
commit 3f7d393d5d
25 changed files with 269 additions and 263 deletions

View File

@ -6,27 +6,26 @@ import uulm.teamname.marvelous.gamelibrary.requests.Request;
import java.util.ArrayDeque;
import java.util.ArrayList;
/** Represents manager for a game state.
*/
/** Represents manager for a game state. */
class GameStateManager {
/** The managed {@link GameState}.
*/
/** The managed {@link GameState} */
private final GameState state;
/** The queue of {@link Event}s to be applied during {@link Request} processing.
*/
/** The queue of {@link Event}s to be applied during {@link Request} processing */
private final ArrayDeque<Event> queue = new ArrayDeque<Event>();
/** Constructs a new {@link GameStateManager}.
* @param state A reference to the state to be managed.
/**
* Constructs a new {@link GameStateManager}.
* @param state A reference to the state to be managed
*/
public GameStateManager(GameState state) {
this.state = state;
}
/** Checks a list of {@link Request}s for validity and optionally produces resulting {@link Event}s.
* @param requests The requests to check.
* @param apply True if resulting events should be stored for later application.
/**
* Checks a list of {@link Request}s for validity and optionally produces resulting {@link Event}s.
* @param requests The requests to check
* @param apply True if resulting events should be stored for later application
*/
public boolean processRequests(Request[] requests, boolean apply) {
GameState snapshot = state.snapshot();
@ -46,8 +45,9 @@ class GameStateManager {
return true;
}
/** Applies an array of {@link Event}s to the game state.
* @param events The events to apply.
/**
* Applies an array of {@link Event}s to the game state.
* @param events The events to apply
*/
public void applyEvents(Event[] events) {
for(Event event: events) {
@ -55,8 +55,9 @@ class GameStateManager {
}
}
/** Applies the result of the last processRequests call.
* @return A list of applied events.
/**
* Applies the result of the last processRequests call.
* @return A list of applied events
*/
public Event[] apply() {
Event[] toReturn = new Event[queue.size()];