diff --git a/psychorientation/psychorientation/InterfaceClasse.cs b/psychorientation/psychorientation/InterfaceClasse.cs index f8469b220b3939337cc4c315a4279ae408a8e223..069dcc1e4628a505a7f541c207818b62395b61cd 100644 --- a/psychorientation/psychorientation/InterfaceClasse.cs +++ b/psychorientation/psychorientation/InterfaceClasse.cs @@ -21,7 +21,6 @@ namespace psychorientation InitializeComponent(); } - private void Form1_Load(object sender, EventArgs e) { lbl_date.Text = libelle.Mois(moisActuel % 12) + " " + libelle.Niveau(anneeActuelle); @@ -53,11 +52,13 @@ namespace psychorientation break; case 42: // Fin de la 3ème année : Debut Juillet. // Fin de la partie. - Message m_fin = new Message(-1, "Vous avez fini la phase bêta de ce jeu !\n" + - "Bravo à vous et n'hésitez pas à essayer à nouveau pour " + - "améliorer votre compréhension du monde extérieur.", - "Félicitations", - TypeMessage.INFORMATION + Message m_fin = new Message( + -1, + "Vous avez fini la phase bêta de ce jeu !\n" + + "Bravo à vous et n'hésitez pas à essayer à nouveau pour " + + "améliorer votre compréhension du monde extérieur.", + "Félicitations", + TypeMessage.INFORMATION ); m_fin.ShowDialog(); Close(); diff --git a/psychorientation/psychorientation/Note.cs b/psychorientation/psychorientation/Note.cs index f8363bb657d2d0a50f2abecc398d00d23a80cc6c..9b9b8a6a6d6ab0dc9717c3943f665e1e58322f94 100644 --- a/psychorientation/psychorientation/Note.cs +++ b/psychorientation/psychorientation/Note.cs @@ -21,22 +21,22 @@ namespace psychorientation this.effort = effort; } - public string getNom() + public string GetNom() { return this.nom; } - public double getNote() + public double GetNote() { return this.note; } - public double getCompetence() + public double GetCompetence() { return this.competence; } - public double getEffort() + public double GetEffort() { return this.effort; } diff --git a/psychorientation/psychorientation/eleve.cs b/psychorientation/psychorientation/eleve.cs index 11b003456097a9ed081df10eb1e791fb23960688..3623a7e2a3595940541841941652a919ae08d433 100644 --- a/psychorientation/psychorientation/eleve.cs +++ b/psychorientation/psychorientation/eleve.cs @@ -104,14 +104,60 @@ namespace psychorientation public void Progression(double typeEducation) { - this.competence += (this.effort - typeEducation) / competence * 2; - this.effort += (this.effort - typeEducation) / competence * 2; + double t_competence = competence; + this.competence += (this.effort - typeEducation) * (1 - (competence * 0.1)) * (1.0 / 12); + + if (competence < 0) { competence = 0; } + else if (competence > 10) { competence = 10; } + + if (t_competence != typeEducation) + this.effort += Math.Min(Math.Max(((1 / Math.Abs(t_competence - typeEducation)) - (1.0 / 3)) * 3, -1), 1) * 0.5; + else + this.effort += 0.5; + + if (effort < 0) { effort = 0; } + else if (effort > 10) { effort = 10; } } public void AjouterNote(string nom) { Note n = new Note(nom, CalculerNote(), this.competence, this.effort); this.listeNotes.Add(n); + + double note = n.GetNote(); + double note_convenable = 10 + (competence - 5); + if (effort > 5) + { + if (note > note_convenable) + { + effort += 0.25; + } + else + { + effort -= 0.5; + } + } + else + { + if (note > note_convenable) + { + effort -= 0.25; + } + else + { + if(competence > 5) + { + effort += 1; + } + else + { + effort -= 0.5; + } + } + } + + if (effort < 0) { effort = 0; } + else if (effort > 10) { effort = 10; } } private double CalculerNote() diff --git a/psychorientation/psychorientation/psychorientation.csproj b/psychorientation/psychorientation/psychorientation.csproj index 5719a11eca1aa7464e1fcc6b96961b6595d957c8..3a279eefed3d5530fdf677b74bdba5e539370972 100644 --- a/psychorientation/psychorientation/psychorientation.csproj +++ b/psychorientation/psychorientation/psychorientation.csproj @@ -125,5 +125,8 @@ <ItemGroup> <None Include="Resources\sortir.png" /> </ItemGroup> + <ItemGroup> + <None Include="Resources\grp.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project> \ No newline at end of file