Last week I presented a problem: how do you iterate over multiple lists of multiple types in the order of some common field? For example, how would you iterate over a list of
Player and a list of
Enemy by both of their
Health fields? In that article I showed two solutions to iterate over two lists in this way. What I didn’t show were any solutions to handle more than two lists. What if you needed to also iterate over a list of
NPC? Today’s article discusses how to tackle this problem and ends up with a handy utility class that you can use for your own types no matter how many lists you have. Read on to see how!
Read the rest of this article »