refactor: list pool initial count and capacity parameters added

This commit is contained in:
2025-06-09 20:36:39 +03:00
parent f56d6a7fc8
commit 30ccab1b93
4 changed files with 14 additions and 14 deletions

View File

@@ -21,11 +21,11 @@ public class PhysicsEngine2DStandalone : IPhysicsEngine2D
private readonly ICollisionResolver2D collisionResolver = null!;
private readonly IRaycastResolver2D raycastResolver = null!;
private readonly ListPool<ICollider2D> colliderPool = new(() => new(32));
private readonly ListPool<IPrePhysicsUpdate> prePhysicsUpdatePool = new(() => new(32));
private readonly ListPool<IPhysicsUpdate> physicsUpdatePool = new(() => new(32));
private readonly ListPool<IPhysicsIteration> physicsIterationPool = new(() => new(32));
private readonly ListPool<IPostPhysicsUpdate> postPhysicsUpdatePool = new(() => new(32));
private readonly ListPool<ICollider2D> colliderPool = new();
private readonly ListPool<IPrePhysicsUpdate> prePhysicsUpdatePool = new();
private readonly ListPool<IPhysicsUpdate> physicsUpdatePool = new();
private readonly ListPool<IPhysicsIteration> physicsIterationPool = new();
private readonly ListPool<IPostPhysicsUpdate> postPhysicsUpdatePool = new();
public int IterationPerStep { get => _iterationCount; set => _iterationCount = value < 1 ? 1 : value; }