CivOne icon indicating copy to clipboard operation
CivOne copied to clipboard

Code style: Suggestion to use binary notation (with 8bit shift)

Open iegik opened this issue 4 years ago • 1 comments

For better reading, I suggest to use binary notation for values with type byte[8]

0b00000001 == 0x01 == 1 // Sentry
0b00000010 == 0x02 == 2 // Road
...
0b01000000 == 0x40 == 64 // Irrigate
...
0b10000000 == 0x80 == 128 // Mines
...
0b11000000 == 0xc0 == 128 + 64 // Fortress
...
0b11111111 == 0xff == 255

Cons/pros?

iegik avatar Sep 30 '21 08:09 iegik

No cons - hex notation is to be preferred! Make it so!

fire-eggs avatar Sep 30 '21 14:09 fire-eggs