From c768177c8434a6644809a995b240217a7129ccd5 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Tue, 7 Nov 2023 07:31:14 +0900 Subject: [PATCH] add agent script --- demo/src/agentscript.js | 17 +++++++++++++++++ jsdoc-config.json | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 demo/src/agentscript.js diff --git a/demo/src/agentscript.js b/demo/src/agentscript.js new file mode 100644 index 00000000..eb2185c2 --- /dev/null +++ b/demo/src/agentscript.js @@ -0,0 +1,17 @@ +/** + * Subclass of Array with convenience methods used by NetLogo. + * Typically the items in the array are Objects but can be any type. + */ +class AgentArray extends Array { + /** + * Creates an instance of AgentArray. Simply pass-through to super() + * now, but may add initialization code later. + * @param {*} args Zero or more items in Array + * @example + * let aa = new AgentArray({x:0,y:0}, {x:0,y:1}, {x:1,y:0}) + * console.log(aa) //=> [{ x: 0, y: 0 }, { x: 0, y: 1 }, { x: 1, y: 0 }] + */ + constructor() { + + } +} \ No newline at end of file diff --git a/jsdoc-config.json b/jsdoc-config.json index 22d565e4..0307a9e4 100644 --- a/jsdoc-config.json +++ b/jsdoc-config.json @@ -66,7 +66,8 @@ ], "options": { "js_external": "https://code.jquery.com/jquery-3.6.0.min.js", - "js_pre_processor": "babel" + "js_pre_processor": "babel", + "js": "import {AgentArray} from 'https://unpkg.com/agentscript@0.10.19/dist/agentscript.js'" } }, "prefixModuleToSidebarItems_experimental": true