In my game, I have plenty of objects that can collide. Literally, most of them can collide with each other. The problem I'm facing is that I can't come up with some good collision detection. How can I resolve collisions for lots of objects in such way that I don't end up with class that has more than 1000 lines of code with enormous conditional constructs like this?
if (firstBodyUserData == "rocket"
&& secondBodyUserData == "car_body") {
resolveRocketAndCarBodyCollision(firstBody, secondBody, contactData);
} else if (firstBodyUserData == "rocket"
&& secondBodyUserData == "gas_tank")
resolveRocketAndGasTankCollision(firstBody, secondBody, contactData);
//...many more dumb lines of code for every particular object in my game
And don't forget about all these "resolving methods" after if statements.
To make question more specific, I use Box2D with its ContactListener and Artemis-odb entity-component-system framework so I don't really have classes for my entities and that kind of exacerbates the problem but main question is in resolving bunch of different types of collisions.