Skip to content

Commit

Permalink
Remove include shared_num_nivel.h from shared.h
Browse files Browse the repository at this point in the history
  • Loading branch information
autosquash committed Jan 16, 2024
1 parent bf7c5ec commit 178535c
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 14 deletions.
15 changes: 15 additions & 0 deletions dev/estructura.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
- main.cpp:
- juego.h
- log_init.h
- shared.h

- _pruebas/main.cpp:
- _pruebas/class_a.h
Expand Down Expand Up @@ -126,6 +127,7 @@
- fase_nivel.h
- log_init.h
- modelo_amplio/aplicador.h
- shared_num_nivel.h

- nivel.h:
- globales.h
Expand Down Expand Up @@ -182,6 +184,12 @@
- tests/test_cadenas.cpp:
- vista/cadenas.h

- tests/test_main.cpp:
- log_init.h

- tests/test_num_nivel.cpp:
- shared_num_nivel.h

- tests/test_tiempo.cpp:
- tiempo.h

Expand All @@ -199,10 +207,12 @@

- textos.cpp:
- textos.h
- log_init.h
- vista/cadenas.h

- textos.h:
- shared.h
- shared_num_nivel.h

- tiempo.cpp:
- tiempo.h
Expand Down Expand Up @@ -298,6 +308,7 @@
- modelo/control_pizzas.h
- modelo/modelo.h
- shared.h
- shared_num_nivel.h
- vista/presentacion_vista.h
- vista/vista_shared.h

Expand Down Expand Up @@ -327,12 +338,14 @@

- vista/etiquetas/etiquetas_info.cpp:
- vista/etiquetas/etiquetas_info.h
- log_init.h
- textos.h
- vista/basicos_vista.h
- vista/componentes/varios.h

- vista/etiquetas/etiquetas_info.h:
- shared.h
- shared_num_nivel.h
- vista/presentacion_vista.h

- vista/etiquetas/fabrica_etiquetas_contadores.cpp:
Expand Down Expand Up @@ -373,6 +386,8 @@
- vista/vista.cpp:
- vista/vista.h
- fase_nivel.h
- log_init.h
- shared_num_nivel.h
- templates/helpers.h
- vista/basicos_vista.h
- vista/grid.h
Expand Down
2 changes: 1 addition & 1 deletion src/demos/demo_nivel.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../shared.h"
#include "../shared_num_nivel.h"
#include <memory>

int demo_nivel(NumNivelOpcional numero_nivel);
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "demos/visual_textos.h"
#include "juego.h"
#include "log_init.h"
#include "shared.h"
#include <cassert>
#include <iostream>
#include <map>
Expand Down
1 change: 1 addition & 0 deletions src/nivel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "fase_nivel.h"
#include "log_init.h"
#include "modelo_amplio/aplicador.h"
#include "shared_num_nivel.h"
#include <SFML/System/Time.hpp>
#include <SFML/Window/Event.hpp>
#include <cassert>
Expand Down
5 changes: 4 additions & 1 deletion src/shared.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "shared.h"

#include <SFML/Graphics/Font.hpp>
#include <cassert>
#include <memory>
Expand All @@ -8,10 +7,14 @@
void OptionalFont::set_pointer(std::shared_ptr<sf::Font> ptr) { //
font_ptr = ptr;
}

std::shared_ptr<sf::Font> OptionalFont::get_pointer() const { //
assert(exists());
return font_ptr;
}

bool OptionalFont::exists() const { //
return font_ptr != nullptr;
}

ObjetoConFont::ObjetoConFont(const OptionalFont &font) : font(font) {}
8 changes: 3 additions & 5 deletions src/shared.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once

#include "shared_num_nivel.h"
#include <cassert>
#include <memory>

constexpr bool MODO_DESARROLLO = true;

namespace sf {
class Font;
}
Expand All @@ -18,12 +18,10 @@ class OptionalFont {
bool exists() const;
};

constexpr bool MODO_DESARROLLO = true;

class ObjetoConFont {
protected:
const OptionalFont &font;

public:
ObjetoConFont(const OptionalFont &font) : font(font) {}
ObjetoConFont(const OptionalFont &font);
};
5 changes: 3 additions & 2 deletions src/textos.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#pragma once

#include "shared.h"
#include "shared_num_nivel.h"
#include <memory>
#include <optional>
#include <string>

std::string construir_texto_instrucciones(
const std::string &plantilla, //
const NumNivelOpcional& //
const std::string &plantilla, //
const NumNivelOpcional & //
);
std::string construir_resultado();

Expand Down
6 changes: 3 additions & 3 deletions src/vista/etiquetas/etiquetas.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "../../modelo/control_pizzas.h"
#include "../../modelo/modelo.h"
#include "../../shared.h"
#include "../../shared_num_nivel.h"
#include "../presentacion_vista.h"
#include "../vista_shared.h"
#include <SFML/System/Vector2.hpp>
Expand Down Expand Up @@ -40,18 +41,17 @@ struct EtiquetasGenerales : public ObjetoConFont {

void setup(
const std::string &instr, //
const NumNivelOpcional&, //
const NumNivelOpcional &, //
const dominio::TiposDePizza &tp_disponibles //
);

void set_presentacion_vista( //
void set_presentacion_vista(
std::shared_ptr<PresentacionVista> presentacion_vista //
);

void actualizar_contadores(
const PizzasToStrings &vista_preparadas, //
const modelo::Pedidos &pedidos //

);

void actualizar_barra_estado(
Expand Down
5 changes: 3 additions & 2 deletions src/vista/etiquetas/etiquetas_info.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "../../shared.h"
#include "../../shared_num_nivel.h"
#include "../presentacion_vista.h"
#include <SFML/Graphics/Text.hpp>
#include <optional>
Expand All @@ -15,8 +16,8 @@ struct EtiquetasInfo : public ObjetoConFont, public sf::Drawable {

EtiquetasInfo(const OptionalFont &);
void setup(
const std::string &instr, //
const NumNivelOpcional& //
const std::string &instr, //
const NumNivelOpcional & //

);
void set_presentacion_vista(
Expand Down
1 change: 1 addition & 0 deletions src/vista/vista.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "vista.h"
#include "../fase_nivel.h"
#include "../log_init.h"
#include "../shared_num_nivel.h"
#include "../templates/helpers.h"
#include "basicos_vista.h"
#include "grid.h"
Expand Down

0 comments on commit 178535c

Please sign in to comment.