public void RemoveObject(AbstractObject @object) { AbstractObject obj = ObjectsInTheWorld.Find(a => a.BehaviourID == @object.BehaviourID); lock (ObjectsInTheWorld) ObjectsInTheWorld.Remove(obj); obj.Dispose(); }
public void AddObject(AbstractObject beh) { beh.Belongs = this; beh.Initialize(); lock (ObjectsInTheWorld) ObjectsInTheWorld.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(); }