Thread: (augrestrict)
View Single Post
  #8  
Old 01-20-2009, 08:57 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Looks like a bit mask, they're fairly common in EQ structures, you use bitwise or to combine the bit flags and bitwise and for comparison.

Each flag has a value that has a specific orientation in binary
1 00000001
2 00000010
4 00000100
8 00001000
16 00010000
32 00100000
64 01000000
128 10000000

In this situation say you wanted to combine type 8(128) and type 7(64)
10000000 (128) OR
01000000 (64)
---------
11000000 (192)

You'll notice that 64+128 is 192 so you can create your masks easily by just adding the values you want together if you don't have the patience to deal with the binary =p. Course the masks have to be correct or bad things will happen
Reply With Quote