From 0bdf50b5ff10444fb50df161cadb5d2cd705bf1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Antoine=20F=C3=A9lix?= <felixantoine67@yahoo.fr>
Date: Fri, 3 Apr 2020 10:30:56 +0200
Subject: [PATCH] =?UTF-8?q?Pr=C3=A9paration=20des=20d=C3=A9pendances=20et?=
 =?UTF-8?q?=20ajout=20d'une=20version=20portable.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 psychorientation/psychorientation/Config.cs   | 55 -------------------
 psychorientation/psychorientation/eleve.cs    |  8 +--
 .../psychorientation/psychorientation.csproj  |  1 -
 3 files changed, 4 insertions(+), 60 deletions(-)
 delete mode 100644 psychorientation/psychorientation/Config.cs

diff --git a/psychorientation/psychorientation/Config.cs b/psychorientation/psychorientation/Config.cs
deleted file mode 100644
index cb21581..0000000
--- a/psychorientation/psychorientation/Config.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.IO;
-using System.Threading.Tasks;
-using Newtonsoft.Json;
-
-namespace psychorientation
-{
-    class Config
-    {
-        private static Config instance;
-
-        public double coeffEffortOral;
-        public double coeffCompetenceOral;
-
-        public double coeffCompetenceEcrit;
-        public double coeffEffortEcrit;
-
-        public static Config GetInstance()
-        {
-            if (Config.instance == null)
-            {
-
-                Config.instance = JsonConvert.DeserializeObject<Config>(File.ReadAllText("config.json"));
-                return Config.instance;
-            }
-            else
-            {
-                return Config.instance;
-            }
-        }
-
-        public double GetCoeffEffortOral()
-        {
-            return this.coeffEffortOral;
-        }
-
-        public double GetCoeffCompetenceOral()
-        {
-            return this.coeffCompetenceOral;
-        }
-
-        public double GetCoeffCompetenceEcrit()
-        {
-            return this.coeffCompetenceEcrit;
-        }
-
-        public double GetCoeffEffortEcrit()
-        {
-            return this.coeffEffortEcrit;
-        }
-    }
-}
diff --git a/psychorientation/psychorientation/eleve.cs b/psychorientation/psychorientation/eleve.cs
index 60bf568..0e5dfb4 100644
--- a/psychorientation/psychorientation/eleve.cs
+++ b/psychorientation/psychorientation/eleve.cs
@@ -25,7 +25,7 @@ namespace psychorientation
             this.competence = Eleve.r.NextDouble()*10;
             this.effort = Eleve.r.NextDouble()*10;
             this.orientation = 0;
-            this.appreciation=CalculerAppreciation();
+            this.appreciation=CalculerAppreciation(1);
         }
 
         public Eleve(int id,int classe, double competence, double effort, int orientation)
@@ -35,7 +35,7 @@ namespace psychorientation
             this.competence = competence;
             this.effort = effort;
             this.orientation = orientation;
-            this.appreciation = CalculerAppreciation();
+            this.appreciation = CalculerAppreciation(1);
         }
         public void SetClasse(int classe)
         {
@@ -161,9 +161,9 @@ namespace psychorientation
             return (this.effort * (2 - coeff) + this.competence * coeff);
         }
 
-        private double CalculerAppreciation()
+        private double CalculerAppreciation(double coeff)
         {
-            return (this.effort * Config.GetInstance().GetCoeffEffortOral() + this.competence * Config.GetInstance().GetCoeffCompetenceOral());
+            return (this.effort * (2 - coeff) + this.competence * coeff);
         }
     }
 }
diff --git a/psychorientation/psychorientation/psychorientation.csproj b/psychorientation/psychorientation/psychorientation.csproj
index b1e0e20..a24c009 100644
--- a/psychorientation/psychorientation/psychorientation.csproj
+++ b/psychorientation/psychorientation/psychorientation.csproj
@@ -50,7 +50,6 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Config.cs" />
     <Compile Include="Eleve.cs" />
     <Compile Include="InterfaceClasse.cs">
       <SubType>Form</SubType>
-- 
GitLab