Update 'Controller/CropController.lua'
This commit is contained in:
parent
326814c092
commit
748576643f
@ -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
|
Loading…
x
Reference in New Issue
Block a user