Skip to content

Commit

Permalink
Update AsteroidSpawner.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
InvalidArgument3 committed Oct 27, 2024
1 parent b7d26db commit d1fdc12
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class AsteroidSpawner {
private const int UpdatesPerTick = 50;// update rate of the roids

private ConcurrentQueue<long> _pendingRemovals = new ConcurrentQueue<long>();
private const int REMOVAL_BATCH_SIZE = 50;
private const int REMOVAL_BATCH_SIZE = 10;
private const double REMOVAL_BATCH_INTERVAL = 1.0; // seconds
private DateTime _lastRemovalBatch = DateTime.MinValue;

Expand Down Expand Up @@ -822,7 +822,7 @@ private void UpdateAsteroids(List<AsteroidZone> zones) {
}

// Process removals in batches
const int REMOVAL_BATCH_SIZE = 50;
const int REMOVAL_BATCH_SIZE = 10;
for (int i = 0; i < asteroidsToRemove.Count; i += REMOVAL_BATCH_SIZE) {
var batch = asteroidsToRemove.Skip(i).Take(REMOVAL_BATCH_SIZE);
foreach (var asteroid in batch) {
Expand Down

0 comments on commit d1fdc12

Please sign in to comment.