Questions about flags in day 66

Shouldn't the first flag value be set to 1 (1 << 0) instead of 2 (1 << 1) ?

The isSet function returns true if any of the flags is set, not all the flags are set. Is this the intended behaviour ? Should we rename it to isAnySet ?

There is a way to specify that an enum must be of a specific integer type (might be c++11). But it doesn't help with the compiler error. Using ( 1u << 31 ) seems to work.
1
2
3
4
5
6
7
enum sim_entity_flags : uint32
{
    EntityFlag_Collides = (1 << 1),
    EntityFlag_Nonspatial = (1 << 2),
    
    EntityFlag_Simming = (1u << 31),
};

Edit: the combination of the two seems to work.

Edited by Simon Anciaux on
There are many not checks on EntityFlag_Nonspatial. Maybe it would better to rename it to EntityFlag_Spatial?