Exemplo n.º 1
0
 public HumanWorkProvider(HumanAvatar user, WorkAgent workAgent,
     WorkflowProvider workflow, IDecompositionService<WorkItem> decompService,
     GoalService goalService)
 {
     _user = user;
     _workflow = workflow;
     WorkAgent = workAgent;
     _decompService = decompService;
     _goalService = goalService;
     _workitemGoals = new Dictionary<WorkItem, List<Goal>>();
     _completedGoals = new Dictionary<WorkItem, List<Goal>>();
 }
Exemplo n.º 2
0
        public static HumanWorkProvider MapWorkProviderFromNPC(BotAvatar npc, HumanAvatar human, 
            GoalService goalService, IDecompositionService<WorkItem> decompService)
        {
            HumanWorkProvider worker = new HumanWorkProvider
                (human, npc.WorkProvider.GetWorkAgent(), npc.WorkProvider.GetWorkflowProvider(),
                decompService, goalService);

            // Any currently processing tasks, remove
            npc.WorkProvider.GetWorkAgent().processing.Clear();

            // Now add all the tasks that had been started to the worker
            foreach (var workItem in npc.WorkProvider.GetWorkAgent().started)
            {
                worker.AddWork(workItem);
            }

            return worker;
        }