-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTile.cpp
52 lines (41 loc) · 878 Bytes
/
Tile.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "Tile.h"
#include "Territorio.h"
#include "Unidade.h"
SDL_Rect rectTile;
Tile::Tile(int _posX, int _posY, int _tipo)
{
posX = _posX;
posY = _posY;
tipo = _tipo;
ocupante = NULL;
territorio = NULL;
}
void Tile::show(bool mostrarFillRects = true)
{
if(mostrarFillRects)
{
SDL_Rect rectTile;
rectTile.x = posX*30;
rectTile.y = posY*30;
rectTile.w = 30;
rectTile.h = 30;
SDL_FillRect(screen, &rectTile, cores[tipo]);
}
if(territorio != NULL && (*territorio).nacao != NULL)
{
SDL_FillRect(transparentSurface , NULL , (*(*territorio).nacao).cor);
}
if(territorio != NULL)
{
(*drawObj).apply_surface( posX*30, posY*30, transparentSurface, screen, NULL);
}
}
void Tile::showCapital()
{
SDL_Rect rectTile;
rectTile.x = posX*30;
rectTile.y = posY*30;
rectTile.w = 30;
rectTile.h = 30;
SDL_FillRect(screen, &rectTile, 0xFFFFFF);
}