/// <summary> /// When realEntity is left null, the Entity will register itself. Else it will register whoever is the realEntity /// WARNING: Don't use the RealEntity if you are inheriting from this class. /// </summary> public Entity(IEntity realEntity = null, string[] tags = null) { database = Ramses.Confactory.ConfactoryFinder.Instance.Give <ConEntityDatabase>(); this.trueEntity = (realEntity == null) ? this : realEntity; if (tags != null) { allTags = new List <string>(tags); } RegisterToDatabase(trueEntity); }
public virtual void Dispose() { database.UnRegisterEntity(trueEntity); database = null; }