The Battle for Wesnoth  1.19.0-dev
Classes | Namespaces | Functions
lua_terrainmap.hpp File Reference
#include <string>
#include "map/location.hpp"
#include "map/map.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 481 of file lua_terrainmap.cpp.

References resources::controller, resources::gameboard, play_controller::get_display(), is_odd(), luaW_checklocation(), luaW_checkterrainmap(), luaW_table_get_def(), luaW_tableget(), game_display::needs_rebuild(), gamemap_base::overlay(), read_rules_vector(), and t.

Referenced by 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 196 of file lua_terrainmap.cpp.

References h, t_translation::read_terrain_code(), terrainmapKey, and w.

Referenced by mapgen_lua_kernel::mapgen_lua_kernel().

◆ intf_terrainmap_get()

int intf_terrainmap_get ( lua_State *  L)

Definition at line 211 of file lua_terrainmap.cpp.

References resources::gameboard, and terrainmapKey.

Referenced by game_lua_kernel::impl_current_get().

◆ 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 
)

Definition at line 165 of file lua_terrainmap.cpp.

References utf8::index(), maplocationKey, and terrainmapKey.

Referenced by luaW_checkterrainmap(), and luaW_toterrainmap().

◆ luaW_toterrainmap()

gamemap_base* luaW_toterrainmap ( lua_State *  L,
int  index 
)

Definition at line 171 of file lua_terrainmap.cpp.

References utf8::index(), and luaW_isterrainmap().