public Concept(concept_ID ID, string word) { this.ID = ID; word_asso = new List <string>(); word_asso.Add(word); posX = posY = 0f; }
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; }
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); }
// 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); }
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); }
// 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); }
// 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)); }
// 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)); }