29.08.2011, 10:46
afaik, this method is for checking a bit for true or false. if iam not wrong, its possible to store 32 teams in a single cell this way. (4 bytes == 32 bits)..
oh, iam not sure about the enumerator increasement.. the <<= is a logical shift, isnt it? so the enum would power up the values by shifting the "adressed" bit to be these values: 1, 2, 4, 8, 16, 32.. so 0b00000001=TEAM_COP, 0b00000010=TEAM_ROBBER, and 0b00000100=TEAM_CIV...
0b00000111 would be 7 (1+2+4), or the 3 teams gathered together
oh, iam not sure about the enumerator increasement.. the <<= is a logical shift, isnt it? so the enum would power up the values by shifting the "adressed" bit to be these values: 1, 2, 4, 8, 16, 32.. so 0b00000001=TEAM_COP, 0b00000010=TEAM_ROBBER, and 0b00000100=TEAM_CIV...
0b00000111 would be 7 (1+2+4), or the 3 teams gathered together