I have trouble finding a good solution (and a good title) to the following problem:
Say I have a blueprint of a sphere. This sphere-blueprint contains an array of unique colors. Each sphere will take on a random color of its color array after spawning.
Now I have a Spawner, which holds a list of say 100 different sphere-blueprints it could spawn. Each of these can have differing color arrays. The Spawner now tries to spawn 10 spheres from that list.
After spawning its now time for the spheres to take on their colors. However, no sphere can take on a color another sphere has taken on before! The first sphere takes on a random color from its color array. Each subsequent sphere is are able to see the color previous spheres have taken on and are able to chose a color that hasn't been chosen by any previous sphere.
How can I make sure that I don't spawn a sphere, which could be left with no more color-choices, because all colors within its color-array have been already taken by other spheres?
I tried to prototype this using sticky notes with numbers on them, but it sure is not a trivial problem