Skip to content

Please add HasAnyFlag(Enum flags) to Enum #9802

Closed as not planned
Closed as not planned
@RioMcBoo

Description

@RioMcBoo

Currently, there is already a HasFlag method, but it does not allow us to use enum as flags to its full potential. And we have to invent a new wheel.

All that is needed is for the Enum class to have two methods:

bool HasFlag(Enum mask) => this.mask & mask == mask;
bool HasAnyFlag(Enum mask) => this.mask & mask != 0;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions