@@ -72,39 +72,71 @@ public void setNbVictoire(int nbVictoire) {
72
72
73
73
public List <Exploit > getCartes () {return cartes ;}
74
74
75
- public void addCartes (Exploit c ){cartes .add (c );}
75
+ void addCartes (Exploit c ){cartes .add (c );}
76
76
77
77
public void adderFace (Face FaceDe ) {
78
78
Choix Courant = new Choix ();
79
79
Courant .addChoixList ();
80
80
int rand = Courant .getChoixList (0 );
81
81
int rand2 = Courant .getChoixList (1 );
82
+
82
83
if (FaceDe .getType () == NORMAL ){
83
- if (FaceDe .getRes () == Ressource .OR ) this .setNbOR (this .getNbOR () + FaceDe .getValeur ());
84
- if (FaceDe .getRes () == Ressource .SOLAIRE ) this .setNbSolaire (this .getNbSolaire () + FaceDe .getValeur ());
85
- if (FaceDe .getRes () == Ressource .LUNAIRE ) this .setNbLunaire (this .getNbLunaire () + FaceDe .getValeur ());
86
- if (FaceDe .getRes () == Ressource .VICTOIRE ) this .setNbVictoire (this .getNbVictoire () + FaceDe .getValeur ());
84
+ if (FaceDe .getRes () == Ressource .OR ) {
85
+ this .setNbOR (this .getNbOR () + FaceDe .getValeur ());
86
+ if (this .getNbOR () < 0 ) this .setNbOR (0 );
87
+
88
+ }
89
+ if (FaceDe .getRes () == Ressource .SOLAIRE ){
90
+ this .setNbSolaire (this .getNbSolaire () + FaceDe .getValeur ());
91
+ if (this .getNbLunaire () < 0 ) this .setNbLunaire (0 );
92
+
93
+ }
94
+ if (FaceDe .getRes () == Ressource .LUNAIRE ){
95
+ this .setNbLunaire (this .getNbLunaire () + FaceDe .getValeur ());
96
+ if (this .getNbSolaire () < 0 ) this .setNbSolaire (0 );
97
+
98
+ }
99
+ if (FaceDe .getRes () == Ressource .VICTOIRE ){
100
+ this .setNbVictoire (this .getNbVictoire () + FaceDe .getValeur ());
101
+ if (this .getNbVictoire () < 0 ) this .setNbVictoire (0 );
102
+
103
+ }
104
+
87
105
}
88
106
else if (FaceDe .getType () == PLUS ){
89
107
this .setNbSolaire (this .getNbSolaire () + FaceDe .getNbSOL ());
90
108
this .setNbLunaire (this .getNbLunaire () + FaceDe .getNbLUN ());
91
109
this .setNbVictoire (this .getNbVictoire () + FaceDe .getNbVICT ());
92
110
this .setNbOR (this .getNbOR () + FaceDe .getNbOR ());
111
+ if (this .getNbOR () < 0 ) this .setNbOR (0 );
112
+ if (this .getNbLunaire () < 0 ) this .setNbLunaire (0 );
113
+ if (this .getNbSolaire () < 0 ) this .setNbSolaire (0 );
114
+ if (this .getNbVictoire () < 0 ) this .setNbVictoire (0 );
115
+
93
116
}
94
117
else if (FaceDe .getType () == CHOIX && FaceDe .getNbSOL ()>0 ){
95
118
if (rand == 0 ){
96
- this .setNbOR (this .getNbOR () + FaceDe .getNbOR ());}
119
+ this .setNbOR (this .getNbOR () + FaceDe .getNbOR ());
120
+ if (this .getNbOR () < 0 ) this .setNbOR (0 );
121
+ }
97
122
if (rand == 1 ){
98
123
this .setNbSolaire (this .getNbSolaire () + FaceDe .getNbSOL ());
124
+ if (this .getNbLunaire () < 0 ) this .setNbLunaire (0 );
99
125
}
100
126
if (rand == 2 ){
101
127
this .setNbLunaire (this .getNbLunaire () + FaceDe .getNbLUN ());
128
+ if (this .getNbSolaire () < 0 ) this .setNbSolaire (0 );
102
129
}
103
130
else if (FaceDe .getType () == CHOIX && FaceDe .getNbSOL ()>0 ){
104
131
if (rand2 == 0 ){
105
- this .setNbOR (this .getNbOR () + FaceDe .getNbOR ());}
132
+ this .setNbOR (this .getNbOR () + FaceDe .getNbOR ());
133
+ if (this .getNbOR () < 0 ) this .setNbOR (0 );
134
+ }
135
+ }
136
+ else {
137
+ this .setNbVictoire (this .getNbVictoire () + FaceDe .getNbVICT ());
138
+ if (this .getNbVictoire () < 0 ) this .setNbVictoire (0 );
106
139
}
107
- else { this .setNbVictoire (this .getNbVictoire () + FaceDe .getNbVICT ());}
108
140
}
109
141
110
142
}
0 commit comments