player command
This commit is contained in:
@@ -19,6 +19,10 @@ public class CommandExecutor {
|
||||
assert this.outputSystem != null : "No output system specified !";
|
||||
|
||||
CommandResult result = command.execute(this.game, this.outputSystem);
|
||||
|
||||
// non player commands are not supposed to return move result
|
||||
assert result != CommandResult.Moved || command instanceof PlayerCommand;
|
||||
|
||||
processResult(command, result);
|
||||
return result;
|
||||
}
|
||||
@@ -34,7 +38,7 @@ public class CommandExecutor {
|
||||
|
||||
if (!needsPromote)
|
||||
this.game.switchPlayerTurn();
|
||||
} else if (command instanceof PromoteCommand) {
|
||||
} else if (command instanceof PlayerCommand) {
|
||||
this.game.switchPlayerTurn();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user