Is there a way to use each of the arguments in this function in sequence without duplicating code? For example, the first time through the loop I'd like to use R, the next time I'd like to use L, etc. valuestruct is set up in the same order as the arguments, so the button method will return the equivalent bool I need for currentbutton according to int i. If there's a better method to accomplish the same thing that's ok too.
int valuex=0;
void SetValue(bool &R,bool &L,bool &D,bool &U,bool &T,bool &S,bool &B,bool &A,bool &Y,bool &X,bool &W,bool &E,bool &G, bool &F) {
bool value[4] = {true, false, true, false};
bool currentbutton;
for (int i=0; i < 12; i++) {
currentbutton=valuestruct.button(i);
if(currentbutton) {
"I want to grab each argument in sequence here"=value[valuex];
valuex++;
if(valuex>ARRAYSIZE(value))
valuex=0;
}
}
}