public void Remove(T obj) { int id = GetId(obj); if (id > 0) { RemovedIds.Add(id); } else { NewObjects.Remove(obj); } }
internal void UsualGameMode() { if (Score > 500 * Lvl) { Lvl++; Score = 0; } GlobalScore = Score + 500 * (Lvl - 1); Creator.UpdateMap(); GameObjects.AddRange(NewObjects); NewObjects.Clear(); MoveAllObjects(Move); Player.Move(this); HandlePlayerIntersection(); UpdateListOfObjects(); }
public DiffHeap(Heapshot oldHs, Heapshot newHs) { OldHeapshot = oldHs; NewHeapshot = newHs; var oldAllocs = oldHs.ObjectsInfoMap.ToDictionary(p => p.Value.Allocation, p => p.Value); var newAllocs = newHs.ObjectsInfoMap.ToDictionary(p => p.Value.Allocation, p => p.Value); foreach (var a in oldAllocs) { if (!newAllocs.Remove(a.Key)) { DeletedObjects.Add(a.Value); } } // What is left in list is new NewObjects.AddRange(newAllocs.Values); }
public void RegInsertedNewObjects(object sender, AddObjInfoEventArgs e) { NewObjects.Add(e.InsertedObj); }
public void Add(T obj) => NewObjects.Add(obj);