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