ircsharp/IrcStates/ISupportPrefix.cs

28 lines
739 B
C#

using System.Collections.Generic;
namespace IrcStates
{
public class ISupportPrefix
{
public ISupportPrefix(string splitVal)
{
var split = splitVal.Substring(1).Split(')', 2);
Modes = new List<string> {split[0]};
Prefixes = new List<string> {split[1]};
}
public List<string> Modes { get; set; }
public List<string> Prefixes { get; set; }
public string FromMode(string mode)
{
return Modes.Contains(mode) ? Modes[Modes.IndexOf(mode)] : null;
}
public string FromPrefix(string prefix)
{
return Prefixes.Contains(prefix) ? Prefixes[Prefixes.IndexOf(prefix)] : null;
}
}
}