getCommandsByMaxPriority method

List<QueuedCommand> getCommandsByMaxPriority(
  1. QueuePriority maxPriority
)

Get commands at or above a given priority level without removing them.

Implementation

List<QueuedCommand> getCommandsByMaxPriority(QueuePriority maxPriority) {
  return _commandQueue
      .where((cmd) => cmd.priority.order <= maxPriority.order)
      .toList();
}