diff --git a/psychorientation/images/icones/sortir.png b/psychorientation/images/icones/sortir.png new file mode 100644 index 0000000000000000000000000000000000000000..3b2233b63eb4c58ee1dc4b4ca05ff8483f694b47 Binary files /dev/null and b/psychorientation/images/icones/sortir.png differ diff --git a/psychorientation/psychorientation/GestionnaireEleve.cs b/psychorientation/psychorientation/GestionnaireEleve.cs index 0b9e1cfd62cc0099d718cc6a4b452e537dfc1e0b..9ee450348c4cd42c0d90ae0f581707843b071de5 100644 --- a/psychorientation/psychorientation/GestionnaireEleve.cs +++ b/psychorientation/psychorientation/GestionnaireEleve.cs @@ -8,79 +8,77 @@ namespace psychorientation { public class GestionnaireEleve { - private List<Eleve> listEleve = new List<Eleve>(); + private List<Eleve> listeEleves = new List<Eleve>(); - public GestionnaireEleve() - { - } + public GestionnaireEleve() {} public void AjouterEleve(Eleve e) { - this.listEleve.Add(e); + this.listeEleves.Add(e); } public void SupprimerEleve(Eleve e) { - this.listEleve.Remove(e); + this.listeEleves.Remove(e); } public void SupprimerEleve(int indice) { - this.listEleve.RemoveAt(indice); + this.listeEleves.RemoveAt(indice); } - public List<Eleve> GetListEleve() + public List<Eleve> GetListeEleves() { - return this.listEleve; + return this.listeEleves; } public Eleve GetEleve(int indice) { - return this.listEleve[indice]; + return this.listeEleves[indice]; } public double GetMoyenneClasse() { double res = -1; - if (this.listEleve.Count > 0) + if (this.listeEleves.Count > 0) { - foreach (Eleve el in this.listEleve) + foreach (Eleve el in this.listeEleves) { res += el.GetMoyenne(); } } - return res / this.listEleve.Count; + return res / this.listeEleves.Count; } public double GetCompetenceClasse() { double res = -1; - if (this.listEleve.Count > 0) + if (this.listeEleves.Count > 0) { - foreach (Eleve el in this.listEleve) + foreach (Eleve el in this.listeEleves) { res += el.GetCompetence(); } } - return res / this.listEleve.Count; + return res / this.listeEleves.Count; } public double GetEffortClasse() { double res = -1; - if (this.listEleve.Count > 0) + if (this.listeEleves.Count > 0) { - foreach (Eleve el in this.listEleve) + foreach (Eleve el in this.listeEleves) { res += el.GetEffort(); } } - return res / this.listEleve.Count; + return res / this.listeEleves.Count; } public void FaireControle(string nom) { - foreach (Eleve e in this.listEleve) + foreach (Eleve e in this.listeEleves) { e.AjouterNote(nom); } @@ -89,14 +87,14 @@ namespace psychorientation public double GetAppreciationClasse() { double res = -1; - if (this.listEleve.Count > 0) + if (this.listeEleves.Count > 0) { - foreach (Eleve el in this.listEleve) + foreach (Eleve el in this.listeEleves) { res += el.GetAppreciation(); } } - return res / this.listEleve.Count; + return res / this.listeEleves.Count; } } diff --git a/psychorientation/psychorientation/InterfaceClasse.Designer.cs b/psychorientation/psychorientation/InterfaceClasse.Designer.cs index 32b648a11f5e8df1fc224ac66f2efb33477d7e3a..663153299a2431765e1cc7dd4390bc1441332be4 100644 --- a/psychorientation/psychorientation/InterfaceClasse.Designer.cs +++ b/psychorientation/psychorientation/InterfaceClasse.Designer.cs @@ -31,8 +31,10 @@ this.pb_action_suivante = new System.Windows.Forms.PictureBox(); this.pb_liste_eleves = new System.Windows.Forms.PictureBox(); this.lbl_date = new System.Windows.Forms.Label(); + this.pb_sortir = new System.Windows.Forms.PictureBox(); ((System.ComponentModel.ISupportInitialize)(this.pb_action_suivante)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pb_liste_eleves)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pb_sortir)).BeginInit(); this.SuspendLayout(); // // pb_action_suivante @@ -68,6 +70,17 @@ this.lbl_date.TabIndex = 2; this.lbl_date.Text = "Chargement..."; // + // pb_sortir + // + this.pb_sortir.BackgroundImage = global::psychorientation.Properties.Resources.sortir; + this.pb_sortir.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.pb_sortir.Location = new System.Drawing.Point(1283, -1); + this.pb_sortir.Name = "pb_sortir"; + this.pb_sortir.Size = new System.Drawing.Size(75, 75); + this.pb_sortir.TabIndex = 3; + this.pb_sortir.TabStop = false; + this.pb_sortir.Click += new System.EventHandler(this.Pb_sortir_Click); + // // InterfaceClasse // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -76,6 +89,7 @@ this.BackgroundImage = global::psychorientation.Properties.Resources.salleV1; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.ClientSize = new System.Drawing.Size(1357, 783); + this.Controls.Add(this.pb_sortir); this.Controls.Add(this.lbl_date); this.Controls.Add(this.pb_liste_eleves); this.Controls.Add(this.pb_action_suivante); @@ -90,6 +104,7 @@ this.SizeChanged += new System.EventHandler(this.InterfaceClasse_SizeChanged); ((System.ComponentModel.ISupportInitialize)(this.pb_action_suivante)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pb_liste_eleves)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pb_sortir)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -100,6 +115,7 @@ private System.Windows.Forms.PictureBox pb_action_suivante; private System.Windows.Forms.PictureBox pb_liste_eleves; private System.Windows.Forms.Label lbl_date; + private System.Windows.Forms.PictureBox pb_sortir; } } diff --git a/psychorientation/psychorientation/InterfaceClasse.cs b/psychorientation/psychorientation/InterfaceClasse.cs index 245588fa525c59390383fa43092bc7b2e3d7d8ca..d28b2e6054fbe55ba630b9ee47289c08239cad7f 100644 --- a/psychorientation/psychorientation/InterfaceClasse.cs +++ b/psychorientation/psychorientation/InterfaceClasse.cs @@ -74,8 +74,20 @@ namespace psychorientation private void InterfaceClasse_SizeChanged(object sender, EventArgs e) { - PictureBox pb = pb_action_suivante; - pb.Location = new Point(Size.Width - pb.Width - 32, Size.Height - pb.Height - 32); + PictureBox pb1 = pb_action_suivante; + pb1.Location = new Point(Size.Width - pb1.Width - 32, Size.Height - pb1.Height - 32); + + PictureBox pb2 = pb_sortir; + pb2.Location = new Point(Size.Width - pb2.Width, 0); + } + + private void Pb_sortir_Click(object sender, EventArgs e) + { + if (MessageBox.Show("Souhaitez-vous quitter le jeu ?\nVous perdrez alors votre progression dans la partie en cours.", + "Confirmation de fermeture", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.Yes) + { + Close(); + } } } } diff --git a/psychorientation/psychorientation/InterfaceInfoEleve.cs b/psychorientation/psychorientation/InterfaceInfoEleve.cs index b499ea9bb2b2851d33bfd02f3e8e3354112c7b3b..10b55ce24544cfc59941be05f50339040df71508 100644 --- a/psychorientation/psychorientation/InterfaceInfoEleve.cs +++ b/psychorientation/psychorientation/InterfaceInfoEleve.cs @@ -32,7 +32,7 @@ namespace psychorientation private void actualiser() { Libelle lib = new Libelle(); - lblEleve.Text = "Eleve n°"+eleve.GetId(); + lblEleve.Text = "Eleve n°" + eleve.GetId(); lblClasse.Text = lib.Niveau(eleve.GetClasse()); lblEffort.Text = eleve.GetEffort().ToString(); lblCompetence.Text = eleve.GetCompetence().ToString(); diff --git a/psychorientation/psychorientation/ListeEleve.cs b/psychorientation/psychorientation/ListeEleve.cs index d7bc218ef415567537e7e0f16fc61f061009624a..c9d7fec3aeb2a2f17a784bba54462dd6a0b4dbe4 100755 --- a/psychorientation/psychorientation/ListeEleve.cs +++ b/psychorientation/psychorientation/ListeEleve.cs @@ -28,7 +28,7 @@ namespace psychorientation gestEleve.AjouterEleve(el1); gestEleve.AjouterEleve(el2); - List<Eleve> listEleve = gestEleve.GetListEleve(); + List<Eleve> listEleve = gestEleve.GetListeEleves(); int y = 0; foreach ( Eleve eleve in listEleve) { diff --git a/psychorientation/psychorientation/Properties/Resources.Designer.cs b/psychorientation/psychorientation/Properties/Resources.Designer.cs index c94656df38b45e13beac46c0cfa28eb826f96cf2..3d8b1ed594f737fec479a74cc6e506dd1b678fb7 100644 --- a/psychorientation/psychorientation/Properties/Resources.Designer.cs +++ b/psychorientation/psychorientation/Properties/Resources.Designer.cs @@ -79,5 +79,15 @@ namespace psychorientation.Properties { return ((System.Drawing.Bitmap)(obj)); } } + + /// <summary> + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap sortir { + get { + object obj = ResourceManager.GetObject("sortir", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/psychorientation/psychorientation/Properties/Resources.resx b/psychorientation/psychorientation/Properties/Resources.resx index 883a18036ccf14c67d61d71fd433abd4156f5d52..0fa817a24a41468322b11bc88995240cc2c497fd 100644 --- a/psychorientation/psychorientation/Properties/Resources.resx +++ b/psychorientation/psychorientation/Properties/Resources.resx @@ -124,4 +124,7 @@ <data name="salleV1" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\salleV1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> + <data name="sortir" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\sortir.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> </root> \ No newline at end of file diff --git a/psychorientation/psychorientation/Resources/sortir.png b/psychorientation/psychorientation/Resources/sortir.png new file mode 100644 index 0000000000000000000000000000000000000000..3b2233b63eb4c58ee1dc4b4ca05ff8483f694b47 Binary files /dev/null and b/psychorientation/psychorientation/Resources/sortir.png differ diff --git a/psychorientation/psychorientation/eleve.cs b/psychorientation/psychorientation/eleve.cs index 645785708b8726e6423adabcac46916662715d6d..11b003456097a9ed081df10eb1e791fb23960688 100644 --- a/psychorientation/psychorientation/eleve.cs +++ b/psychorientation/psychorientation/eleve.cs @@ -13,7 +13,7 @@ namespace psychorientation private double effort = 0; private int orientation = 0; private int id; - private List<Note> listNote = new List<Note>(); + private List<Note> listeNotes = new List<Note>(); private double appreciation; public Eleve(int id) @@ -60,9 +60,9 @@ namespace psychorientation { return this.competence; } - public List<Note> GetListNote() + public List<Note> GetlisteNotes() { - return this.listNote; + return this.listeNotes; } public int GetId() { @@ -86,26 +86,32 @@ namespace psychorientation return this.appreciation; } - - public double GetMoyenne() { - double res = -1; - if (this.listNote.Count > 0) + if (this.listeNotes.Count == 0) {return -1;} + double res = 0; + if (this.listeNotes.Count > 0) { - foreach(Note n in listNote) + foreach(Note n in listeNotes) { res += n.getNote(); } } - return res/ this.listNote.Count; + return res / this.listeNotes.Count; } + + public void Progression(double typeEducation) + { + this.competence += (this.effort - typeEducation) / competence * 2; + this.effort += (this.effort - typeEducation) / competence * 2; + } + public void AjouterNote(string nom) { - Note n = new Note(nom,CalculerNote() , this.competence, this.effort); - this.listNote.Add(n); + Note n = new Note(nom, CalculerNote(), this.competence, this.effort); + this.listeNotes.Add(n); } private double CalculerNote() diff --git a/psychorientation/psychorientation/psychorientation.csproj b/psychorientation/psychorientation/psychorientation.csproj index b5934bb014aa83862d3ad4403566ef7accf577cb..546e8535aaf02390e508ddcf7da6e1431c021deb 100644 --- a/psychorientation/psychorientation/psychorientation.csproj +++ b/psychorientation/psychorientation/psychorientation.csproj @@ -124,5 +124,13 @@ <ItemGroup> </ItemGroup> <ItemGroup> + <None Include="Resources\passer.png" /> + </ItemGroup> + <ItemGroup> + <None Include="Resources\salleV1.png" /> + </ItemGroup> + <ItemGroup> + <None Include="Resources\sortir.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project> \ No newline at end of file