예제 #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);
 }
예제 #2
0
파일: Group.cs 프로젝트: Herocane/Evolve
 public bool CanExecute(Command cmd)
 {
     return commands.Contains(cmd);
 }
예제 #3
0
 public bool Contains(Command cmd)
 {
     return commands.Contains(cmd);
 }
예제 #4
0
 public void Add(Command cmd)
 {
     commands.Add(cmd);
 }
예제 #5
0
 public bool Remove(Command cmd)
 {
     return commands.Remove(cmd);
 }
예제 #6
0
 public static OtherPerms Find(Command cmd, int number = 1)
 {
     foreach (OtherPerms OtPe in list)
     {
         if (OtPe.cmd == cmd && OtPe.number == number)
         {
             return OtPe;
         }
     }
     return null;
 }
예제 #7
0
 public static int GetPerm(Command cmd, int number = 1)
 {
     OtherPerms otpe = Find(cmd, number);
     return otpe.Permission;
 }
예제 #8
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);
 }