Update 'Controller/CropController.lua'

This commit is contained in:
manuel 2023-01-14 09:56:35 +00:00
parent 326814c092
commit 748576643f

View File

@ -1,11 +1,13 @@
CropController = {}
CropController.title = "Wheat farm"
function CropController:new(t)
t = t or {}
setmetatable(t, self)
self.__index = self
t.matrix = {}
t.stats = {interval = 900}
t.stats = {}
t.stats["Harvest Interval"] = 900
return t
end
@ -173,4 +175,22 @@ function CropController:displayStats(x,y)
term.write(tostring(v))
y = y + 1
end
end
function CropController:displayTitle(x,y)
term.setCursorPos(x,y)
term.write(self.title)
local width = term.getSize()
for i = 1, width do
term.setCursorPos(i, y+1)
term.write("_")
end
end
function CropController:refreshDisplay()
term.clear()
self:displayTitle(1,1)
self:displayMatrix(1,3)
local matrixHeight = #self.matrix
self:displayMatrix(1, matrixHeight + 3)
end