-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathZoneCarte.cpp
More file actions
50 lines (34 loc) · 856 Bytes
/
ZoneCarte.cpp
File metadata and controls
50 lines (34 loc) · 856 Bytes
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
#include "ZoneCarte.h"
/**
* Constructeur
*
*/
ZoneCarte::ZoneCarte(): limY_(550)
{
//ctor
if(!texture.loadFromFile("Images/carteVide.png")){}
}
/**
* Methode qui affiche les cartes d'un joueur
*@param window la fenetre de rendu
*/
void ZoneCarte::afficherCarte(Joueur j, sf::RenderWindow &window){
vector<Carte*> vec = j.getCarteDepart();
int posx=0;
sf::Sprite sp;
for(unsigned int j=0; j < vec.size(); j++){
sp.setTexture(vec.at(j)->getTexture());
sp.setPosition(posx,limY_);
window.draw(sp);
posx+=108;
}
if(posx < 1296){
//on met la texture par defaut carte vide
sp.setTexture(texture);
for(unsigned int j=0; j < 12-vec.size(); j++){
sp.setPosition(posx,limY_);
window.draw(sp);
posx+=108;
}
}
}