Class OpponentSetInteractor

java.lang.Object
com.mg105.use_cases.OpponentSetInteractor

public class OpponentSetInteractor extends Object
An interactor class that modifies and references GameState with methods relating to OpponentSet.
  • Constructor Details

    • OpponentSetInteractor

      public OpponentSetInteractor(GameState gameState)
      Creates a new OpponentSetInteractor with a reference to GameState.
      Parameters:
      gameState - the GameState to be referred to.
  • Method Details

    • compareLists

      public static OpponentSet compareLists(Point coordinates, List<OpponentSet> opponents)
      Checks if a given spot on the map contains an OpponentSet.
      Parameters:
      coordinates - A Point representing a coordinate being checked for an OpponentSet.
      opponents - A collection of OpponentSets being searched for in the given Point.
      Returns:
      the OpponentSet if opponent is found, or null if it is not.
    • verifyOpponent

      public OpponentSet verifyOpponent()
      Checks if an OpponentSet is adjacent to the player character.
      Returns:
      the OpponentSet if the opponent is found, or null if it is not.
    • setOpponentSet

      public boolean setOpponentSet()
      Sets the OpponentSet in the GameState to the one adjacent to the player.
      Returns:
      whether there was an OpponentSet next to the player (true) or not (false).