Class CharacterMover

java.lang.Object
com.mg105.use_cases.map.CharacterMover
All Implemented Interfaces:
CharacterMoverInterface

public class CharacterMover extends Object implements CharacterMoverInterface
Move the player within a room.
  • Constructor Details

    • CharacterMover

      public CharacterMover(@NotNull @NotNull GameState state, @NotNull @NotNull RoomUpdaterInterface updater)
      Create a CharacterMover to operate on state and to update the room visuals via the updater
      Parameters:
      state - the current game state.
      updater - something that will update the visual representation of the room on change.
  • Method Details

    • generateMapMoveBy

      public void generateMapMoveBy(Point direction)
      Attempt to move by direction. Taking to account walls, chests, battles, exits, etc.
      Specified by:
      generateMapMoveBy in interface CharacterMoverInterface
      Parameters:
      direction - the direction to move. The direction must have a magnitude of 1 and be in exactly one cardinal direction.