mirror of
https://github.com/islehorse/HISP.git
synced 2025-06-04 04:47:09 +12:00
Add Feature pt1
This commit is contained in:
parent
a184e4d735
commit
092534e331
131 changed files with 3113 additions and 1418 deletions
47
HorseIsleServer/LibHISP/Game/AbuseReport.cs
Normal file
47
HorseIsleServer/LibHISP/Game/AbuseReport.cs
Normal file
|
@ -0,0 +1,47 @@
|
|||
using System.Collections.Generic;
|
||||
namespace HISP.Game
|
||||
{
|
||||
public class AbuseReport
|
||||
{
|
||||
public struct ReportReason
|
||||
{
|
||||
public string Id;
|
||||
public string Name;
|
||||
public string Meta;
|
||||
}
|
||||
private static List<ReportReason> reportReasons = new List<ReportReason>();
|
||||
|
||||
public static ReportReason[] ReportReasons
|
||||
{
|
||||
get
|
||||
{
|
||||
return reportReasons.ToArray();
|
||||
}
|
||||
}
|
||||
public static bool DoesReasonExist(string id)
|
||||
{
|
||||
try
|
||||
{
|
||||
GetReasonById(id);
|
||||
return true;
|
||||
}
|
||||
catch(KeyNotFoundException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public static ReportReason GetReasonById(string id)
|
||||
{
|
||||
foreach(ReportReason reason in ReportReasons)
|
||||
{
|
||||
if (reason.Id == id)
|
||||
return reason;
|
||||
}
|
||||
throw new KeyNotFoundException("No reason of: " + id + " Found.");
|
||||
}
|
||||
public static void AddReason(ReportReason reason)
|
||||
{
|
||||
reportReasons.Add(reason);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue