Ejemplo n.º 1
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.");
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public ChoiceTracker(TargetTaskTracker parent, ChoiceSpec spec)
        {
            subObjectives = new List <ObjectiveTaskTracker>();
            foreach (ObjectiveSpec os in spec.Objective)
            {
                subObjectives.Add(parent.MakeObjectiveTracker(os));
            }

            selected     = null;
            accomplished = false;
        }