Subversion Repository Public Repository

Fangh

Diff Revisions 41 vs 42 for /trunk/FenetreCV.cpp

Diff revisions: vs.
  @@ -4,7 +4,6 @@
4 4 #include "experience.h"
5 5 #include "offre.h"
6 6 #include "jeu.h"
7 - #include "personnage.h"
8 7 #include <QtGui>
9 8
10 9 FenetreCV::FenetreCV(){
  @@ -14,14 +13,12 @@
14 13
15 14 FenetreCV::FenetreCV(MainWindow * _parent, QString &_imageName) : IWidget(_parent, _imageName) {
16 15
17 - Jeu *j = parentWindow->getJeu();
18 - Personnage * pers = (Personnage *) j->getPersonnage();
19 16
20 17 creerBoutons();
21 - cv = new CV();
18 + // cv = new CV();
22 19 imgCV = new QLabel(this);
23 20
24 - const Offre * off = j->getOffreActuelle();
21 + const Offre * off = parentWindow->getJeu()->getOffreActuelle();
25 22 QString bg("../Ressources/fond_offre.png");
26 23
27 24 WidgetOffre * wOffre = new WidgetOffre(bg,(Offre*)off);
  @@ -31,12 +28,7 @@
31 28
32 29 std::vector<Competence>::iterator itvectorCompetence;
33 30 int cpt = 0;
34 - for(itvectorCompetence = ((std::vector<Competence> *)j->getPersonnage()->getListeCompetence())->begin();
35 - itvectorCompetence != ((std::vector<Competence> *)j->getPersonnage()->getListeCompetence())->end();
36 - itvectorCompetence++){
37 - vectorCompetence.push_back((*(std::vector<Competence> *)j->getPersonnage()->getListeCompetence())[cpt]);
38 - cpt++;
39 - }
31 + vectorCompetence = *(parentWindow->getJeu()->getPersonnage()->getListeCompetence());
40 32 QImage fond("../Ressources/zoneD.png");
41 33 QPixmap pixfond(fond.width(),fond.height());
42 34 QPainter paintfond(&pixfond);
  @@ -68,24 +60,15 @@
68 60 cpt++;
69 61 }
70 62
71 -
72 63 std::vector<Experience>::iterator itvectorExperience;
73 - cpt = 0;
74 - vectorExperience = *(j->getPersonnage()->getListeExperience());
75 - /*for(itvectorExperience = ((std::vector<Experience> *)pers->getListeExperience())->begin();
76 - itvectorExperience !=((std::vector<Experience> *)pers->getListeExperience())->end();
77 - itvectorExperience++){
78 - vectorExperience.push_back((*(std::vector<Experience> *)pers->getListeExperience())[cpt]);
79 - cpt++;
80 - }*/
81 - // paintfond.drawText(590,510,"Exp�riences : ");
64 + vectorExperience = *(parentWindow->getJeu()->getPersonnage()->getListeExperience());
82 65 QLabel * Experiences = new QLabel("Exp�riences : ",this,0);
83 66 Experiences->setFont(QFont("Times", 14, QFont::Bold));
84 67 Experiences->move(590,515);
85 - /*QLabel * exp = new QLabel(this,0);
68 + QLabel * exp = new QLabel(this,0);
86 69 exp->setPixmap(QPixmap::fromImage(fond));
87 70 exp->resize(380,130);
88 - exp->move(590,510);*/
71 + exp->move(590,510);
89 72
90 73 x = 590;
91 74 y = 400;
  @@ -105,9 +88,6 @@
105 88 cpt++;
106 89 }
107 90
108 - //QLabel * Offre = new QLabel(s,this,0);
109 - //Offre->move(89,204);
110 -
111 91 valider->resize(169,33);
112 92 valider->move(700,650);
113 93 valider->show();
  @@ -123,9 +103,8 @@
123 103 lab = itc->second;
124 104 if(lab->pos().x()>590 && lab->pos().x()<970){
125 105 if(lab->pos().y()>300 && lab->pos().y()<430){
126 - //comp->getNom();
127 - Competence c(MARTIALES, "bagarre", "pour donner des coups");
128 - cv->ajoutCompetenceFin(&vectorCompetence[itc->first]);
106 + parentWindow->getJeu()->ajouterCompetenceCV(&vectorCompetence[itc->first],1);
107 + //cv->ajoutCompetenceFin(&vectorCompetence[itc->first]);
129 108 }
130 109 }
131 110 }
  @@ -134,7 +113,8 @@
134 113 lab = ite->second;
135 114 if(lab->pos().x()>590 && lab->pos().x()<970){
136 115 if(lab->pos().y()>510 && lab->pos().y()<640){
137 - cv->ajoutExperienceFin(&vectorExperience[ite->first]);
116 + parentWindow->getJeu()->ajouterExperienceCV(&vectorExperience[ite->first],1);
117 + //cv->ajoutExperienceFin(&vectorExperience[ite->first]);
138 118 }
139 119 }
140 120 }
  @@ -154,6 +134,6 @@
154 134
155 135 }
156 136
157 - CV * FenetreCV::getCV(){
137 + /*CV * FenetreCV::getCV(){
158 138 return this->cv;
159 - }
139 + }*/