Merge branch 'master' of zorba@192.168.100.11:questhelper
[QuestHelper.git] / routing_route.lua
blob54aa81bf692ba929244c5b498432b367bb1c94ab
1 QuestHelper_File["routing_route.lua"] = "Development Version"
2 QuestHelper_Loadtime["routing_route.lua"] = GetTime()
4 -- Real simple - [1] through [N] is our route. Yes, the player position at the time the route was generated is [1]. There will be route manipulation functions later. I hear that metatables don't have per-table overhead, but do have some CPU use. I've heard this might only occur if the member doesn't exist inside the actual table. I've also heard that both of these might be wrong. I obviously need to research this since the people in #lua are being useless.
6 function NewRoute()
7 return QuestHelper:CreateTable("route")
8 end
10 function PathToString(path)
11 local dout
12 for _, v in ipairs(path) do
13 if dout then
14 dout = dout .. string.format(", %d", v)
15 else
16 dout = string.format("%d", v)
17 end
18 end
20 return string.format("[%s]:%f", dout, path.distance)
21 end