private void ExecuteCommand(char command) { if (command == 'L' || command == 'R') { var changeDirectionCommand = new ChangeDirectionCommand { Side = command.ToString(), InitialDirection = this.Piece.Direction }; this.Piece.Direction = _changeDirectionCommandDispatcher.Handle(changeDirectionCommand); } if (command == 'M') { var moveForwardCommand = new MoveForwardCommand { Direction = Piece.Direction, InitialField = Piece.Field }; this.Piece.Field = _moveForwardCommandDispatcher.Handle(moveForwardCommand); } }
public Task <Unit> Handle(ChangeDirectionCommand request, CancellationToken cancellationToken) { //TODO change this return(Task.FromResult(Unit.Value)); }