Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #240 from aspriddell/update-roles
Browse files Browse the repository at this point in the history
expose more extensions
  • Loading branch information
aspriddell authored Jun 12, 2021
2 parents 7ff6c32 + 87f5f09 commit 2e8cfea
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@

namespace DragonFruit.Six.Api.Services.Verification
{
public static class AccountTypeExtensions
public static class AccountExtensions
{
public static string GetName(this Dragon6AccountInfo dragon6User) => string.IsNullOrEmpty(dragon6User.CustomTitle) ? GetDefaultName(dragon6User.AccountRole) : dragon6User.CustomTitle;
public static string GetIcon(this Dragon6AccountInfo dragon6User) => string.IsNullOrEmpty(dragon6User.CustomIcon) ? GetDefaultIcon(dragon6User.AccountRole) : dragon6User.CustomIcon;
public static string GetColor(this Dragon6AccountInfo dragon6User) => string.IsNullOrEmpty(dragon6User.CustomColour) ? GetDefaultColor(dragon6User.AccountRole) : dragon6User.CustomColour;
public static string GetName(this Dragon6AccountInfo dragon6User) => string.IsNullOrEmpty(dragon6User.CustomTitle) ? GetName(dragon6User.AccountRole) : dragon6User.CustomTitle;
public static string GetIcon(this Dragon6AccountInfo dragon6User) => string.IsNullOrEmpty(dragon6User.CustomIcon) ? GetIcon(dragon6User.AccountRole) : dragon6User.CustomIcon;
public static string GetColor(this Dragon6AccountInfo dragon6User) => string.IsNullOrEmpty(dragon6User.CustomColour) ? GetColor(dragon6User.AccountRole) : dragon6User.CustomColour;

/// <summary>
/// Retrieves the default title for the <see cref="AccountRole"/> provided
/// </summary>
private static string GetDefaultName(this AccountRole role) => role switch
public static string GetName(this AccountRole role) => role switch
{
AccountRole.BlockedByAdmin => "Account blocked by admin",
AccountRole.BlockedBySelf => "Account blocked by owner",
Expand All @@ -30,7 +30,7 @@ public static class AccountTypeExtensions
/// <summary>
/// Retrieves the default icon for the <see cref="AccountRole"/> provided
/// </summary>
private static string GetDefaultIcon(this AccountRole role) => role switch
public static string GetIcon(this AccountRole role) => role switch
{
AccountRole.BlockedByAdmin => "highlight_off",
AccountRole.BlockedBySelf => "explore_off",
Expand All @@ -46,9 +46,9 @@ public static class AccountTypeExtensions
};

/// <summary>
/// Retrieves the default title colour for the <see cref="AccountRole"/> provided
/// Retrieves the default title color for the <see cref="AccountRole"/> provided
/// </summary>
private static string GetDefaultColor(this AccountRole role) => role switch
public static string GetColor(this AccountRole role) => role switch
{
AccountRole.BlockedByAdmin => "#BD1818",
AccountRole.BlockedBySelf => "#BD1818",
Expand Down

0 comments on commit 2e8cfea

Please sign in to comment.