Interface IPlayerService

All Known Implementing Classes:
PlayerService

public interface IPlayerService
Interface for PlayerService. Specifies the methods that the PlayerService should implement.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if the player has reached the goal.
    Gets the maze model associated with the player.
    Gets the Player model instance.
    boolean
    movePlayer(int dx, int dy)
    Checks if the move is valid and moves the player.
    void
    Resets the player's position to the starting point.
  • Method Details

    • movePlayer

      boolean movePlayer(int dx, int dy)
      Checks if the move is valid and moves the player.
      Parameters:
      dx - The delta x value for the move.
      dy - The delta y value for the move.
      Returns:
      True if the move is valid and the player is moved, false otherwise.
    • checkGoal

      boolean checkGoal()
      Checks if the player has reached the goal.
      Returns:
      True if the player has reached the goal, false otherwise.
    • getPlayer

      IPlayerModel getPlayer()
      Gets the Player model instance.
      Returns:
      The Player model instance.
    • reset

      void reset()
      Resets the player's position to the starting point.
    • getMaze

      IMazeModel getMaze()
      Gets the maze model associated with the player.
      Returns:
      The maze model.