There are ready-made enums
[Flags] public enum UserFlags { guest = 0, // GUEST USER // normal = 1, // NORMAL USER (DEFAULT) // banned = 2, // USER IS BLOCKED // online = 4 // USER IS ONLINE // } This is how I set the flags:
user.Flags = UserData.UserFlags.normal; user.SetFlag(UserData.UserFlags.guest); user.SetFlag(UserData.UserFlags.online); public UserFlags Flags { get; internal set; } public void SetFlag(UserFlags flag, bool state = true) { Flags = state ? Flags |= flag : Flags &= ~flag; } But if I try to display Flags as a test, only Online and Normal returns to the console, but the guest is not taken into account. Why?