You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,6 @@ This Emulator is exclusively ment to enable testing CC code with a testingframew
4
4
5
5
### WIP
6
6
7
-
> This Libary is not finished at all at this point and <b><u> will not work yet.</b></u>
8
7
> Should increase in scope incrementally. For now it (will) only keep track of position and turtle-direction
9
8
10
9
### HOW TO USE
@@ -15,7 +14,16 @@ local turtleEmulator = require("<path>/turtleEmulator")
15
14
localturtleOne=turtleEmulator:createTurtle()
16
15
localturtleTwo=turtleEmulator:createTurtle()
17
16
18
-
--currently this will only work with a self reference, will work on removing this neccessity
19
-
-- one possibilty is a Proxy table in the turtleEmulator #todo
17
+
-- override the default behavior, skipping fuelcheck etc.
18
+
turtleTwo.canMoveToCheck=function() returntrueend
20
19
20
+
turtleOne.forward()
21
+
assert(turtleOne.position.x==1)
22
+
23
+
--...
21
24
```
25
+
26
+
### Restrictions
27
+
28
+
To allow the creation of multiple turtles within the same Emulator, the turtle returned by createTurtle is only a proxy, meaning that the metatable should not be modified.
29
+
However, should the need ever arise, you can modify it by getmetatable(turtle).\_\_metatable = nil. But please be aware that overriding the \_\_index and \_\_newIndex will break the functionality of the turtle.
0 commit comments