aboutsummaryrefslogtreecommitdiff
path: root/examples/jarvis.js
diff options
context:
space:
mode:
authorHolden Rohrer <holden.rohrer@gmail.com>2019-12-18 20:57:16 -0500
committerHolden Rohrer <holden.rohrer@gmail.com>2019-12-18 20:57:16 -0500
commit84d292cfdad4249885e43b7123634e5a8dd0ff1f (patch)
tree1f4b3f0b674f85dc033275fb5ad49f19aa7058c7 /examples/jarvis.js
parentcb7d31d863320db9257a619eea0422cc43bb05a4 (diff)
updated socket and space to export the main class
Diffstat (limited to 'examples/jarvis.js')
-rw-r--r--examples/jarvis.js25
1 files changed, 21 insertions, 4 deletions
diff --git a/examples/jarvis.js b/examples/jarvis.js
index a130f17..e6bafc5 100644
--- a/examples/jarvis.js
+++ b/examples/jarvis.js
@@ -1,9 +1,22 @@
// A bot which responds to `jarvis` with a box
-const space = require('../space');
-const socket = require('../socket');
+const Space = require('../space');
+const Socket = require('../socket');
+const getdims = require('../utils/getdims');
-var main = new socket.Socket();
+var main = new Socket();
+
+function Sparse(){ // A "sparse" data-storage mechanism
+ this.data = [];
+ this.avail = [];
+ this.add = function(data){
+
+ }
+ this.del = function(id){
+ this.avail.push(id);
+ this.data[id] = null;
+ }
+}
function equals(arg1,arg2){ // Just takes the specific case argument of each being an int pair
return arg1[0] == arg2[0] && arg1[1] == arg2[1]
@@ -22,5 +35,9 @@ main.on('open', ()=>{ // Tries to identify itself with a cursor movement
})
main.on('identity', (sender) => {
-
+ main.on('tileUpdate', (send, source, tiles) => {
+ if (send == sender) return;
+ // Get dimensions somehow
+
+ })
}