Skip to content
Snippets Groups Projects
Commit 4d6052fc authored by Antoine Félix's avatar Antoine Félix
Browse files

Ajout d'une classe "Libele.cs" pour accéder aux libelés.

parent f2146ab8
Branches
No related merge requests found
......@@ -12,12 +12,9 @@ namespace psychorientation
{
public partial class InterfaceClasse : Form
{
private List<String> libele_mois = new List<String>()
{"Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"};
private List<String> libele_niveau = new List<String>()
{"Seconde", "Première", "Terminale"};
private int mois_actuel = 8;
private int annee_actuelle = 0;
private Libele libele = Libele.GetInstance();
private int moisActuel = 8;
private int anneeActuelle = 0;
public InterfaceClasse()
{
......@@ -27,7 +24,7 @@ namespace psychorientation
private void Form1_Load(object sender, EventArgs e)
{
lbl_date.Text = libele_mois[(mois_actuel % 12)] + " " + libele_niveau[annee_actuelle];
lbl_date.Text = libele.Mois(moisActuel % 12) + " " + libele.Niveau(anneeActuelle);
TypeMessage tm = TypeMessage.INFORMATION;
Message m = new Message(-1,"Bonjour apprenti prof, vous allez apprendre à éduquer des joueurs !! ", "Début", tm);
......@@ -44,16 +41,16 @@ namespace psychorientation
}
// Passe au mois suivant.
mois_actuel++;
switch(mois_actuel)
moisActuel++;
switch(moisActuel)
{
case 17: // Fin de la 1ère année : Début Juin.
mois_actuel = 20;
annee_actuelle = 1;
moisActuel = 20;
anneeActuelle = 1;
break;
case 29: // Fin de la 2nde année : Début Juin.
mois_actuel = 32;
annee_actuelle = 2;
moisActuel = 32;
anneeActuelle = 2;
break;
case 42: // Fin de la 3ème année : Debut Juillet.
// Fin de la partie.
......@@ -68,7 +65,7 @@ namespace psychorientation
break;
}
lbl_date.Text = libele_mois[(mois_actuel % 12)] + " " + libele_niveau[annee_actuelle];
lbl_date.Text = libele.Mois(moisActuel % 12) + " " + libele.Niveau(anneeActuelle);
}
private void Pb_liste_eleves_Click(object sender, EventArgs e)
......
......@@ -8,8 +8,35 @@ namespace psychorientation
{
class Libele
{
private List<String> libele_mois;
private List<String> libele_niveau;
private List<string> libele_mois = new List<string>()
{"Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"};
private List<string> libele_niveau = new List<string>()
{"Seconde", "Première", "Terminale"};
private static Libele instance;
public Libele() {}
public static Libele GetInstance()
{
if(Libele.instance == null)
{
Libele.instance = new Libele();
return Libele.instance;
}
else
{
return Libele.instance;
}
}
public string Mois(int n)
{
return this.libele_mois[n];
}
public string Niveau(int n)
{
return this.libele_niveau[n];
}
}
}
......@@ -64,6 +64,7 @@
<Compile Include="InterfaceInfoEleve.Designer.cs">
<DependentUpon>InterfaceInfoEleve.cs</DependentUpon>
</Compile>
<Compile Include="Libele.cs" />
<Compile Include="Message.cs">
<SubType>Form</SubType>
</Compile>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment