$slots Slots. * @param BusyReason|null $empty_reason Reason when the collection is empty. */ public function __construct( private readonly array $slots = [], private readonly ?BusyReason $empty_reason = null, ) {} /** * All slots in order. * * @return list */ public function all(): array { return $this->slots; } /** * Whether the collection has no slots. */ public function is_empty(): bool { return [] === $this->slots; } /** * Reason recorded when the collection is empty. */ public function empty_reason(): ?BusyReason { return $this->empty_reason; } /** * Available slots only. * * @return list */ public function available_only(): array { return array_values( array_filter( $this->slots, static fn( Slot $s ): bool => $s->is_available() ) ); } }