Пример #1
0
 public Concept(concept_ID ID, string word)
 {
     this.ID   = ID;
     word_asso = new List <string>();
     word_asso.Add(word);
     posX = posY = 0f;
 }
Пример #2
0
 public Concept(concept_ID ID, string word, float posX, float posY)
 {
     this.ID   = ID;
     word_asso = new List <string>();
     word_asso.Add(word);
     this.posX = posX;
     this.posY = posY;
 }
Пример #3
0
 public Response(List <string> words, concept_ID ID)
 {
     if ((words == null) || (words.Count == 0) || (words[0].Equals("")))
     {
         throw new Exception("Word can't be empty !");
     }
     listeMotsPossibles = words;
     responseConcepts   = new List <concept_ID>();
     responseConcepts.Add(ID);
 }
Пример #4
0
 // retrouve la Response d'un ID dans la liste
 public static Response getResponseByID(concept_ID ID)
 {
     foreach (Response rep in responses)
     {
         if (rep.responseConcepts.Contains(ID))
         {
             return(rep);
         }
     }
     return(null);
 }
Пример #5
0
 public Response(string word, concept_ID ID)
 {
     if ((word == null) || (word.Equals("")))
     {
         throw new Exception("Word can't be empty !");
     }
     listeMotsPossibles = new List <string>();
     listeMotsPossibles.Add(word);
     responseConcepts = new List <concept_ID>();
     responseConcepts.Add(ID);
 }
Пример #6
0
 // retrouve le concept d'un ID dans la liste
 public static Concept getConceptByID(concept_ID ID)
 {
     foreach (Concept c in concepts)
     {
         if (c.ID == ID)
         {
             return(c);
         }
     }
     return(null);
 }
Пример #7
0
 // ajout a la liste des concepts
 public static void addToConcepts(concept_ID ID, string word)
 {
     for (int iC = 0; iC < concepts.Count; ++iC)
     {
         if (concepts[iC].ID == ID)
         {
             if (concepts[iC].word_asso.Contains(word))
             {
                 return;
             }
             concepts[iC].word_asso.Add(word);
             return;
         }
     }
     concepts.Add(new Concept(ID, word));
 }
Пример #8
0
 // ajout d'un concept a une reponse
 public static void addToResponses(string text, concept_ID ID)
 {
     foreach (Response rep  in responses)
     {
         if (rep.responseConcepts.Contains(ID))
         {
             // Le concept est déjà dans la liste
             if (!rep.listeMotsPossibles.Contains(text))
             {
                 rep.listeMotsPossibles.Add(text);
             }
             return;
         }
     }
     responses.Add(new Response(text, ID));
 }