The Battle for Wesnoth  1.17.0-dev
Public Member Functions | Public Attributes | List of all members
lua_pathfind_cost_calculator Struct Reference

Cost function object relying on a Lua function. More...

#include <lua_pathfind_cost_calculator.hpp>

Inheritance diagram for lua_pathfind_cost_calculator:

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

int index

Additional Inherited Members

- Static Public Member Functions inherited from pathfind::cost_calculator
static double getNoPathValue ()

Detailed Description

Cost function object relying on a Lua function.

The stack index of the Lua function must be valid each time the cost is computed.

Definition at line 24 of file lua_pathfind_cost_calculator.hpp.

Constructor & Destructor Documentation

◆ lua_pathfind_cost_calculator()

lua_pathfind_cost_calculator::lua_pathfind_cost_calculator ( lua_State L_,
int  i 
L_the pointer to the lua interpreter.
ithe stack position of the lua function to calculate the cost.

Definition at line 32 of file lua_pathfind_cost_calculator.hpp.

Member Function Documentation

◆ cost()

double lua_pathfind_cost_calculator::cost ( const map_location loc,
const double  so_far 
) const

Member Data Documentation

◆ index

int lua_pathfind_cost_calculator::index

Definition at line 27 of file lua_pathfind_cost_calculator.hpp.

◆ L

lua_State* lua_pathfind_cost_calculator::L

Definition at line 26 of file lua_pathfind_cost_calculator.hpp.

The documentation for this struct was generated from the following file: