示例#1
0
        public static string GetParentTreeInfo(AbstractCorp sub)
        {
            string info = $"{sub.GetInfo() }  的领导 \n\t";

            if (sub.GetParent() is AbstractCorp parent)
            {
                info += GetParentTreeInfo(parent);
            }
            return(info);
        }
示例#2
0
 public override void Remove(AbstractCorp component)
 {
     _subordinateList.Remove(component);
 }
示例#3
0
 //增加一个下属,可能是小头目,也可能是个小兵
 public override void Add(AbstractCorp component)
 {
     component.SetParent(this); //设置父节点
     _subordinateList.Add(component);
 }
示例#4
0
 public override void Remove(AbstractCorp component)
 {
     throw new System.NotImplementedException();
 }
示例#5
0
 //删除一个叶子构件或树枝构件
 public abstract void Remove(AbstractCorp component);
示例#6
0
 //增加一个叶子构件或树枝构件
 public abstract void Add(AbstractCorp component);
示例#7
0
 //设置父节点
 public void SetParent(AbstractCorp _parent)
 {
     this._parent = _parent;
 }