Expose parameters in obstacleAccess
This commit is contained in:
parent
d80bff69d7
commit
d990597b55
1 changed files with 3 additions and 2 deletions
|
@ -90,14 +90,15 @@ If result.factor is positive, that is the cost.
|
|||
|
||||
There is no forward or backward, so this should always be the same for the same attributes
|
||||
*/
|
||||
|
||||
var parameters = _profile.Behaviours[_behaviourName];
|
||||
var tags = new LuaLiteral(Typs.Tags, "attributes");
|
||||
var hasAccess = _profile.ObstacleAccess.Apply(tags).SpecializeToSmallestType().Optimize(out _);
|
||||
var code = new List<string>
|
||||
{
|
||||
"--[[ Function called by itinero2 on every turn restriction relation", " ]]",
|
||||
"function turn_cost_factor(attributes, result)",
|
||||
|
||||
" local parameters = default_parameters()",
|
||||
_parameterPrinter.DeclareParametersFor(parameters),
|
||||
"local has_access",
|
||||
Snippets.Convert(_skeleton, "has_access", hasAccess),
|
||||
"if ( has_access == \"no\" or has_access == \"false\") then",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue