From c50b03c8edcce56ba2897ecef4bdbbad196d6289 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Wed, 17 Feb 2021 13:37:59 -0500 Subject: [PATCH] Rename wesnoth.map.get_locations -> wesnoth.map.find_locations Also rename get_hexes -> find_hexes This is more consistent with the terminology in the units and side modules, where find takes a filter and returns a list but get takes a unique identifier and returns a single element. --- data/lua/core.lua | 6 +++--- src/scripting/game_lua_kernel.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/lua/core.lua b/data/lua/core.lua index df9c07550f172..0710c7c618f04 100644 --- a/data/lua/core.lua +++ b/data/lua/core.lua @@ -744,8 +744,8 @@ if wesnoth.kernel_type() == "Game Lua Kernel" then return setmetatable({x = x, y = y}, hex_mt) end - function wesnoth.map.get_hexes(cfg) - local hexes = wesnoth.map.get_locations(cfg) + function wesnoth.map.find_hexes(cfg) + local hexes = wesnoth.map.find_locations(cfg) for i = 1, #hexes do hexes[i] = wesnoth.map.get_hex(hexes[i].x, hexes[i].y) end @@ -1003,7 +1003,7 @@ if wesnoth.kernel_type() == "Game Lua Kernel" then wesnoth.label = wesnoth.deprecate_api('wesnoth.label', 'wesnoth.map.add_label', 1, nil, wesnoth.map.add_label) wesnoth.add_time_area = wesnoth.deprecate_api('wesnoth.add_time_area', 'wesnoth.map.place_area', 1, nil, wesnoth.map.place_area) wesnoth.remove_time_area = wesnoth.deprecate_api('wesnoth.remove_time_are', 'wesnoth.map.remove_area', 1, nil, wesnoth.map.remove_area) - wesnoth.get_locations = wesnoth.deprecate_api('wesnoth.get_locations', 'wesnoth.map.get_locations', 1, nil, wesnoth.map.get_locations) + wesnoth.get_locations = wesnoth.deprecate_api('wesnoth.get_locations', 'wesnoth.map.find_locations', 1, nil, wesnoth.map.find_locations) wesnoth.get_villages = wesnoth.deprecate_api('wesnoth.get_locations', 'wesnoth.map.get_locations', 1, nil, function(cfg) return wesnoth.map.get_locations{ gives_income = true, diff --git a/src/scripting/game_lua_kernel.cpp b/src/scripting/game_lua_kernel.cpp index a7f2afa8190d0..d282a8618c08e 100644 --- a/src/scripting/game_lua_kernel.cpp +++ b/src/scripting/game_lua_kernel.cpp @@ -4148,7 +4148,7 @@ game_lua_kernel::game_lua_kernel(game_state & gs, play_controller & pc, reports {"place_area", &dispatch<&game_lua_kernel::intf_add_time_area>}, {"remove_area", &dispatch<&game_lua_kernel::intf_remove_time_area>}, // Filters - {"get_locations", &dispatch<&game_lua_kernel::intf_get_locations>}, + {"find_locations", &dispatch<&game_lua_kernel::intf_get_locations>}, {"match_location", &dispatch<&game_lua_kernel::intf_match_location>}, { nullptr, nullptr } };