Resolvers, how do they work?
Posted: Sat Mar 12, 2016 11:17 pm
For wiki stuff I need to understand code, and at the moment I'm at the "how the hell do resolvers work" place.
For example:
Questions:
1) What's with the ___resolver? Is this a magic word defined somewhere?
2) What glue causes __resolver to connect to resolvers.calc.nameoffunction?
3) Same question for __resolve_instant, and what's with 'true'?
Also, for types like this:
4) Where did 'e' come from?
Thanks in advance.
For example:
Code: Select all
function resolvers.rngrange(x, y)
return {__resolver="rngrange", __resolve_instant=true, x, y}
end
function resolvers.calc.rngrange(t)
return rng.range(t[1], t[2])
end
1) What's with the ___resolver? Is this a magic word defined somewhere?
2) What glue causes __resolver to connect to resolvers.calc.nameoffunction?
3) Same question for __resolve_instant, and what's with 'true'?
Also, for types like this:
Code: Select all
function resolvers.attachtinker(t)
return {__resolver="attachtinker", __resolve_last=true, t}
end
function resolvers.calc.attachtinker(t, e)
....
end
Thanks in advance.