Added turtle file
parent
816f9c1802
commit
d5655734cb
|
@ -0,0 +1,27 @@
|
||||||
|
-- Created by Jef Roosens
|
||||||
|
|
||||||
|
|
||||||
|
local module = {}
|
||||||
|
local Turtle = {
|
||||||
|
pos = {x=0, y=0, z=0},
|
||||||
|
dir = 'N'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
-- Init the turtle
|
||||||
|
--
|
||||||
|
-- @param o turtle object
|
||||||
|
-- @return initialized turtle object
|
||||||
|
function Turtle:new(o)
|
||||||
|
-- Init object
|
||||||
|
o = o or {}
|
||||||
|
setmetatable(o, self)
|
||||||
|
self.__index = self
|
||||||
|
|
||||||
|
-- Get fuel level if not provided
|
||||||
|
if o.fuel == nil then
|
||||||
|
o.fuel = turtle.getFuelLevel()
|
||||||
|
end
|
||||||
|
|
||||||
|
return o
|
||||||
|
end
|
Loading…
Reference in New Issue