Start implementing coal generator

This commit is contained in:
2023-03-01 12:16:33 +01:00
parent f6383b020f
commit 511c4948d6
3 changed files with 101 additions and 1 deletions

View File

@@ -31,6 +31,9 @@ industrialtest.api.hasPowerStorage=function(meta)
end
return true
end
industrialtest.api.isFullyCharged=function(meta)
return meta:get_int("industrialtest.powerAmount")>=meta:get_int("industrialtest.powerCapacity")
end
industrialtest.api.addPower=function(meta,amount)
local powerAmount=meta:get_int("industrialtest.powerAmount")
local powerCapacity=meta:get_int("industrialtest.powerCapacity")
@@ -53,7 +56,7 @@ industrialtest.api.powerFlow=function(pos)
vector.offset(pos,0,-1,0),
vector.offset(pos,0,1,0),
vector.offset(pos,0,0,-1),
vector.offset(pos,0,0,-1)
vector.offset(pos,0,0,1)
}
local neighbours={}
for key,value in ipairs(neighbourPositions) do