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 = {}
CropController.title = "Wheat farm"
function CropController:new(t) function CropController:new(t)
t = t or {} t = t or {}
setmetatable(t, self) setmetatable(t, self)
self.__index = self self.__index = self
t.matrix = {} t.matrix = {}
t.stats = {interval = 900} t.stats = {}
t.stats["Harvest Interval"] = 900
return t return t
end end
@ -174,3 +176,21 @@ function CropController:displayStats(x,y)
y = y + 1 y = y + 1
end end
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