From 531a97a1d2a091d693d3355a651f725b4ab4957a Mon Sep 17 00:00:00 2001 From: fdai2751 Date: Wed, 7 Feb 2024 22:58:56 +0100 Subject: [PATCH] refactoring: interface changed --- src/main/java/pacmanGame/GhostBehavior.java | 2 +- src/main/java/pacmanGame/GhostBehaviorChase.java | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/pacmanGame/GhostBehavior.java b/src/main/java/pacmanGame/GhostBehavior.java index 5d0cacd..bad3e66 100644 --- a/src/main/java/pacmanGame/GhostBehavior.java +++ b/src/main/java/pacmanGame/GhostBehavior.java @@ -1,7 +1,7 @@ package pacmanGame; public interface GhostBehavior { - public Vector2 GetDirection(); + public Vector2 GetDirection(Ghost ghost); } diff --git a/src/main/java/pacmanGame/GhostBehaviorChase.java b/src/main/java/pacmanGame/GhostBehaviorChase.java index ea698e6..e505fca 100644 --- a/src/main/java/pacmanGame/GhostBehaviorChase.java +++ b/src/main/java/pacmanGame/GhostBehaviorChase.java @@ -1,14 +1,10 @@ package pacmanGame; public class GhostBehaviorChase implements GhostBehavior { - public final Ghost ghost; - public GhostBehaviorChase(Ghost ghost) { - this.ghost = ghost; - } - @Override - public Vector2 GetDirection() { + public Vector2 GetDirection(Ghost ghost) { + return null; }