Skip to content

Commit

Permalink
Refactoriza Nivel::crear_enlace_vista()
Browse files Browse the repository at this point in the history
  • Loading branch information
autosquash committed Oct 26, 2023
1 parent 4179779 commit 7dbe313
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/nivel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,21 +163,18 @@ EnlaceVista Nivel::crear_enlace_vista(
const modelo::ControlPizzas &control_pizzas, //
std::optional<int> objetivo_estatico //
) {

Vista *vista = new Vista(
const auto vista_ptr = std::make_shared<Vista>(
datos_nivel.es_estatico, //
globales.font, //
grid, //
control_pizzas.get_tipos_disponibles() //
);

vista->setup(
vista_ptr->setup(
datos_nivel.instrucciones, //
num_nivel, //
objetivo_estatico //
);

return EnlaceVista(std::shared_ptr<Vista>(vista));
return EnlaceVista(vista_ptr);
}

AccionGeneral Nivel::ejecutar() {
Expand Down

0 comments on commit 7dbe313

Please sign in to comment.