Esempio n. 1
0
 public static void Add(Command command, int Perm, string desc, int number = 1)
 {
     if (Perm > 120) { return; }
     OtherPerms otpe = new OtherPerms();
     otpe.cmd = command;
     otpe.Permission = Perm;
     otpe.Description = desc;
     otpe.number = number;
     list.Add(otpe);
 }
Esempio n. 2
0
 public bool Contains(Command cmd) { return commands.Contains(cmd); }
Esempio n. 3
0
 public bool Remove(Command cmd) { return commands.Remove(cmd); }
Esempio n. 4
0
 public void Add(Command cmd) { commands.Add(cmd); }
Esempio n. 5
0
 /// <summary>
 /// Check to see if this group can excute cmd
 /// </summary>
 /// <param name="cmd">The command object to check</param>
 /// <returns>True if this group can use it, false if they cant</returns>
 public bool CanExecute(Command cmd)
 {
     return commands.Contains(cmd);
 }
Esempio n. 6
0
 public static int GetPerm(Command cmd, int number = 1)
 {
     OtherPerms otpe = Find(cmd, number);
     return otpe.Permission;
 }
Esempio n. 7
0
 public static int GetMaxNumber(Command cmd)
 {
     int i = 1;
     bool stop = false;
     while (stop == false)
     {
         OtherPerms op = Find(cmd, i);
         if (op == null) { stop = true; }
         else { i++; }
     }
     return (i - 1);
 }
Esempio n. 8
0
 public static OtherPerms Find(Command cmd, int number = 1)
 {
     return list.FirstOrDefault(OtPe => OtPe.cmd == cmd && OtPe.number == number);
 }
Esempio n. 9
0
 /// <summary>
 /// Add a command to the server
 /// </summary>
 /// <param name="command">The command to add</param>
 public void AddCommand(Command command)
 {
     all.Add(command);
 }