From d5b3b8236f7cf8a6f3c675da1f38cd01841e35d7 Mon Sep 17 00:00:00 2001 From: fdai7920 Date: Sat, 3 Feb 2024 00:02:22 +0100 Subject: [PATCH] refactoring: remove useless variable in legalMove --- .../java/de/hsfulda/onses/services/GameService.java | 2 +- src/test/java/de/hsfulda/onses/GameServiceTest.java | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/de/hsfulda/onses/services/GameService.java b/src/main/java/de/hsfulda/onses/services/GameService.java index 3ca661d..fe77037 100644 --- a/src/main/java/de/hsfulda/onses/services/GameService.java +++ b/src/main/java/de/hsfulda/onses/services/GameService.java @@ -76,7 +76,7 @@ public class GameService { } } - public boolean legalMove(Player player, Card card) + public boolean legalMove(Card card) { boolean legalMoveFound = false; Card lastCard = game.getLastPlayedCard(); diff --git a/src/test/java/de/hsfulda/onses/GameServiceTest.java b/src/test/java/de/hsfulda/onses/GameServiceTest.java index f6a6eef..cf6cf3b 100644 --- a/src/test/java/de/hsfulda/onses/GameServiceTest.java +++ b/src/test/java/de/hsfulda/onses/GameServiceTest.java @@ -46,7 +46,7 @@ public class GameServiceTest { GameService gameService = new GameService(); gameService.getGame().setLastPlayedCard(new Card().setColor(Card.Color.RED).setValue(Card.Value.FIVE)); - boolean answer = gameService.legalMove(new Player(), input); + boolean answer = gameService.legalMove(input); // assert assertEquals(expected, answer); } @@ -60,7 +60,7 @@ public class GameServiceTest { GameService gameService = new GameService(); gameService.getGame().setLastPlayedCard(new Card().setColor(Card.Color.BLUE).setValue(Card.Value.ONE)); - boolean answer = gameService.legalMove(new Player(), input); + boolean answer = gameService.legalMove(input); // assert assertEquals(expected, answer); } @@ -86,7 +86,7 @@ public class GameServiceTest { GameService gameService = new GameService(); gameService.getGame().setLastPlayedCard(new Card().setColor(Card.Color.YELLOW).setValue(Card.Value.ONE)); - boolean answer = gameService.legalMove(new Player(), input); + boolean answer = gameService.legalMove(input); // assert assertEquals(expected, answer); } @@ -101,7 +101,7 @@ public class GameServiceTest { GameService gameService = new GameService(); gameService.getGame().setLastPlayedCard(new Card().setColor(Card.Color.YELLOW).setValue(Card.Value.THREE)); - boolean answer = gameService.legalMove(new Player(), input); + boolean answer = gameService.legalMove(input); // assert assertEquals(expected, answer); } @@ -116,7 +116,7 @@ public class GameServiceTest { GameService gameService = new GameService(); gameService.getGame().setLastPlayedCard(new Card().setColor(Card.Color.YELLOW).setValue(Card.Value.THREE)); - boolean answer = gameService.legalMove(new Player(), input); + boolean answer = gameService.legalMove(input); // assert assertEquals(expected, answer); } @@ -131,7 +131,7 @@ public class GameServiceTest { GameService gameService = new GameService(); gameService.getGame().setLastPlayedCard(new Card().setColor(Card.Color.GREEN).setValue(Card.Value.FIVE)); - boolean answer = gameService.legalMove(new Player(), input); + boolean answer = gameService.legalMove(input); // assert assertEquals(expected, answer); }