Add lua selection match method

Also improve the replace_terrain command parameters.
This commit is contained in:
Pasi Kallinen
2020-03-02 16:15:40 +02:00
parent ee2821e7e8
commit c9b21e36a7
6 changed files with 244 additions and 90 deletions

View File

@@ -390,6 +390,8 @@ function test_replace_terrain()
des.replace_terrain({ x1=1, y1=1, x2=70,y2=19, fromterrain=".", toterrain="I", lit=1 });
des.replace_terrain({ x1=1, y1=1, x2=70,y2=19, fromterrain=".", toterrain="I", chance=50 });
des.replace_terrain({ region={1,1, 70,19}, fromterrain=".", toterrain="L", chance=25 });
des.replace_terrain({ selection=selection.area(2,5, 10,15), fromterrain="L", toterrain="." });
des.replace_terrain({ mapfragment=[[...]], toterrain="T" });
end
function test_corridor()

View File

@@ -352,9 +352,12 @@ function test_sel_flood()
sel_pt_ne(selb, 5,5, 1, __func__);
sel_pt_ne(selb, 6,5, 1, __func__);
sel_pt_ne(selb, 7,5, 1, __func__);
end -- test_sel_flood
function test_sel_match()
local sel = selection.match([[...]]);
end -- test_sel_match
test_selection_params();
test_sel_negate();
test_sel_logical_and();
@@ -368,3 +371,4 @@ test_sel_randline();
test_sel_grow();
test_sel_filter_mapchar();
test_sel_flood();
test_sel_match();