You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.1 KiB

class Equipe {
int id, score, radius;
float pos_x, pos_y;
String membres;
color couleur;
Pion pion;
Equipe(int id) {
this.id = id;
this.score = 0;
// générer un pion pour l'équipe
this.pion = new Pion(this.id);
// récupérer les valeurs de positionnement initial du pion
this.pos_x = this.pion.posX;
this.pos_y = this.pion.posY;
this.radius = this.pion.radius;
// afficher l'emplacement de l'équipe avant le pion
this.update();
}
void update() {
// affichage de l'emplacement d'équipe, qui restera toujours fixe
color bgColor = color(235, 112, 71, 0.8);
color textColor = color(200);
fill(bgColor);
stroke(bgColor);
strokeWeight(0.5);
circle(this.pos_x,this.pos_y,radius);
fill(textColor);
float textSize = this.radius/4*3;
textSize(textSize);
float pos_x = this.id<9? this.pos_x-radius/5: this.pos_x-radius/3;
text(this.id+1, pos_x, this.pos_y+radius/5);
// mise à jour du pion
this.pion.draw();
}
void setScore(int score) {
this.score = score;
//println("Equipe", this.id+1, "setScore", score);
}
}