2017-05-26 18:49:27 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
2017-11-25 20:29:58 -05:00
|
|
|
|
using SharedLibrary.Objects;
|
|
|
|
|
|
2017-05-26 18:49:27 -04:00
|
|
|
|
namespace MessageBoard
|
|
|
|
|
{
|
|
|
|
|
public class Rank : Identifiable
|
|
|
|
|
{
|
|
|
|
|
public string name;
|
2017-11-25 20:29:58 -05:00
|
|
|
|
public Player.Permission equivalentRank;
|
2017-05-26 18:49:27 -04:00
|
|
|
|
public int id;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initial creation
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="name"></param>
|
|
|
|
|
/// <param name="equivalentRank"></param>
|
|
|
|
|
/// <param name="permissions"></param>
|
2017-11-25 20:29:58 -05:00
|
|
|
|
public Rank(string name, Player.Permission equivalentRank)
|
2017-05-26 18:49:27 -04:00
|
|
|
|
{
|
|
|
|
|
this.name = name;
|
|
|
|
|
this.equivalentRank = equivalentRank;
|
|
|
|
|
id = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-25 20:29:58 -05:00
|
|
|
|
public Rank(int id, string name, Player.Permission equivalentRank)
|
2017-05-26 18:49:27 -04:00
|
|
|
|
{
|
|
|
|
|
this.name = name;
|
|
|
|
|
this.equivalentRank = equivalentRank;
|
|
|
|
|
this.id = id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getID()
|
|
|
|
|
{
|
|
|
|
|
return id;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class Permission
|
|
|
|
|
{
|
|
|
|
|
[Flags]
|
|
|
|
|
public enum Action
|
|
|
|
|
{
|
|
|
|
|
NONE = 0x0,
|
|
|
|
|
READ = 0x1,
|
|
|
|
|
WRITE = 0x2,
|
|
|
|
|
MODIFY = 0x4,
|
|
|
|
|
DELETE = 0x8
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int rankID;
|
|
|
|
|
public Action actionable;
|
|
|
|
|
|
|
|
|
|
public Permission(int rankID, Action actionable)
|
|
|
|
|
{
|
|
|
|
|
this.rankID = rankID;
|
|
|
|
|
this.actionable = actionable;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|