I'm doing a simple game for the Android platform. I have 25 objects made from the class that I call Circle. Each Circle object has the field color that holds an int number representing
- for red
- for blue
- for white
- for yellow and finally
- for green.
So there a five objects of each color.
Each object also has a boolean value that I call status, and it's set to false at the beginning. But during the game, some of the Circle objects status are set to true.
All 25 objects are stored in an ArrayList that I call listOfCircles.
My question is, how can I check if all Circle objects that are set to true has the same type of color code? Let's say that three Circle objects are set to true and each objects color are 3, but the case could also be that on of this three Circle object could have the value of 1 and the other two 4, then it's not a valid match.
Some help would be nice!
forloops each comparing the two indexes.