Cost function object relying on a Lua function. More...
#include <lua_pathfind_cost_calculator.hpp>
Public Member Functions | |
lua_pathfind_cost_calculator (lua_State *L_, int i) | |
double | cost (const map_location &loc, const double so_far) const |
Public Member Functions inherited from pathfind::cost_calculator | |
cost_calculator () | |
virtual | ~cost_calculator () |
Public Attributes | |
lua_State * | L |
int | index |
Additional Inherited Members | |
Static Public Member Functions inherited from pathfind::cost_calculator | |
static double | getNoPathValue () |
Cost function object relying on a Lua function.
Definition at line 11 of file lua_pathfind_cost_calculator.hpp.
i | the stack position of the lua function to calculate the cost. |
Definition at line 16 of file lua_pathfind_cost_calculator.hpp.
|
inlinevirtual |
Implements pathfind::cost_calculator.
Definition at line 17 of file lua_pathfind_cost_calculator.hpp.
References lua_pop, lua_pushinteger(), lua_pushnumber(), lua_pushvalue(), lua_tonumber, luaW_pcall(), map_location::x, and map_location::y.
int lua_pathfind_cost_calculator::index |
Definition at line 14 of file lua_pathfind_cost_calculator.hpp.
lua_State* lua_pathfind_cost_calculator::L |
Definition at line 13 of file lua_pathfind_cost_calculator.hpp.