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;
        }
Example #2
0
        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);
        }
Example #3
0
        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;
 }
Example #5
0
 public void SetAnswer(TextureFeatures feature, TextureClass answer)
 {
     answers[feature] = answer;
 }
Example #6
0
 public int GetTextureClassIndex(TextureClass textureClass)
 {
     return(knownClasses.IndexOf(textureClass));
 }
 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 int GetTextureClassIndex(TextureClass textureClass)
 {
     return knownClasses.IndexOf(textureClass);
 }