public TaxonomyClass GetClass(int class_id)
        {
            TaxonomyClass sub_class = null;

            m_all_classes.TryGetValue(class_id, out sub_class);
            return(sub_class);
        }
 public void AddSubClass(TaxonomyClass sub_class)
 {
     if (m_sub_classes == null)
     {
         m_sub_classes = new List <TaxonomyClass>();
     }
     m_sub_classes.Add(sub_class);
 }
 public bool IsCategory(int sub_class_id, int objective_class_id)
 {
     for (int i = 0; i < m_taxonomies.Count; ++i)
     {
         Taxonomy      taxonomy  = m_taxonomies[i];
         TaxonomyClass sub_class = taxonomy.GetClass(sub_class_id);
         while (sub_class != null)
         {
             if (sub_class.ID == objective_class_id)
             {
                 return(true);
             }
             sub_class = sub_class.Parent;
         }
     }
     return(false);
 }
        public void AddClass(int class_id, int parent_class_id)
        {
            TaxonomyClass parent_class = null;

            if (parent_class_id != 0)
            {
                m_all_classes.TryGetValue(parent_class_id, out parent_class);
            }
            TaxonomyClass sub_class = new TaxonomyClass(class_id, parent_class);

            m_all_classes[class_id] = sub_class;
            if (parent_class != null)
            {
                parent_class.AddSubClass(sub_class);
            }
            else
            {
                m_root_classes.Add(sub_class);
            }
        }
 public TaxonomyClass(int class_id, TaxonomyClass parent_class)
 {
     m_class_id     = class_id;
     m_parent_class = parent_class;
 }