Package com.mg105.use_cases.map
Class CharacterMover
java.lang.Object
com.mg105.use_cases.map.CharacterMover
- All Implemented Interfaces:
CharacterMoverInterface
Move the player within a room.
-
Constructor Summary
ConstructorDescriptionCharacterMover
(@NotNull GameState state, @NotNull RoomUpdaterInterface updater) Create a CharacterMover to operate on state and to update the room visuals via the updater -
Method Summary
Modifier and TypeMethodDescriptionvoid
generateMapMoveBy
(Point direction) Attempt to move by direction.
-
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
Attempt to move by direction. Taking to account walls, chests, battles, exits, etc.- Specified by:
generateMapMoveBy
in interfaceCharacterMoverInterface
- Parameters:
direction
- the direction to move. The direction must have a magnitude of 1 and be in exactly one cardinal direction.
-