Using C#, I have a List with several objects. All objects of this type have a bool, but requirements are that only one object can have that bool set to true at any one time.
So when I am setting the bool to true to one of the objects, I want to go through the list and set the bool for the rest to false.
Since only one object will have the bool set to true in the list, are any of the List class methods optimised to do this kind of search quickly, or should I just go through all the objects one by one with a simple foreach loop?