tipoDeAbertura function

TipoDeAbertura? tipoDeAbertura(
  1. RotinaAlvo alvo
)

A fonte de um alvo que abre (null para o que não abre: ver motivoDeNaoAbrir).

Implementation

TipoDeAbertura? tipoDeAbertura(RotinaAlvo alvo) {
  if (motivoDeNaoAbrir(alvo) != null) return null;
  return switch (alvo) {
    AlvoDeTrilha() => TipoDeAbertura.trilha,
    AlvoDePartitura() => TipoDeAbertura.partitura,
    AlvoDeBloco() => TipoDeAbertura.bloco,
  };
}