Esempio n. 1
0
void
Serialiser::Serialise(const OrderedTaskPoint &data, const TCHAR* name)
{
  // do nothing
  std::unique_ptr<DataNode> child(node.AppendChild(_T("Point")));
  child->SetAttribute(_T("type"), name);

  std::unique_ptr<DataNode> wchild(child->AppendChild(_T("Waypoint")));
  Serialiser wser(*wchild);
  wser.Serialise(data.GetWaypoint());

  std::unique_ptr<DataNode> ochild(child->AppendChild(_T("ObservationZone")));
  Serialiser oser(*ochild);
  oser.Serialise(data.GetObservationZone());
}
Esempio n. 2
0
static void
Serialise(WritableDataNode &node, const OrderedTaskPoint &data,
          const TCHAR *name)
{
  // do nothing
  std::unique_ptr<WritableDataNode> child(node.AppendChild(_T("Point")));
  child->SetAttribute(_T("type"), name);

  std::unique_ptr<WritableDataNode> wchild(child->AppendChild(_T("Waypoint")));
  Serialise(*wchild, data.GetWaypoint());

  std::unique_ptr<WritableDataNode> ochild(child->AppendChild(_T("ObservationZone")));
  Serialise(*ochild, data.GetObservationZone());

  if (data.GetType() == TaskPointType::AST) {
    const ASTPoint &ast = (const ASTPoint &)data;
    if (ast.GetScoreExit())
      child->SetAttribute(_T("score_exit"), true);
  }
}