Class 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.
      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.
      coordinates - A Point representing a coordinate being checked for an OpponentSet.
      opponents - A collection of OpponentSets being searched for in the given Point.
      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.
      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.
      whether there was an OpponentSet next to the player (true) or not (false).