From 43cf4c6c1b5f6351d02b06faedd97838758309d6 Mon Sep 17 00:00:00 2001 From: punchready Date: Sat, 1 May 2021 22:24:27 +0200 Subject: [PATCH] fix: swap EntityID constructor parameters --- .../teamname/marvelous/gamelibrary/entities/EntityID.java | 6 +++--- .../marvelous/gamelibrary/gamelogic/GameStateTest.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/entities/EntityID.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/entities/EntityID.java index c720e6f..9b629d7 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/entities/EntityID.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/entities/EntityID.java @@ -10,10 +10,10 @@ public class EntityID { /** * Constructs a new {@link Entity}-{@link EntityID} based on the given index and {@link EntityType}. - * @param id The index of the entity * @param type The type of the entity + * @param id The index of the entity */ - public EntityID(int id, EntityType type) { + public EntityID(EntityType type, int id) { this.id = id; this.type = type; } @@ -32,7 +32,7 @@ public class EntityID { * @return The cloned {@link EntityID} */ public EntityID clone() { - return new EntityID(id, type); + return new EntityID(type, id); } /** diff --git a/src/test/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameStateTest.java b/src/test/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameStateTest.java index d7a78fc..3d192fa 100644 --- a/src/test/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameStateTest.java +++ b/src/test/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameStateTest.java @@ -17,7 +17,7 @@ class GameStateTest { GameState state = new GameState(new IntVector2(10, 10)); //set up game - state.entities.addEntity(new Rock(new EntityID(0, EntityType.Rocks), new IntVector2(0, 0), 100)); + state.entities.addEntity(new Rock(new EntityID(EntityType.Rocks, 0), new IntVector2(0, 0), 100)); //snapshot state GameState snapshot = state.snapshot();