Пример #1
0
        ArgTarget FindTarget(int targetIndex, ref Dictionary <object, bool> usedOptions)
        {
            ArgTarget target = targetIndex >= this.targets.Count ? null : this.targets[targetIndex];

            if (target == null)
            {
                return(null);
            }
            if (!usedOptions.ContainsKey(target))
            {
                usedOptions.Add(target, true);
            }
            return(target);
        }
Пример #2
0
        bool ParseTarget(string arg, ref bool onlyTargets, ref int targetIndex, ref Dictionary <object, bool> usedOptions)
        {
            ArgTarget target = FindTarget(targetIndex, ref usedOptions);

            if (target == null)
            {
                return(false);
            }
            bool useNextTarget = target.DoAction(arg);

            if (useNextTarget)
            {
                ++targetIndex;
            }
            return(true);
        }
Пример #3
0
 public void AddTarget(ArgTarget target)
 {
     this.targets.Add(target);
 }