예제 #1
0
 virtual public bool Remove(INavdiEnt ent)
 {
     if (!this.active)
     {
         Dj.Error("Can't Remove from inactive Ents " + this); return(false);
     }
     if (this.permanent)
     {
         Dj.Error("Can't Remove from permanent Ents " + this); return(false);
     }
     if (ents.Remove(ent))
     {
         ent.Deactivated();
     }
     return(true);
 }
예제 #2
0
 virtual public bool Add(INavdiEnt ent)
 {
     if (!this.active && !this.permanent)
     {
         Dj.Error("Can't Add to inactive Ents " + this); return(false);
     }
     if (maxSize >= 0 && ents.Count >= maxSize)
     {
         Dj.Error("Can't Add to full Ents " + this + " (at capacity of " + maxSize + ")"); ent.Deactivated(); return(false);
     }
     if (ents.Add(ent) && this.active)
     {
         ent.Activated();
     }
     return(true);
 }