Skip to content

Commit

Permalink
Add Badges
Browse files Browse the repository at this point in the history
  • Loading branch information
byBlurr committed Feb 13, 2021
1 parent 8c64d29 commit 09f6878
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
18 changes: 18 additions & 0 deletions LorisAngel.Common/Badges.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using LorisAngel.Common.Objects;

namespace LorisAngel.Common
{
public class Badges
{
public static LoriBadge[] AllBadges = {
new LoriBadge(0, "founder", "Founder", "This user was here from the start"),
new LoriBadge(1, "dev", "Developer", "This user helped develop Lori's Angel"),
};

public static LoriBadge GetBadge(int id)
{
if (id >= 0 && id < AllBadges.Length) return AllBadges[id];
else return null;
}
}
}
12 changes: 11 additions & 1 deletion LorisAngel.Common/Objects/LoriBadge.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
namespace LorisAngel.Common.Objects
using System;

namespace LorisAngel.Common.Objects
{
public class LoriBadge
{
public int Id { get; set; }
public string DisplayName { get; set; }
public string Code { get; set; }
public string Description { get; set; }

public LoriBadge(int id, string displayName, string code, string description)
{
Id = id;
DisplayName = displayName ?? throw new ArgumentNullException(nameof(displayName));
Code = code ?? throw new ArgumentNullException(nameof(code));
Description = description ?? throw new ArgumentNullException(nameof(description));
}
}
}

0 comments on commit 09f6878

Please sign in to comment.