public SingleTargetTaskTracker(TargetTaskTracker parent, TargetSpec spec)
 {
     this.parent           = parent;
     target                = new Target(spec);
     parent.Parent.Targets = parent.Parent.Targets.Concat(Enumerable.Repeat(target, 1)).ToArray();
     accomplished          = false;
 }
Пример #2
0
        public ObjectiveTaskTracker MakeObjectiveTracker(ObjectiveSpec spec)
        {
            SequenceSpec sequenceSpec = spec as SequenceSpec;

            if (sequenceSpec != null)
            {
                return(new SequenceTaskTracker(this, sequenceSpec));
            }
            else
            {
                ChoiceSpec choiceSpec = spec as ChoiceSpec;
                if (choiceSpec != null)
                {
                    return(new ChoiceTracker(this, choiceSpec));
                }
                else
                {
                    TargetSpec targetSpec = spec as TargetSpec;
                    if (targetSpec != null)
                    {
                        return(new SingleTargetTaskTracker(this, targetSpec));
                    }
                    else
                    {
                        throw new ArgumentException("Unknown objective type.");
                    }
                }
            }
        }
Пример #3
0
 public Target(TargetSpec spec)
 {
     Position = Vector2D.FromDuple(spec.Position);
     Value    = spec.Reward;
     Eligible = false;
 }