#140 partial build packet updates

This commit is contained in:
Mikayla Fischler
2023-02-20 00:49:37 -05:00
parent c4f6c1b289
commit 1be57aaf13
17 changed files with 128 additions and 81 deletions

View File

@@ -814,13 +814,16 @@ function facility.new(num_reactors, cooling_conf)
-- READ STATES/PROPERTIES --
-- get build properties of all machines
function public.get_build()
---@param inc_imatrix boolean? true/nil to include induction matrix build, false to exclude
function public.get_build(inc_imatrix)
local build = {}
build.induction = {}
for i = 1, #self.induction do
local matrix = self.induction[i] ---@type unit_session
build.induction[matrix.get_device_idx()] = { matrix.get_db().formed, matrix.get_db().build }
if inc_imatrix ~= false then
build.induction = {}
for i = 1, #self.induction do
local matrix = self.induction[i] ---@type unit_session
build.induction[matrix.get_device_idx()] = { matrix.get_db().formed, matrix.get_db().build }
end
end
return build