The Battle for Wesnoth  1.19.7+dev
Macros | Typedefs | Functions | Variables
mapgen_lua_kernel.cpp File Reference
#include "scripting/mapgen_lua_kernel.hpp"
#include "config.hpp"
#include "game_errors.hpp"
#include "log.hpp"
#include "scripting/lua_common.hpp"
#include "scripting/lua_pathfind_cost_calculator.hpp"
#include "scripting/lua_terrainfilter.hpp"
#include "scripting/lua_terrainmap.hpp"
#include "deprecation.hpp"
#include "game_version.hpp"
#include <string>
#include <functional>
#include "scripting/push_check.hpp"
#include "generators/default_map_generator_job.hpp"
Include dependency graph for mapgen_lua_kernel.cpp:

Go to the source code of this file.

Macros

#define ERR_NG   LOG_STREAM(err, log_mapgen)
 
#define LOG_NG   LOG_STREAM(info, log_mapgen)
 
#define DBG_NG   LOG_STREAM(debug, log_mapgen)
 

Typedefs

typedef int(mapgen_lua_kernel::* member_callback) (lua_State *)
 

Functions

template<member_callback method>
int dispatch (lua_State *L)
 
static int intf_random (lua_State *L)
 Returns a random number, same interface as math.random. More...
 
static int intf_default_generate (lua_State *L)
 calls the default mapgenerator. More...
 
static int intf_default_generate_height_map (lua_State *L)
 calls the default mapgenerator. More...
 
static int intf_find_path (lua_State *L)
 Finds a path between two locations. More...
 

Variables

static lg::log_domain log_mapgen ("mapgen")
 

Macro Definition Documentation

◆ DBG_NG

#define DBG_NG   LOG_STREAM(debug, log_mapgen)

Definition at line 37 of file mapgen_lua_kernel.cpp.

◆ ERR_NG

#define ERR_NG   LOG_STREAM(err, log_mapgen)

Definition at line 35 of file mapgen_lua_kernel.cpp.

◆ LOG_NG

#define LOG_NG   LOG_STREAM(info, log_mapgen)

Definition at line 36 of file mapgen_lua_kernel.cpp.

Typedef Documentation

◆ member_callback

typedef int(mapgen_lua_kernel::* member_callback) (lua_State *)

Definition at line 42 of file mapgen_lua_kernel.cpp.

Function Documentation

◆ dispatch()

template<member_callback method>
int dispatch ( lua_State *  L)

Definition at line 45 of file mapgen_lua_kernel.cpp.

◆ intf_default_generate()

static int intf_default_generate ( lua_State *  L)
static

◆ intf_default_generate_height_map()

static int intf_default_generate_height_map ( lua_State *  L)
static

◆ intf_find_path()

static int intf_find_path ( lua_State *  L)
static

Finds a path between two locations.

  • Args 1: source location.
  • Args 2: destination.
  • Arg 3: cost function
  • Args 4,5 size of map.
  • Arg 6 include border. OR
  • Arg 3: options table containing calculate, width, height, (optional) include_borders
  • Ret 1: array of pairs containing path steps.
  • Ret 2: path cost.

Definition at line 179 of file mapgen_lua_kernel.cpp.

References pathfind::a_star_search(), border, dst, i, luaW_checklocation(), luaW_tableget(), luaW_toboolean(), pathfind::plain_route::move_cost, wfl::msg(), src, and pathfind::plain_route::steps.

Referenced by mapgen_lua_kernel::mapgen_lua_kernel().

◆ intf_random()

static int intf_random ( lua_State *  L)
static

Returns a random number, same interface as math.random.

Definition at line 52 of file mapgen_lua_kernel.cpp.

References lua_push().

Referenced by mapgen_lua_kernel::mapgen_lua_kernel().

Variable Documentation

◆ log_mapgen

lg::log_domain log_mapgen("mapgen") ( "mapgen"  )
static