I have objects set up like this, data coming from a service:
DataType1_1 has array [DataType2_1, DataType2_2, DataType2_3]
DataType1_2 has array [DataType2_2, DataType2_3]
I want them to be re-arranged so I have objects like this:
DataType2_1 has array [DataType1_1]
DataType2_2 has array [DataType1_1, DataType1_2]
DataType2_3 has array [DataType1_1, DataType1_2]
Hope that makes sense. How could I do this?
EDIT:
Have Animal objects (dog, cat, mouse) which each have an array of possible fur colors. I need to switch the order, so I have fur colors that each have an array of possible animals that correspond.
Dog has array [Brown, White, Black]
Cat has array [Brown, White, Red]
Mouse has array [White, Black]
Need this:
Brown has array [Dog, Cat]
White has array [Dog, Cat, Mouse]
Red has array [Cat]
Black has array [Dog, Mouse]