Original Post
So I need a way to be able to relate my game actors with the physics body that represents them. To do that I use the following code:
However the problem is that I want to be able to do two things: 1) look up the game actor Id given the physics body Id 2) look up the physics body Id given the game actor Id. As I see it, the dictionary class only allows you to look up a value given it's corresponding key and not the other way around. Is this true? Can I implement this functionality without having another dictionary with the physics Id as a key and ActorId as a value?
private Dictionary<ActorId, int> bodyIdLookup; //matches a game actor ID to corrosponding physics body ID
However the problem is that I want to be able to do two things: 1) look up the game actor Id given the physics body Id 2) look up the physics body Id given the game actor Id. As I see it, the dictionary class only allows you to look up a value given it's corresponding key and not the other way around. Is this true? Can I implement this functionality without having another dictionary with the physics Id as a key and ActorId as a value?