Guest User

Untitled

a guest
Dec 17th, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. // if u want, else just use int to iterate
  2. enum _state {controls, settings, something};
  3.  
  4. bool[] array = new bool[3];  // all false on init
  5. // array[2] = true;  // eg
  6.     /* (...) */    
  7.  
  8. bool invert(enum case) {return !array[case]; }
  9. // or
  10. void invert(enum case) {array[case] = !array[case]; return; }
  11.  
  12.  
  13. //eg if u want to switch bool controls which is now true, just call:
  14.  
  15. invert(_state.controls);
Advertisement
Add Comment
Please, Sign In to add comment