public TextureClass AddTextureClass(string name, Color color) { if (knownClasses.Count(item => item.Name == name) > 0) { throw new TextureClassDuplicateException("Класс с таким именем уже существует"); } var result = new TextureClass(name, color); knownClasses.Add(result); return result; }
public TextureClass AddTextureClass(string name, Color color) { if (knownClasses.Count(item => item.Name == name) > 0) { throw new TextureClassDuplicateException("Класс с таким именем уже существует"); } var result = new TextureClass(name, color); knownClasses.Add(result); return(result); }
public void LoadKnowledges(string url) { RemoveAllTextureClasses(); var xml = new XmlDocument(); xml.Load(url); var classes = xml.GetElementsByTagName("class"); foreach (XmlNode item in classes) { var textureClass = new TextureClass("Texture", Color.Red); textureClass.LoadKnowledges(item); knownClasses.Add(textureClass); } }
public void SetAnswer(TextureFeatures feature, TextureClass answer) { answers[feature] = answer; }
public int GetTextureClassIndex(TextureClass textureClass) { return(knownClasses.IndexOf(textureClass)); }
public int GetTextureClassIndex(TextureClass textureClass) { return knownClasses.IndexOf(textureClass); }