void TaskRenderer::Draw(const OrderedTask &task) { tpv.SetBoundingBox(task.GetBoundingBox(screen_bounds)); tpv.SetActiveIndex(task.GetActiveIndex()); for (unsigned i = 0; i < 4; i++) { tpv.ResetIndex(); if (i != TaskPointRenderer::LAYER_SYMBOLS && i != TaskPointRenderer::LAYER_LEG) { tpv.SetModeOptional(true); for (const auto &tp : task.GetOptionalStartPoints()) tpv.Draw(tp, (TaskPointRenderer::Layer)i); } tpv.SetModeOptional(false); for (const auto &tp : task.GetPoints()) tpv.Draw(tp, (TaskPointRenderer::Layer)i); } if (task.GetFactoryType() == TaskFactoryType::MAT) { // now draw MAT circles tpv.ResetIndex(); tpv.SetModeOptional(false); for (const auto *i : task.GetMatPoints()) tpv.Draw(*i, (TaskPointRenderer::Layer)2); } }
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 TaskRenderer::Draw(const OrderedTask &task) { tpv.SetBoundingBox(task.GetBoundingBox(screen_bounds)); tpv.SetActiveIndex(task.GetActiveIndex()); for (unsigned i = 0; i < 4; i++) { tpv.ResetIndex(); if (i != TaskPointRenderer::LAYER_SYMBOLS && i != TaskPointRenderer::LAYER_LEG) { tpv.SetModeOptional(true); for (const auto &tp : task.GetOptionalStartPoints()) tpv.Draw(tp, (TaskPointRenderer::Layer)i); } tpv.SetModeOptional(false); for (const auto &tp : task.GetPoints()) tpv.Draw(tp, (TaskPointRenderer::Layer)i); } }