cleanup: optimize imports
This commit is contained in:
parent
5984e40384
commit
9c2c814e98
@ -1,22 +1,22 @@
|
|||||||
package uulm.teamname.marvelous.gamelibrary.gamelogic;
|
package uulm.teamname.marvelous.gamelibrary.gamelogic;
|
||||||
|
|
||||||
import uulm.teamname.marvelous.gamelibrary.IntVector2;
|
import uulm.teamname.marvelous.gamelibrary.IntVector2;
|
||||||
import uulm.teamname.marvelous.gamelibrary.Tuple;
|
|
||||||
import uulm.teamname.marvelous.gamelibrary.entities.*;
|
|
||||||
import uulm.teamname.marvelous.gamelibrary.entities.Character;
|
import uulm.teamname.marvelous.gamelibrary.entities.Character;
|
||||||
import uulm.teamname.marvelous.gamelibrary.events.*;
|
import uulm.teamname.marvelous.gamelibrary.entities.*;
|
||||||
import uulm.teamname.marvelous.gamelibrary.events.Event;
|
import uulm.teamname.marvelous.gamelibrary.events.Event;
|
||||||
|
import uulm.teamname.marvelous.gamelibrary.events.*;
|
||||||
import uulm.teamname.marvelous.gamelibrary.json.config.FieldType;
|
import uulm.teamname.marvelous.gamelibrary.json.config.FieldType;
|
||||||
import uulm.teamname.marvelous.gamelibrary.requests.CharacterRequest;
|
import uulm.teamname.marvelous.gamelibrary.requests.CharacterRequest;
|
||||||
import uulm.teamname.marvelous.gamelibrary.requests.Request;
|
import uulm.teamname.marvelous.gamelibrary.requests.Request;
|
||||||
import uulm.teamname.marvelous.gamelibrary.requests.RequestType;
|
import uulm.teamname.marvelous.gamelibrary.requests.RequestType;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.geom.Area;
|
|
||||||
import java.awt.geom.Line2D;
|
import java.awt.geom.Line2D;
|
||||||
import java.awt.geom.Point2D;
|
import java.awt.geom.Point2D;
|
||||||
import java.awt.geom.Rectangle2D;
|
import java.util.ArrayList;
|
||||||
import java.util.*;
|
import java.util.Collections;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
/** Contains game logic handling. */
|
/** Contains game logic handling. */
|
||||||
class GameLogic {
|
class GameLogic {
|
||||||
|
@ -86,7 +86,7 @@ class GameStateManager {
|
|||||||
* @return A list of applied events
|
* @return A list of applied events
|
||||||
*/
|
*/
|
||||||
public ArrayList<Event> apply() {
|
public ArrayList<Event> apply() {
|
||||||
ArrayList<Event> toReturn = new ArrayList<Event>(queue.size());
|
ArrayList<Event> toReturn = new ArrayList<>(queue.size());
|
||||||
Event current;
|
Event current;
|
||||||
while ((current = queue.poll()) != null) {
|
while ((current = queue.poll()) != null) {
|
||||||
GameLogic.applyEvent(state, current);
|
GameLogic.applyEvent(state, current);
|
||||||
|
@ -11,7 +11,7 @@ public enum SerializedEntityType {
|
|||||||
InfinityStone,
|
InfinityStone,
|
||||||
Rock;
|
Rock;
|
||||||
|
|
||||||
private static Map<EntityType, SerializedEntityType> entityTypeToDeserialized;
|
private static final Map<EntityType, SerializedEntityType> entityTypeToDeserialized;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
entityTypeToDeserialized = new HashMap<>();
|
entityTypeToDeserialized = new HashMap<>();
|
||||||
@ -26,4 +26,4 @@ public enum SerializedEntityType {
|
|||||||
public static SerializedEntityType valueOf(EntityType entityType) {
|
public static SerializedEntityType valueOf(EntityType entityType) {
|
||||||
return entityTypeToDeserialized.get(entityType);
|
return entityTypeToDeserialized.get(entityType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ import static uulm.teamname.marvelous.gamelibrary.json.JsonNodeUnwrapper.unwrap;
|
|||||||
public class RequestDeserializer extends JsonDeserializer<Request> {
|
public class RequestDeserializer extends JsonDeserializer<Request> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Request deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
public Request deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
|
||||||
ObjectCodec codec = p.getCodec();
|
ObjectCodec codec = p.getCodec();
|
||||||
JsonNode node = codec.readTree(p);
|
JsonNode node = codec.readTree(p);
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ public class EventSerializerTest {
|
|||||||
if (attackField.length() == 0) {
|
if (attackField.length() == 0) {
|
||||||
attackField.add(dir.get5().scale(3));
|
attackField.add(dir.get5().scale(3));
|
||||||
}
|
}
|
||||||
return Tuple.<IntVector2, IntVector2>of(origin, attackField);
|
return Tuple.of(origin, attackField);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,7 @@ public class RequestSerializerTest {
|
|||||||
if (attackField.length() == 0) {
|
if (attackField.length() == 0) {
|
||||||
attackField.add(dir.get5().scale(3));
|
attackField.add(dir.get5().scale(3));
|
||||||
}
|
}
|
||||||
return Tuple.<IntVector2, IntVector2>of(origin, attackField);
|
return Tuple.of(origin, attackField);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user