The Battle for Wesnoth  1.17.0-dev
Classes | Namespaces | Functions
lua_terrainmap.hpp File Reference
#include <cstddef>
#include <string>
#include "scripting/lua_common.hpp"
#include "map/location.hpp"
#include "map/map.hpp"
#include "terrain/translation.hpp"
#include "terrain/type_data.hpp"
Include dependency graph for lua_terrainmap.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mapgen_gamemap
 

Namespaces

 lua_terrainmap
 

Functions

int intf_terrain_mask (lua_State *L)
 Replaces part of the map. More...
 
bool luaW_isterrainmap (lua_State *L, int index)
 
gamemap_baseluaW_toterrainmap (lua_State *L, int index)
 
gamemap_baseluaW_checkterrainmap (lua_State *L, int index)
 
void lua_terrainmap_setmetatable (lua_State *L)
 
int intf_terrainmap_create (lua_State *L)
 Create a map. More...
 
int intf_terrainmap_get (lua_State *L)
 
int intf_replace_if_failed (lua_State *L)
 
int intf_terrainmap_iter (lua_State *L)
 
int intf_on_board (lua_State *L)
 
int intf_on_border (lua_State *L)
 
std::string lua_terrainmap::register_metatables (lua_State *L)
 

Function Documentation

◆ intf_on_board()

int intf_on_board ( lua_State L)

◆ intf_on_border()

int intf_on_border ( lua_State L)

◆ intf_replace_if_failed()

int intf_replace_if_failed ( lua_State L)

◆ intf_terrain_mask()

int intf_terrain_mask ( lua_State L)

Replaces part of the map.

  • Arg 1: map location.
  • Arg 2: map data string.
  • Arg 3: table for optional named arguments
    • is_odd: boolean, if Arg2 has the odd map format (as if it was cut from a odd map location)
    • ignore_special_locations: boolean
    • rules: table of tables

Definition at line 486 of file lua_terrainmap.cpp.

References resources::controller, resources::gameboard, play_controller::get_display(), is_odd(), lua_isstring(), lua_istable, lua_pop, luaL_argerror(), luaL_checkstring, luaW_checklocation(), luaW_checkterrainmap(), luaW_table_get_def(), luaW_tableget(), mapgen_gamemap::mapgen_gamemap(), game_display::needs_rebuild(), gamemap_base::overlay(), read_rules_vector(), and t.

Referenced by mapgen_gamemap::for_each_loc(), and game_lua_kernel::game_lua_kernel().

◆ intf_terrainmap_create()

int intf_terrainmap_create ( lua_State L)

Create a map.

  • Arg 1: string describing the map data.
  • or:
  • Arg 1: int, width
  • Arg 2: int, height
  • Arg 3: string, terrain

Definition at line 201 of file lua_terrainmap.cpp.

References gamemap_base::h(), lua_isnumber(), lua_tointeger, luaL_checkstring, luaL_setmetatable(), t_translation::read_terrain_code(), terrainmapKey, and gamemap_base::w().

Referenced by mapgen_gamemap::for_each_loc(), and mapgen_lua_kernel::mapgen_lua_kernel().

◆ intf_terrainmap_get()

int intf_terrainmap_get ( lua_State L)

◆ intf_terrainmap_iter()

int intf_terrainmap_iter ( lua_State L)

◆ lua_terrainmap_setmetatable()

void lua_terrainmap_setmetatable ( lua_State L)

◆ luaW_checkterrainmap()

gamemap_base& luaW_checkterrainmap ( lua_State L,
int  index 
)

◆ luaW_isterrainmap()

bool luaW_isterrainmap ( lua_State L,
int  index 
)

◆ luaW_toterrainmap()

gamemap_base* luaW_toterrainmap ( lua_State L,
int  index 
)

Definition at line 176 of file lua_terrainmap.cpp.

References lua_touserdata(), and luaW_isterrainmap().

Referenced by mapgen_gamemap::for_each_loc().