-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcarte.cpp
More file actions
51 lines (37 loc) · 1.03 KB
/
carte.cpp
File metadata and controls
51 lines (37 loc) · 1.03 KB
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
#include "carte.h"
//*Constructeurs
Carte::Carte(){
}
Carte::Carte(TextureManager &TM, std::string adr1, std::string adr2, std::string adr3)
{
firstPlan.setTexture(*(TM.GetTexture(adr1)));
firstPlan.setPosition(0,0);
secondPlan.setTexture(*(TM.GetTexture(adr2)));
secondPlan.setPosition(0,0);
thirdPlan.setTexture(*(TM.GetTexture(adr3)));
secondPlan.setPosition(0,0);
}
//*/
//*Methodes
void Carte::afficher(sf::RenderWindow& App,std::string txt){
if (txt.compare("first") == 0)
App.draw(firstPlan);
else if(txt.compare("second") == 0)
App.draw(secondPlan);
else if(txt.compare("third") == 0)
App.draw(thirdPlan);
}
//*/
//*Getters
sf::Sprite& Carte::get_image(std::string txt){
if (txt.compare("first") == 0)
return firstPlan;
else if(txt.compare("second"))
return secondPlan;
else if(txt.compare("third"))
return thirdPlan;
}
//*/
void Carte::set_Map(TextureManager & TM,std::string adr){
firstPlan.setTexture(*(TM.GetTexture(adr)));
}