The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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:
Inheritance graph

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_StateL
 
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 23 of file lua_pathfind_cost_calculator.hpp.

Constructor & Destructor Documentation

lua_pathfind_cost_calculator::lua_pathfind_cost_calculator ( lua_State L_,
int  i 
)
inline
Parameters
ithe stack position of the lua function to calculate the cost.

Definition at line 28 of file lua_pathfind_cost_calculator.hpp.

Member Function Documentation

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

Member Data Documentation

int lua_pathfind_cost_calculator::index

Definition at line 26 of file lua_pathfind_cost_calculator.hpp.

lua_State* lua_pathfind_cost_calculator::L

Definition at line 25 of file lua_pathfind_cost_calculator.hpp.


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