From e4a35514abf631665392328913a47a056cad744a Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sat, 15 Aug 2020 23:03:49 -0700 Subject: [PATCH] document buildingplan Lua API --- docs/Lua API.rst | 9 +++++++++ plugins/lua/buildingplan.lua | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/docs/Lua API.rst b/docs/Lua API.rst index 45ccd46a9..a890489d9 100644 --- a/docs/Lua API.rst +++ b/docs/Lua API.rst @@ -3607,6 +3607,15 @@ Native functions: ``start`` and ``end`` are tables containing positions (see ``xyz2pos``). ``name`` is used as the basis for the filename. +buildingplan +============ + +Native functions: + +* ``bool isPlannableBuilding(df::building_type type)`` returns whether the building type is handled by buildingplan +* ``void addPlannedBuilding(df::building *bld)`` suspends the building jobs and adds the building to the monitor list +* ``void doCycle()`` runs a check for whether buildlings in the monitor list can be assigned items and unsuspended. This method runs automatically twice a game day, so you only need to call it directly if you want buildingplan to do a check right now. + burrows ======= diff --git a/plugins/lua/buildingplan.lua b/plugins/lua/buildingplan.lua index c1f86081c..071c07395 100644 --- a/plugins/lua/buildingplan.lua +++ b/plugins/lua/buildingplan.lua @@ -1,3 +1,13 @@ local _ENV = mkmodule('plugins.buildingplan') +--[[ + + Native functions: + + * bool isPlannableBuilding(df::building_type type) + * void addPlannedBuilding(df::building *bld) + * void doCycle() + +--]] + return _ENV