public void RemoveEntity(AbstractEntity entity) { AbstractEntity ent = EntitiesInTheWorld.Find(a => a.BehaviourID == entity.BehaviourID); lock (EntitiesInTheWorld) EntitiesInTheWorld.Remove(ent); ent.Dispose(); }
public void AddEntity(AbstractEntity beh) { beh.Belongs = this; beh.Initialize(); lock (EntitiesInTheWorld) EntitiesInTheWorld.Add(beh); BehaviourController.StartUpdateBehaviour(beh); }
public override void Dispose() { EntitiesInTheWorld.ForEach((a) => a.Dispose()); ObjectsInTheWorld.ForEach((a) => a.Dispose()); SomethingInTheWorld.ForEach((a) => a.Dispose()); EntitiesInTheWorld = null; SomethingInTheWorld = null; ObjectsInTheWorld = null; base.Dispose(); }