I use to store much in hashmap since it’s fast and easy to do. But my HashMap keys are really bad. Normally I have something like. String key = x + “.” + y + “.” + z; to make sure every object have it’s own key.I have been thinking of using << and .hashCode() instead. But I have no idea if that’s a good way to do it if I want unique keys.
Example
int locationKey = x << y << z;
int recoloredSpriteKey = img.hashCode() << color.hashCode();