Add files via upload

This commit is contained in:
Zura
2025-08-21 21:24:29 +02:00
committed by GitHub
commit 9a8ffe093f
62 changed files with 1206 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
using MareSynchronos.API.Data.Enum;
namespace MareSynchronos.API.Data.Extensions;
public static class GroupPermissionsExtensions
{
public static bool IsDisableInvites(this GroupPermissions perm)
{
return perm.HasFlag(GroupPermissions.DisableInvites);
}
public static bool IsPreferDisableAnimations(this GroupPermissions perm)
{
return perm.HasFlag(GroupPermissions.PreferDisableAnimations);
}
public static bool IsPreferDisableSounds(this GroupPermissions perm)
{
return perm.HasFlag(GroupPermissions.PreferDisableSounds);
}
public static bool IsPreferDisableVFX(this GroupPermissions perm)
{
return perm.HasFlag(GroupPermissions.PreferDisableVFX);
}
public static void SetDisableInvites(this ref GroupPermissions perm, bool set)
{
if (set) perm |= GroupPermissions.DisableInvites;
else perm &= ~GroupPermissions.DisableInvites;
}
public static void SetPreferDisableAnimations(this ref GroupPermissions perm, bool set)
{
if (set) perm |= GroupPermissions.PreferDisableAnimations;
else perm &= ~GroupPermissions.PreferDisableAnimations;
}
public static void SetPreferDisableSounds(this ref GroupPermissions perm, bool set)
{
if (set) perm |= GroupPermissions.PreferDisableSounds;
else perm &= ~GroupPermissions.PreferDisableSounds;
}
public static void SetPreferDisableVFX(this ref GroupPermissions perm, bool set)
{
if (set) perm |= GroupPermissions.PreferDisableVFX;
else perm &= ~GroupPermissions.PreferDisableVFX;
}
}