taro
taro copied to clipboard
Add bitwise operations to make creation of bitfields possible
Add:
- bitwise AND (& operator)
- bitwise OR (| opeator)
- bitwise XOR (^ operator)
- bitwise left shift (<< operator)
- bitwise right shift (>> operator)
- bitwise unsigned right shift (>>> operator)
- bitwise inversion (~value)

what's the point of this PR? is there a problem that needs to be solved?
Yes, it's to make "more or less advanced" creators avoid using more than 5, 10 (or maybe even 15) boolean or number variables (used in a way to serve the same purpose as boolean) both globally and as unit variables, which not only makes quite a mess in the editor, but as well makes the variables part, depending on where the variable "chunk" has been assigned, more difficult to maintain. Using bitfields can solve that as you can test one numeric value against certain bits and check if the result is larger than 0, which makes that numeric variable easily behave as a boolean value array.