Example #1
0
void 
Deserialiser::Deserialise(OrderedTask &task)
{
  task.Clear();
  task.SetFactory(GetTaskFactoryType());
  task.Reset();

  OrderedTaskBehaviour beh = task.GetOrderedTaskBehaviour();
  Deserialise(beh);
  task.SetOrderedTaskBehaviour(beh);

  const DataNode::List children = node.ListChildrenNamed(_T("Point"));
  for (const auto &i : children) {
    std::unique_ptr<DataNode> point_node(i);
    Deserialiser pser(*point_node, waypoints);
    pser.DeserialiseTaskpoint(task);
  }
}
Example #2
0
void
LoadTask(OrderedTask &task, const ConstDataNode &node,
         const Waypoints *waypoints)
{
  task.Clear();
  task.SetFactory(GetTaskFactoryType(node));
  task.Reset();

  OrderedTaskSettings beh = task.GetOrderedTaskSettings();
  Deserialise(beh, node);
  task.SetOrderedTaskSettings(beh);

  const auto children = node.ListChildrenNamed(_T("Point"));
  for (const auto &i : children) {
    std::unique_ptr<ConstDataNode> point_node(i);
    DeserialiseTaskpoint(task, *point_node, waypoints);
  }
}