Feat: Ajout de la classe ligne pour la partie 2.

This commit is contained in:
Amaël Kesteman
2026-01-07 17:57:18 +01:00
parent 816b1e3965
commit cd4fb99429
3 changed files with 225 additions and 121 deletions

View File

@@ -8,6 +8,13 @@ export class User{
role!: Role;
}
export class Ligne{
id!: number;
nom!: String;
composition!: Athlete[] //les joueurs compososant la ligne
tempsDeJeu!: number; // en minutes
}
export class Admin extends User{
role!: Role;
@@ -37,6 +44,7 @@ export class Session{
athletes!: Athlete[]
duree! : number;
groupe! : Groupe;
ligne! : Ligne[];
}
export class Activite{
@@ -54,24 +62,6 @@ export function getUserTest():User{
const s1 = new Session();
const s2 = new Session();
const s3 = new Session();
user.id = 0;
user.nom = "Emilien-Yee NootNoot";
user.role = "Coach"
s1.creneau = new Date();
s1.id = 1;
s1.name = "Entrainement Frisbee"
s1.isRecurrent = true;
var date2 = new Date();
date2.setDate(date2.getDate() + 2);
s2.creneau = date2;
s2.id = 2;
s2.isRecurrent = false;
s2.name = "entraintement 2"
s3.creneau = date2;
s3.id = 3;
s3.isRecurrent = false;
s3.name = "entraintement 3"
const athlete1 = new Athlete();
athlete1.id = 1;
athlete1.nom = "Alice Dupont";
@@ -87,6 +77,49 @@ export function getUserTest():User{
athlete3.nom = "Clara Lopez";
athlete3.groupe = "Loisir";
const ligne1 = new Ligne();
ligne1.id = 1;
ligne1.nom = "Ligne A";
ligne1.composition = [athlete1, athlete2]; // Alice + Bob
ligne1.tempsDeJeu = 45;
const ligne2 = new Ligne();
ligne2.id = 2;
ligne2.nom = "Ligne B";
ligne2.composition = [athlete2, athlete3]; // Bob + Clara
ligne2.tempsDeJeu = 40;
const ligne3 = new Ligne();
ligne3.id = 3;
ligne3.nom = "Ligne C";
ligne3.composition = [athlete1, athlete3]; // Alice + Clara
ligne3.tempsDeJeu = 50;
user.id = 0;
user.nom = "Emilien-Yee NootNoot";
user.role = "Coach"
s1.creneau = new Date();
s1.id = 1;
s1.name = "Entrainement Frisbee"
s1.isRecurrent = true;
s1.ligne = [ligne1];
var date2 = new Date();
date2.setDate(date2.getDate() + 2);
s2.creneau = date2;
s2.id = 2;
s2.isRecurrent = false;
s2.name = "entraintement 2"
s2.ligne = [ligne2];
s3.creneau = date2;
s3.id = 3;
s3.isRecurrent = false;
s3.name = "entraintement 3"
s3.ligne = [ligne3];
s1.athletes = [athlete1, athlete2];
s2.athletes = [athlete2, athlete3];
s3.athletes = [athlete1, athlete3];