refactor(Core/PlayerSettings): Refactor Player settings handling for efficiency (#22494)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Andrew
2025-07-19 06:38:04 -03:00
committed by GitHub
parent c6a53849c7
commit 3ca377fed3
3 changed files with 58 additions and 80 deletions

View File

@@ -37,12 +37,15 @@ enum AnnouncerFlags : uint8
struct PlayerSetting
{
PlayerSetting() = default;
explicit PlayerSetting(uint32 val) : value(val) { }
uint32 value;
[[nodiscard]] bool HasFlag(uint32 flag) { return (value & flag) != 0; }
[[nodiscard]] bool IsEnabled(uint32 equals = 1) { return value == equals; }
void AddFlag(uint32 flag) { value = value | flag; }
void RemoveFlag(uint32 flag) { value = value &~ flag; }
[[nodiscard]] bool HasFlag(uint32 flag) const { return (value & flag) != 0; }
[[nodiscard]] bool IsEnabled(uint32 equals = 1) const { return value == equals; }
void AddFlag(uint32 flag) { value |= flag; }
void RemoveFlag(uint32 flag) { value &= ~flag; }
};
typedef std::vector<PlayerSetting> PlayerSettingVector;