Skip to content

Commit

Permalink
Update args for choice
Browse files Browse the repository at this point in the history
  • Loading branch information
shouth committed Mar 6, 2025
1 parent 7994fd6 commit a2a20c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ GlobalAction::GlobalAction(const pugi::xml_node & node, Scope & scope)
// clang-format off
: ComplexType(
choice(node, {
{ "EnvironmentAction", [&](auto && node) { return make< EnvironmentAction>(std::forward<decltype(node)>(node), scope); } },
{ "EntityAction", [&](auto && node) { return make< EntityAction>(std::forward<decltype(node)>(node), scope); } },
{ "ParameterAction", [&](auto && node) { return make< ParameterAction>(std::forward<decltype(node)>(node), scope); } },
{"InfrastructureAction", [&](auto && node) { return make<InfrastructureAction>(std::forward<decltype(node)>(node), scope); } },
{ "TrafficAction", [&](auto && node) { throw UNSUPPORTED_ELEMENT_SPECIFIED(node.name()); return unspecified; } },
{ "EnvironmentAction", [&](auto && node) { return make< EnvironmentAction>(node, scope); } },
{ "EntityAction", [&](auto && node) { return make< EntityAction>(node, scope); } },
{ "ParameterAction", [&](auto && node) { return make< ParameterAction>(node, scope); } },
{"InfrastructureAction", [&](auto && node) { return make<InfrastructureAction>(node, scope); } },
{ "TrafficAction", [&](auto && node) { throw UNSUPPORTED_ELEMENT_SPECIFIED(node.name()); return unspecified; } },
}))
// clang-format on
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ inline namespace syntax
TimeToCollisionConditionTarget::TimeToCollisionConditionTarget(
const pugi::xml_node & node, Scope & scope)
// clang-format off
: ComplexType(choice(node,
std::make_pair( "Position", [&](auto && node) { return make<Position>(std::forward<decltype(node)>(node), scope); }),
std::make_pair("EntityRef", [&](auto && node) { return make< Entity>(std::forward<decltype(node)>(node), scope); })))
: ComplexType(choice(node, {
{ "Position", [&](auto && node) { return make<Position>(node, scope); } },
{ "EntityRef", [&](auto && node) { return make< Entity>(node, scope); } },
}))
// clang-format on
{
if (is<EntitySelection>()) {
Expand Down

0 comments on commit a2a20c0

Please sign in to comment.