-
-
Notifications
You must be signed in to change notification settings - Fork 56
[Request] Enum bit flags #66
Copy link
Copy link
Closed
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists
Description
Activity
Metadata
Metadata
Assignees
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists
Hello,
I would like to reopen how AngelScript handles bitwise operations on enums, as discussed previously in this community: https://gamedev.net/forums/topic/709510-enum-bit-flags/
While I understand the technical reasoning that
(Flag_A | Flag_B)results in a numeric value that might not be explicitly defined as a single member of the enum forcing an explicit cast likeMyEnum(Flag_A | Flag_B)it is not an easy way to remember.Also my main point to request the feature
bitfieldis because creating an API is much more clearer if the declaration of a method looks likeSetFlags(EntityFlags flags)and not likeSetFlags(uint flags). The user will understand faster what he is expected to use.Thanks for your time again!