public static void AddCommands(out CommandList commands, LevelPermission perm) { commands = new CommandList(); foreach (rankAllowance perms in allowedCommands) { bool canUse = perms.lowestRank <= perm && !perms.disallow.Contains(perm); if (canUse || perms.allow.Contains(perm)) { commands.Add(Command.all.Find(perms.commandName)); } } }
public static void AddCommands(out CommandList commands, LevelPermission perm) { commands = new CommandList(); foreach (rankAllowance aV in allowedCommands.Where(aV => (aV.lowestRank <= perm && !aV.disallow.Contains(perm)) || aV.allow.Contains(perm))) commands.Add(Command.all.Find(aV.commandName)); }