My Project
view.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <SDL2/SDL.h>
4 #include <SDL2/SDL_image.h>
5 #include <SDL2/SDL_ttf.h>
6 #include <string>
7 #include <sstream>
8 #include <vector>
9 #include <experimental/filesystem>
10 #include "tijolo.h"
11 #include "bolinha.h"
12 #include "barra.h"
13 #include "pontos.h"
14 #include "vida.h"
15 #include <vector>
16 
24 class view{
25  private:
26 
27  std::vector<tijolo>& t;
29  barra *ba;
31  vida* v;
33  SDL_Window *window;
34  SDL_Renderer *renderer;
35  SDL_Rect bloco;
36  SDL_Rect target;
37  SDL_Rect bol;
38  SDL_Rect bar;
39  const Uint8 *state;
40  TTF_Font* Font;
41 
43  SDL_Rect Message_Fim_rect;
47 
48 
49 
50 
51 
52  public:
63  view(std::vector<tijolo>& t_, barra* ba_, bolinha* bo_, pontos* po_, vida* v_);
64 
78  void render_text(SDL_Renderer *renderer,int x, int y,const char *text,TTF_Font *font,SDL_Rect *rect,SDL_Color *color);
79 
84  int init();
85 
90  void render();
91 
96  void quit();
97 
102  void perdeu();
103 
108  void ganhou();
109  int quantidadeTijolos();
110  SDL_Rect* getTarget();
111  SDL_Rect* getBloco();
112  SDL_Rect* getBolinha();
113  SDL_Rect* getBarra();
114  std::vector<tijolo>& getTijolos();
115  pontos* getPonto();
116  vida* getVida();
117  int getWidth();
118  int getHeigth();
119  const Uint8* getState();
120 
121 };
bolinha * bo
Definition: view.h:28
SDL_Window * window
Definition: view.h:33
std::vector< tijolo > & getTijolos()
Definition: view.cpp:29
view(std::vector< tijolo > &t_, barra *ba_, bolinha *bo_, pontos *po_, vida *v_)
Construtor do view.
Definition: view.cpp:23
void quit()
Encerramento.
Definition: view.cpp:255
pontos * po
Definition: view.h:30
std::vector< tijolo > & t
Definition: view.h:27
barra * ba
Definition: view.h:29
SDL_Rect Message_Pontos_rect
Definition: view.h:44
Classe para os pontos.
Definition: pontos.h:8
void render()
Renderizacao.
Definition: view.cpp:160
int getHeigth()
Definition: view.cpp:35
TTF_Font * Font
Definition: view.h:40
const Uint8 * state
Definition: view.h:39
SDL_Rect * getBloco()
Definition: view.cpp:26
SDL_Rect * getBolinha()
Definition: view.cpp:27
SDL_Rect Message_VidaValue_rect
Definition: view.h:45
void render_text(SDL_Renderer *renderer, int x, int y, const char *text, TTF_Font *font, SDL_Rect *rect, SDL_Color *color)
Renderiza um texto.
Definition: view.cpp:230
void ganhou()
Vitoria.
Definition: view.cpp:216
Classe para a barra.
Definition: barra.h:11
Classe para os pontos.
Definition: vida.h:8
SDL_Rect target
Definition: view.h:36
SDL_Rect Message_Fim_rect
Definition: view.h:43
int quantidadeTijolos()
const Uint8 * getState()
Definition: view.cpp:38
vida * v
Definition: view.h:31
SDL_Rect bloco
Definition: view.h:35
Classe para a bolinha.
Definition: bolinha.h:11
int init()
Rotina de inicializacao.
Definition: view.cpp:42
SDL_Rect bar
Definition: view.h:38
int getWidth()
Definition: view.cpp:34
SDL_Rect Message_PointValue_rect
Definition: view.h:46
pontos * getPonto()
Definition: view.cpp:30
vida * getVida()
Definition: view.cpp:31
SDL_Rect * getTarget()
Definition: view.cpp:25
SDL_Rect * getBarra()
Definition: view.cpp:28
SDL_Renderer * renderer
Definition: view.h:34
void perdeu()
Derrota.
Definition: view.cpp:203
SDL_Rect Message_Vida_rect
Definition: view.h:42
Classe para o view.
Definition: view.h:24
SDL_Rect bol
Definition: view.h:37