Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum SystemFacFlag {
- SFF_MINERALS = 1,
- SFF_ORGANICS = 2,
- SFF_RADIOACTIVES = 4
- };
- for (int f = 0; f <= (SFF_MINERALS | SFF_ORGANICS | SFF_RADIOACTIVES); ++f) {
- // do stuff with f, including indexing an array with it;
- if (f & SFF_MINERALS) { /* more stuff */ }
- if (f & SFF_ORGANICS) { /* still more stuff */ }
- if (f & SFF_RADIOACTIVES) { /* even more stuff */ }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement