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); }
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); }
public void AddTarget(ArgTarget target) { this.targets.Add(target); }