4 ms·
But then using bit fields makes no sense.
by fla 10y ago
But then using bit fields makes no sense.
- olalonde 10y agoIt can be used like this, no? writable = 001 readable = 010 readwrite = 011 (writable | readable)
- fla 10y agoYes yes, but the point was, it can't be Shattering and Shattered at the same time ;)
- viewer5 10y agoI throw a baseball through a window, and set the window's state to both Shattered and Shattering. It's Shattered, for the purposes of "is this an intact pane of glass?" e.g. if I throw another baseball, it's not going to shatter again, and I can jump through it without any physical resistance (in the case of strong/thick glass, if it was still intact I might risk bouncing off if I'm at low velocity or mass). But it's also still in the process of Shattering, so when I jump through it, I'm risking cuts, it's actively producing noise for someone to hear, that laser I'm shining at it will be fragmenting wildly rather than reflecting off/passing through/deflecting like it was before the glass started Shattering.
- fla 10y agoOk, but it still doesn't make sense to use flags here, because according to your definition, a shattering window is always shattered. Anyway, I don't think it's worth arguing design on this codebase because it is full of dirty things.