diff options
Diffstat (limited to 'src/esieequest/controller/commands/SaveCommand.java')
-rw-r--r-- | src/esieequest/controller/commands/SaveCommand.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/esieequest/controller/commands/SaveCommand.java b/src/esieequest/controller/commands/SaveCommand.java index 3332059..95466e6 100644 --- a/src/esieequest/controller/commands/SaveCommand.java +++ b/src/esieequest/controller/commands/SaveCommand.java | |||
@@ -1,6 +1,7 @@ | |||
1 | package esieequest.controller.commands; | 1 | package esieequest.controller.commands; |
2 | 2 | ||
3 | import esieequest.model.Game; | 3 | import esieequest.model.Game; |
4 | import esieequest.model.Text; | ||
4 | import esieequest.view.Viewable; | 5 | import esieequest.view.Viewable; |
5 | 6 | ||
6 | /** | 7 | /** |
@@ -13,16 +14,15 @@ public class SaveCommand implements Executable { | |||
13 | @Override | 14 | @Override |
14 | public void execute(final String argument, final Game game, final Viewable view) { | 15 | public void execute(final String argument, final Game game, final Viewable view) { |
15 | 16 | ||
16 | if (argument == null) { | 17 | final String filePath = argument; |
17 | return; | ||
18 | } | ||
19 | 18 | ||
20 | if (argument.isEmpty()) { | 19 | if (filePath.isEmpty()) { |
20 | view.echo(Text.FILE_PATH_NOT_SPECIFIED.toString()); | ||
21 | return; | 21 | return; |
22 | } | 22 | } |
23 | 23 | ||
24 | final String serialisedGame = game.serialise().toJSONString(); | 24 | final String serialisedGame = game.serialise().toJSONString(); |
25 | view.save(argument, serialisedGame); | 25 | view.save(filePath, serialisedGame); |
26 | 26 | ||
27 | } | 27 | } |
28 | 28 | ||