public void ProcessEntityPhysics(IPhysical entity, float step) { entity.IsFalling = true; if (entity is ICollidable collidableEntity) { for (int index = 0; index < levelGeometries.Count; index++) { LevelGeometry geom = levelGeometries[index]; CollisionSolver.SolveEntityAgainstGeometry(collidableEntity, geom); } } entity.Physics(step); if (entity is IEntityCollidable ec) { for (int index = 0; index < entities.Count; index++) { ICollidable otherEntity = entities[index] as ICollidable; if (!ec.Equals(otherEntity) && ec.GetType() != otherEntity.GetType()) { CollisionSolver.SolveEntityAgainstEntity(ec, otherEntity); } } } }