if (Condition 1) {
Bool1= true;
Bool2= false;
Bool3= false;
Bool4= false;
Bool5= false;
}
if (Condition 2) {
Bool1= false;
Bool2= true;
Bool3= false;
Bool4= false;
Bool5= false;
}
if (Condition 3) {
Bool1= false;
Bool2= false;
Bool3= true;
Bool4= false;
Bool5= false;
}
if (Condition 4) {
Bool1= false;
Bool2= false;
Bool3= false;
Bool4= true;
Bool5= false;
}
if (Condition 5) {
Bool1= false;;
Bool2= false;
Bool3= false;
Bool4= false;
Bool5= true;
}
I'm trying to create 5 latching bools. The condition only needs to be true momentarily to make the 1 and only 1 bool true and all the others false, and stay that way until another bool becomes true, making all the others false, and so on.
I'm sure this code will work but I was wondering if there was a specific c# bool function that would do this better?