void Serialiser::Serialise(const OrderedTask &task) { node.SetAttribute(_T("type"), GetTaskFactoryType(task.GetFactoryType())); Serialise(task.GetOrderedTaskBehaviour()); mode_optional_start = false; task.AcceptTaskPointVisitor(*this); mode_optional_start = true; task.AcceptStartPointVisitor(*this); }
void SaveTask(WritableDataNode &node, const OrderedTask &task) { node.SetAttribute(_T("type"), GetTaskFactoryType(task.GetFactoryType())); Serialise(node, task.GetOrderedTaskSettings()); for (const auto &tp : task.GetPoints()) Serialise(node, tp, false); for (const auto &tp : task.GetOptionalStartPoints()) Serialise(node, tp, true); }
void Serialiser::Serialise(const OrderedTask &task) { node.SetAttribute(_T("type"), GetTaskFactoryType(task.GetFactoryType())); Serialise(task.GetOrderedTaskBehaviour()); mode_optional_start = false; for (const auto &tp : task.GetPoints()) Serialise(tp); mode_optional_start = true; for (const auto &tp : task.GetOptionalStartPoints()) Serialise(tp); }
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); } }
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); } }