How can I do this elegantly?

So I have this system of where when you complete a level you get a new random effect. the effect is then displayed throughout the level.

but sometimes you might get the same effect again. this is what’s supposed to happen. However, I don’t want to display the effect again. this is what I mean

effect: controls switched

effect: more money

and then you complete the level and this shows up:

effect: controls switched

effect: more money

effect: controls switched

but I only want to show controls switched once! I know one way I could do this:

 bool controlsSwitchedEffectAdded;
 bool moreMoneyEffectAdded;
 bool exampleEffect;
 bool anotherExampleEffect;

And then I could just make these true whenever they were added to make sure that it only gets added once. The problem is that this isn’t very elegant. Especially if I want to add more effects in the future, this is going to eventually become a big block of code.

There has to be a better way!

You could keep a list of all used effects. If the effect is in the list, don’t use it again.

enum Effects
{
    ControlsSwitched,
    MoreMoney,
};

List<Effects> usedEffects = new List<Effects>();
if (!usedEffects.Contains(ControlsSwitched))
    usedEffects.Add(ControlsSwitched); // when effect is 1st used

Alternatively you could keep a list of all controls not used, and then pull from the list to use it for the level.