blob: d7ed8a35d7dc3100c5fe82d7ee24a17bc6b7d2e7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package esieequest.controller.commands;
import esieequest.model.Game;
import esieequest.view.Viewable;
/**
* Allows the user to go back on his steps and go to his previous location.
*
* @author Pacien TRAN-GIRARD
*/
public class BackCommand implements Executable {
@Override
public void execute(final String argument, final Game game, final Viewable view) {
game.getPlayer().goToPreviousRoom();
view.updateLocation(game.getPlayer().getCurrentRoom(), game.getPlayer()
.getCurrentDirection(), game.getPlayer().getCurrentSide(), game.getPlayer()
.canGoBack());
}
}
|