Returns true if flags (an int) has the given flag set.
flags
flag
bool hasFlag(int flags, Flags flag) => (flags & flag.value) != 0;