From 74cc6669c0bdeb6e02223239a98caf8fd267e5ac Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 7 Jul 2023 00:42:57 +0100 Subject: [PATCH] floodfill,line: add proper comments All @module declarations must go! --- worldeditadditions/lib/floodfill.lua | 7 ++++--- worldeditadditions/lib/line.lua | 10 +++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/worldeditadditions/lib/floodfill.lua b/worldeditadditions/lib/floodfill.lua index d45110d..a6d2c62 100644 --- a/worldeditadditions/lib/floodfill.lua +++ b/worldeditadditions/lib/floodfill.lua @@ -3,9 +3,10 @@ local Vector3 = wea_c.Vector3 --- Flood-fill command for complex lakes etc. --- @module worldeditadditions.floodfill - - +-- @param start_pos Vector3 The position to start floodfilling from. +-- @param radius number The maximum radius to limit the floodfill operation too. +-- @param replace_node string The (normalised) name of the node to replace with when floodfilling. +-- @returns number The number of nodes replaced. function worldeditadditions.floodfill(start_pos, radius, replace_node) start_pos = Vector3.clone(start_pos) diff --git a/worldeditadditions/lib/line.lua b/worldeditadditions/lib/line.lua index ac58950..414862e 100644 --- a/worldeditadditions/lib/line.lua +++ b/worldeditadditions/lib/line.lua @@ -1,8 +1,6 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 ---- Counts the nodes in a given area. --- @module worldeditadditions.count -- ██ ██ ███ ██ ███████ -- ██ ██ ████ ██ ██ @@ -10,7 +8,13 @@ local Vector3 = wea_c.Vector3 -- ██ ██ ██ ██ ██ ██ -- ███████ ██ ██ ████ ███████ - +--- Counts the nodes in a given area. +-- @param pos1 Vector3 The position to start drawing the line from. +-- @param pos2 Vector3 The position to draw the line to. +-- @param thickness number The thickness of the line to draw. +-- @param node_name string The (normalised) name of the node to draw the line with. +-- @returns bool,{replaced=number} 1. A bool indicating whether the operation was successful or not. +-- 2. A table containing statistics. At present the only key in this table is `replaced`, which indicates the number of nodes replaced when drawing the line. function worldeditadditions.line(pos1, pos2, thickness, node_name) local pos1_sorted, pos2_sorted = Vector3.sort(pos1, pos2) -- pos2 will always have the highest co-ordinates now