The Battle for Wesnoth  1.19.7+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

lua_State * L
 
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.

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

Definition at line 25 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 
)
inline
Parameters
L_the pointer to the lua interpreter.
ithe stack position of the lua function to calculate the cost.

Definition at line 33 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
inlinevirtual

Member Data Documentation

◆ index

int lua_pathfind_cost_calculator::index

Definition at line 28 of file lua_pathfind_cost_calculator.hpp.

Referenced by cost().

◆ L

lua_State* lua_pathfind_cost_calculator::L

Definition at line 27 of file lua_pathfind_cost_calculator.hpp.

Referenced by cost().


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