diff --git a/README.md b/README.md index 19c51af..392b5f3 100644 --- a/README.md +++ b/README.md @@ -24,15 +24,21 @@ This entity system is designed to be as simple as possible, while still having u ### Features -* High performance, memoized entity queries - * O(1) average time -* All definitions are optional +* **High performance indexing options** + * SimpleIndex (Default): O(1) component add/remove, O(m) query time + * Where `m` is the smallest size component index + * MemoizedQueryIndex: O(q) component add/remove, O(1) average query time (memoized), O(n) worst query time (initial) + * Where `q` is the total number of memoized queries + * And `n` is the total number of entities + * *Note: Above time complexities are amortized assuming the number of components used is a known constant* + * Can also write your own and pass it to the World constructor! Needs clear, add, remove, and query. +* **No formal declarations required** * Can create components and entities in a world and query on them, without needing to define structured systems and components -* Strings as component keys +* **Strings as component keys** * No need to manually track component keys like many libraries -* JSON serialization +* **JSON serialization** * Useful for save data and networked applications -* Prototypes +* **Prototypes** * Allows entity definitions to be data-driven, outside of code ### Terminology diff --git a/docs/ast/source/entity.js.json b/docs/ast/source/entity.js.json index f0d9ba9..37ca2aa 100644 --- a/docs/ast/source/entity.js.json +++ b/docs/ast/source/entity.js.json @@ -1,28 +1,28 @@ { "type": "File", "start": 0, - "end": 9906, + "end": 9720, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 360, + "line": 352, "column": 0 } }, "program": { "type": "Program", "start": 0, - "end": 9906, + "end": 9720, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 360, + "line": 352, "column": 0 } }, @@ -232,14 +232,14 @@ { "type": "ClassDeclaration", "start": 146, - "end": 9880, + "end": 9694, "loc": { "start": { "line": 9, "column": 0 }, "end": { - "line": 357, + "line": 349, "column": 1 } }, @@ -265,14 +265,14 @@ "body": { "type": "ClassBody", "start": 159, - "end": 9880, + "end": 9694, "loc": { "start": { "line": 9, "column": 13 }, "end": { - "line": 357, + "line": 349, "column": 1 } }, @@ -280,14 +280,14 @@ { "type": "ClassMethod", "start": 438, - "end": 684, + "end": 572, "loc": { "start": { "line": 19, "column": 1 }, "end": { - "line": 33, + "line": 28, "column": 2 } }, @@ -355,14 +355,14 @@ "body": { "type": "BlockStatement", "start": 461, - "end": 684, + "end": 572, "loc": { "start": { "line": 19, "column": 24 }, "end": { - "line": 33, + "line": 28, "column": 2 } }, @@ -736,12 +736,9 @@ "column": 16 } }, - "properties": [], - "leadingComments": null, - "trailingComments": null + "properties": [] }, - "leadingComments": null, - "trailingComments": null + "leadingComments": null }, "leadingComments": [ { @@ -760,304 +757,6 @@ } } } - ], - "trailingComments": [ - { - "type": "CommentLine", - "value": " Add to the index, to update match all index", - "start": 573, - "end": 619, - "loc": { - "start": { - "line": 29, - "column": 2 - }, - "end": { - "line": 29, - "column": 48 - } - } - } - ] - }, - { - "type": "IfStatement", - "start": 622, - "end": 681, - "loc": { - "start": { - "line": 30, - "column": 2 - }, - "end": { - "line": 32, - "column": 3 - } - }, - "test": { - "type": "CallExpression", - "start": 626, - "end": 638, - "loc": { - "start": { - "line": 30, - "column": 6 - }, - "end": { - "line": 30, - "column": 18 - } - }, - "callee": { - "type": "MemberExpression", - "start": 626, - "end": 636, - "loc": { - "start": { - "line": 30, - "column": 6 - }, - "end": { - "line": 30, - "column": 16 - } - }, - "object": { - "type": "ThisExpression", - "start": 626, - "end": 630, - "loc": { - "start": { - "line": 30, - "column": 6 - }, - "end": { - "line": 30, - "column": 10 - } - }, - "leadingComments": null - }, - "property": { - "type": "Identifier", - "start": 631, - "end": 636, - "loc": { - "start": { - "line": 30, - "column": 11 - }, - "end": { - "line": 30, - "column": 16 - }, - "identifierName": "valid" - }, - "name": "valid" - }, - "computed": false, - "leadingComments": null - }, - "arguments": [], - "leadingComments": null - }, - "consequent": { - "type": "BlockStatement", - "start": 640, - "end": 681, - "loc": { - "start": { - "line": 30, - "column": 20 - }, - "end": { - "line": 32, - "column": 3 - } - }, - "body": [ - { - "type": "ExpressionStatement", - "start": 645, - "end": 677, - "loc": { - "start": { - "line": 31, - "column": 3 - }, - "end": { - "line": 31, - "column": 35 - } - }, - "expression": { - "type": "CallExpression", - "start": 645, - "end": 677, - "loc": { - "start": { - "line": 31, - "column": 3 - }, - "end": { - "line": 31, - "column": 35 - } - }, - "callee": { - "type": "MemberExpression", - "start": 645, - "end": 671, - "loc": { - "start": { - "line": 31, - "column": 3 - }, - "end": { - "line": 31, - "column": 29 - } - }, - "object": { - "type": "MemberExpression", - "start": 645, - "end": 661, - "loc": { - "start": { - "line": 31, - "column": 3 - }, - "end": { - "line": 31, - "column": 19 - } - }, - "object": { - "type": "MemberExpression", - "start": 645, - "end": 655, - "loc": { - "start": { - "line": 31, - "column": 3 - }, - "end": { - "line": 31, - "column": 13 - } - }, - "object": { - "type": "ThisExpression", - "start": 645, - "end": 649, - "loc": { - "start": { - "line": 31, - "column": 3 - }, - "end": { - "line": 31, - "column": 7 - } - } - }, - "property": { - "type": "Identifier", - "start": 650, - "end": 655, - "loc": { - "start": { - "line": 31, - "column": 8 - }, - "end": { - "line": 31, - "column": 13 - }, - "identifierName": "world" - }, - "name": "world" - }, - "computed": false - }, - "property": { - "type": "Identifier", - "start": 656, - "end": 661, - "loc": { - "start": { - "line": 31, - "column": 14 - }, - "end": { - "line": 31, - "column": 19 - }, - "identifierName": "index" - }, - "name": "index" - }, - "computed": false - }, - "property": { - "type": "Identifier", - "start": 662, - "end": 671, - "loc": { - "start": { - "line": 31, - "column": 20 - }, - "end": { - "line": 31, - "column": 29 - }, - "identifierName": "addEntity" - }, - "name": "addEntity" - }, - "computed": false - }, - "arguments": [ - { - "type": "ThisExpression", - "start": 672, - "end": 676, - "loc": { - "start": { - "line": 31, - "column": 30 - }, - "end": { - "line": 31, - "column": 34 - } - } - } - ] - } - } - ], - "directives": [] - }, - "alternate": null, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Add to the index, to update match all index", - "start": 573, - "end": 619, - "loc": { - "start": { - "line": 29, - "column": 2 - }, - "end": { - "line": 29, - "column": 48 - } - } - } ] } ], @@ -1086,15 +785,15 @@ { "type": "CommentBlock", "value": "*\n\t * Return the entity ID.\n\t *\n\t * @return {number} Integer entity ID\n\t ", - "start": 687, - "end": 764, + "start": 575, + "end": 652, "loc": { "start": { - "line": 35, + "line": 30, "column": 1 }, "end": { - "line": 39, + "line": 34, "column": 4 } } @@ -1103,15 +802,15 @@ }, { "type": "ClassMethod", - "start": 766, - "end": 797, + "start": 654, + "end": 685, "loc": { "start": { - "line": 40, + "line": 35, "column": 1 }, "end": { - "line": 42, + "line": 37, "column": 2 } }, @@ -1119,15 +818,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 770, - "end": 772, + "start": 658, + "end": 660, "loc": { "start": { - "line": 40, + "line": 35, "column": 5 }, "end": { - "line": 40, + "line": 35, "column": 7 }, "identifierName": "id" @@ -1142,73 +841,73 @@ "params": [], "body": { "type": "BlockStatement", - "start": 775, - "end": 797, + "start": 663, + "end": 685, "loc": { "start": { - "line": 40, + "line": 35, "column": 10 }, "end": { - "line": 42, + "line": 37, "column": 2 } }, "body": [ { "type": "ReturnStatement", - "start": 779, - "end": 794, + "start": 667, + "end": 682, "loc": { "start": { - "line": 41, + "line": 36, "column": 2 }, "end": { - "line": 41, + "line": 36, "column": 17 } }, "argument": { "type": "MemberExpression", - "start": 786, - "end": 794, + "start": 674, + "end": 682, "loc": { "start": { - "line": 41, + "line": 36, "column": 9 }, "end": { - "line": 41, + "line": 36, "column": 17 } }, "object": { "type": "ThisExpression", - "start": 786, - "end": 790, + "start": 674, + "end": 678, "loc": { "start": { - "line": 41, + "line": 36, "column": 9 }, "end": { - "line": 41, + "line": 36, "column": 13 } } }, "property": { "type": "Identifier", - "start": 791, - "end": 794, + "start": 679, + "end": 682, "loc": { "start": { - "line": 41, + "line": 36, "column": 14 }, "end": { - "line": 41, + "line": 36, "column": 17 }, "identifierName": "_id" @@ -1226,15 +925,15 @@ { "type": "CommentBlock", "value": "*\n\t * Return the entity ID.\n\t *\n\t * @return {number} Integer entity ID\n\t ", - "start": 687, - "end": 764, + "start": 575, + "end": 652, "loc": { "start": { - "line": 35, + "line": 30, "column": 1 }, "end": { - "line": 39, + "line": 34, "column": 4 } } @@ -1244,15 +943,15 @@ { "type": "CommentBlock", "value": "*\n\t * ID is read-only, attempting to set it will throw an error.\n\t *\n\t * @private\n\t *\n\t * @throws {Error} Cannot set entity id\n\t ", - "start": 800, - "end": 933, + "start": 688, + "end": 821, "loc": { "start": { - "line": 44, + "line": 39, "column": 1 }, "end": { - "line": 50, + "line": 45, "column": 4 } } @@ -1261,15 +960,15 @@ }, { "type": "ClassMethod", - "start": 935, - "end": 992, + "start": 823, + "end": 880, "loc": { "start": { - "line": 51, + "line": 46, "column": 1 }, "end": { - "line": 53, + "line": 48, "column": 2 } }, @@ -1277,15 +976,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 939, - "end": 941, + "start": 827, + "end": 829, "loc": { "start": { - "line": 51, + "line": 46, "column": 5 }, "end": { - "line": 51, + "line": 46, "column": 7 }, "identifierName": "id" @@ -1300,15 +999,15 @@ "params": [ { "type": "Identifier", - "start": 942, - "end": 944, + "start": 830, + "end": 832, "loc": { "start": { - "line": 51, + "line": 46, "column": 8 }, "end": { - "line": 51, + "line": 46, "column": 10 }, "identifierName": "id" @@ -1318,58 +1017,58 @@ ], "body": { "type": "BlockStatement", - "start": 946, - "end": 992, + "start": 834, + "end": 880, "loc": { "start": { - "line": 51, + "line": 46, "column": 12 }, "end": { - "line": 53, + "line": 48, "column": 2 } }, "body": [ { "type": "ThrowStatement", - "start": 950, - "end": 989, + "start": 838, + "end": 877, "loc": { "start": { - "line": 52, + "line": 47, "column": 2 }, "end": { - "line": 52, + "line": 47, "column": 41 } }, "argument": { "type": "NewExpression", - "start": 956, - "end": 989, + "start": 844, + "end": 877, "loc": { "start": { - "line": 52, + "line": 47, "column": 8 }, "end": { - "line": 52, + "line": 47, "column": 41 } }, "callee": { "type": "Identifier", - "start": 960, - "end": 965, + "start": 848, + "end": 853, "loc": { "start": { - "line": 52, + "line": 47, "column": 12 }, "end": { - "line": 52, + "line": 47, "column": 17 }, "identifierName": "Error" @@ -1379,15 +1078,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 966, - "end": 988, + "start": 854, + "end": 876, "loc": { "start": { - "line": 52, + "line": 47, "column": 18 }, "end": { - "line": 52, + "line": 47, "column": 40 } }, @@ -1408,15 +1107,15 @@ { "type": "CommentBlock", "value": "*\n\t * ID is read-only, attempting to set it will throw an error.\n\t *\n\t * @private\n\t *\n\t * @throws {Error} Cannot set entity id\n\t ", - "start": 800, - "end": 933, + "start": 688, + "end": 821, "loc": { "start": { - "line": 44, + "line": 39, "column": 1 }, "end": { - "line": 50, + "line": 45, "column": 4 } } @@ -1426,15 +1125,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns true if the entity has ALL of the specified component names.\n\t * Additional components that the entity has, which are not specified in has(), will be ignored.\n\t * If no component names are specified, this method returns true.\n\t *\n\t * @example\n\t * if (entity.has('position', 'velocity')) {...}\n\t *\n\t * @param {...string} [components] - The component names to check for\n\t *\n\t * @return {boolean} true or false\n\t ", - "start": 995, - "end": 1423, + "start": 883, + "end": 1311, "loc": { "start": { - "line": 55, + "line": 50, "column": 1 }, "end": { - "line": 66, + "line": 61, "column": 4 } } @@ -1443,15 +1142,15 @@ }, { "type": "ClassMethod", - "start": 1425, - "end": 1501, + "start": 1313, + "end": 1389, "loc": { "start": { - "line": 67, + "line": 62, "column": 1 }, "end": { - "line": 69, + "line": 64, "column": 2 } }, @@ -1459,15 +1158,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 1425, - "end": 1428, + "start": 1313, + "end": 1316, "loc": { "start": { - "line": 67, + "line": 62, "column": 1 }, "end": { - "line": 67, + "line": 62, "column": 4 }, "identifierName": "has" @@ -1483,29 +1182,29 @@ "params": [ { "type": "RestElement", - "start": 1429, - "end": 1442, + "start": 1317, + "end": 1330, "loc": { "start": { - "line": 67, + "line": 62, "column": 5 }, "end": { - "line": 67, + "line": 62, "column": 18 } }, "argument": { "type": "Identifier", - "start": 1432, - "end": 1442, + "start": 1320, + "end": 1330, "loc": { "start": { - "line": 67, + "line": 62, "column": 8 }, "end": { - "line": 67, + "line": 62, "column": 18 }, "identifierName": "components" @@ -1516,72 +1215,72 @@ ], "body": { "type": "BlockStatement", - "start": 1444, - "end": 1501, + "start": 1332, + "end": 1389, "loc": { "start": { - "line": 67, + "line": 62, "column": 20 }, "end": { - "line": 69, + "line": 64, "column": 2 } }, "body": [ { "type": "ReturnStatement", - "start": 1448, - "end": 1498, + "start": 1336, + "end": 1386, "loc": { "start": { - "line": 68, + "line": 63, "column": 2 }, "end": { - "line": 68, + "line": 63, "column": 52 } }, "argument": { "type": "CallExpression", - "start": 1455, - "end": 1498, + "start": 1343, + "end": 1386, "loc": { "start": { - "line": 68, + "line": 63, "column": 9 }, "end": { - "line": 68, + "line": 63, "column": 52 } }, "callee": { "type": "MemberExpression", - "start": 1455, - "end": 1471, + "start": 1343, + "end": 1359, "loc": { "start": { - "line": 68, + "line": 63, "column": 9 }, "end": { - "line": 68, + "line": 63, "column": 25 } }, "object": { "type": "Identifier", - "start": 1455, - "end": 1465, + "start": 1343, + "end": 1353, "loc": { "start": { - "line": 68, + "line": 63, "column": 9 }, "end": { - "line": 68, + "line": 63, "column": 19 }, "identifierName": "components" @@ -1590,15 +1289,15 @@ }, "property": { "type": "Identifier", - "start": 1466, - "end": 1471, + "start": 1354, + "end": 1359, "loc": { "start": { - "line": 68, + "line": 63, "column": 20 }, "end": { - "line": 68, + "line": 63, "column": 25 }, "identifierName": "every" @@ -1610,15 +1309,15 @@ "arguments": [ { "type": "ArrowFunctionExpression", - "start": 1472, - "end": 1497, + "start": 1360, + "end": 1385, "loc": { "start": { - "line": 68, + "line": 63, "column": 26 }, "end": { - "line": 68, + "line": 63, "column": 51 } }, @@ -1629,15 +1328,15 @@ "params": [ { "type": "Identifier", - "start": 1472, - "end": 1476, + "start": 1360, + "end": 1364, "loc": { "start": { - "line": 68, + "line": 63, "column": 26 }, "end": { - "line": 68, + "line": 63, "column": 30 }, "identifierName": "name" @@ -1647,29 +1346,29 @@ ], "body": { "type": "BinaryExpression", - "start": 1480, - "end": 1497, + "start": 1368, + "end": 1385, "loc": { "start": { - "line": 68, + "line": 63, "column": 34 }, "end": { - "line": 68, + "line": 63, "column": 51 } }, "left": { "type": "Identifier", - "start": 1480, - "end": 1484, + "start": 1368, + "end": 1372, "loc": { "start": { - "line": 68, + "line": 63, "column": 34 }, "end": { - "line": 68, + "line": 63, "column": 38 }, "identifierName": "name" @@ -1679,44 +1378,44 @@ "operator": "in", "right": { "type": "MemberExpression", - "start": 1488, - "end": 1497, + "start": 1376, + "end": 1385, "loc": { "start": { - "line": 68, + "line": 63, "column": 42 }, "end": { - "line": 68, + "line": 63, "column": 51 } }, "object": { "type": "ThisExpression", - "start": 1488, - "end": 1492, + "start": 1376, + "end": 1380, "loc": { "start": { - "line": 68, + "line": 63, "column": 42 }, "end": { - "line": 68, + "line": 63, "column": 46 } } }, "property": { "type": "Identifier", - "start": 1493, - "end": 1497, + "start": 1381, + "end": 1385, "loc": { "start": { - "line": 68, + "line": 63, "column": 47 }, "end": { - "line": 68, + "line": 63, "column": 51 }, "identifierName": "data" @@ -1738,15 +1437,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns true if the entity has ALL of the specified component names.\n\t * Additional components that the entity has, which are not specified in has(), will be ignored.\n\t * If no component names are specified, this method returns true.\n\t *\n\t * @example\n\t * if (entity.has('position', 'velocity')) {...}\n\t *\n\t * @param {...string} [components] - The component names to check for\n\t *\n\t * @return {boolean} true or false\n\t ", - "start": 995, - "end": 1423, + "start": 883, + "end": 1311, "loc": { "start": { - "line": 55, + "line": 50, "column": 1 }, "end": { - "line": 66, + "line": 61, "column": 4 } } @@ -1756,15 +1455,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns a component by name, or undefined if it doesn't exist\n\t *\n\t * @example\n\t * let position = entity.get('position')\n\t *\n\t * @param {string} component - The component name to get\n\t *\n\t * @return {Object} The component if defined, otherwise undefined\n\t ", - "start": 1504, - "end": 1770, + "start": 1392, + "end": 1658, "loc": { "start": { - "line": 71, + "line": 66, "column": 1 }, "end": { - "line": 80, + "line": 75, "column": 4 } } @@ -1773,15 +1472,15 @@ }, { "type": "ClassMethod", - "start": 1772, - "end": 1821, + "start": 1660, + "end": 1709, "loc": { "start": { - "line": 81, + "line": 76, "column": 1 }, "end": { - "line": 83, + "line": 78, "column": 2 } }, @@ -1789,15 +1488,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 1772, - "end": 1775, + "start": 1660, + "end": 1663, "loc": { "start": { - "line": 81, + "line": 76, "column": 1 }, "end": { - "line": 81, + "line": 76, "column": 4 }, "identifierName": "get" @@ -1813,15 +1512,15 @@ "params": [ { "type": "Identifier", - "start": 1776, - "end": 1785, + "start": 1664, + "end": 1673, "loc": { "start": { - "line": 81, + "line": 76, "column": 5 }, "end": { - "line": 81, + "line": 76, "column": 14 }, "identifierName": "component" @@ -1831,87 +1530,87 @@ ], "body": { "type": "BlockStatement", - "start": 1787, - "end": 1821, + "start": 1675, + "end": 1709, "loc": { "start": { - "line": 81, + "line": 76, "column": 16 }, "end": { - "line": 83, + "line": 78, "column": 2 } }, "body": [ { "type": "ReturnStatement", - "start": 1791, - "end": 1818, + "start": 1679, + "end": 1706, "loc": { "start": { - "line": 82, + "line": 77, "column": 2 }, "end": { - "line": 82, + "line": 77, "column": 29 } }, "argument": { "type": "MemberExpression", - "start": 1798, - "end": 1818, + "start": 1686, + "end": 1706, "loc": { "start": { - "line": 82, + "line": 77, "column": 9 }, "end": { - "line": 82, + "line": 77, "column": 29 } }, "object": { "type": "MemberExpression", - "start": 1798, - "end": 1807, + "start": 1686, + "end": 1695, "loc": { "start": { - "line": 82, + "line": 77, "column": 9 }, "end": { - "line": 82, + "line": 77, "column": 18 } }, "object": { "type": "ThisExpression", - "start": 1798, - "end": 1802, + "start": 1686, + "end": 1690, "loc": { "start": { - "line": 82, + "line": 77, "column": 9 }, "end": { - "line": 82, + "line": 77, "column": 13 } } }, "property": { "type": "Identifier", - "start": 1803, - "end": 1807, + "start": 1691, + "end": 1695, "loc": { "start": { - "line": 82, + "line": 77, "column": 14 }, "end": { - "line": 82, + "line": 77, "column": 18 }, "identifierName": "data" @@ -1922,15 +1621,15 @@ }, "property": { "type": "Identifier", - "start": 1808, - "end": 1817, + "start": 1696, + "end": 1705, "loc": { "start": { - "line": 82, + "line": 77, "column": 19 }, "end": { - "line": 82, + "line": 77, "column": 28 }, "identifierName": "component" @@ -1948,15 +1647,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns a component by name, or undefined if it doesn't exist\n\t *\n\t * @example\n\t * let position = entity.get('position')\n\t *\n\t * @param {string} component - The component name to get\n\t *\n\t * @return {Object} The component if defined, otherwise undefined\n\t ", - "start": 1504, - "end": 1770, + "start": 1392, + "end": 1658, "loc": { "start": { - "line": 71, + "line": 66, "column": 1 }, "end": { - "line": 80, + "line": 75, "column": 4 } } @@ -1966,15 +1665,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns a component by name (automatically created if it doesn't exist)\n\t *\n\t * @example\n\t * let position = entity.access('position', 3, 4)\n\t *\n\t * @param {string} component - The component name to create/get\n\t * @param {...Object} [args] - The arguments to forward to create the new component, only if it doesn't exist.\n\t *\n\t * @return {Object} Always returns either the existing component, or the newly created one.\n\t ", - "start": 1824, - "end": 2260, + "start": 1712, + "end": 2148, "loc": { "start": { - "line": 85, + "line": 80, "column": 1 }, "end": { - "line": 95, + "line": 90, "column": 4 } } @@ -1983,15 +1682,15 @@ }, { "type": "ClassMethod", - "start": 2262, - "end": 2389, + "start": 2150, + "end": 2277, "loc": { "start": { - "line": 96, + "line": 91, "column": 1 }, "end": { - "line": 101, + "line": 96, "column": 2 } }, @@ -1999,15 +1698,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 2262, - "end": 2268, + "start": 2150, + "end": 2156, "loc": { "start": { - "line": 96, + "line": 91, "column": 1 }, "end": { - "line": 96, + "line": 91, "column": 7 }, "identifierName": "access" @@ -2023,15 +1722,15 @@ "params": [ { "type": "Identifier", - "start": 2269, - "end": 2278, + "start": 2157, + "end": 2166, "loc": { "start": { - "line": 96, + "line": 91, "column": 8 }, "end": { - "line": 96, + "line": 91, "column": 17 }, "identifierName": "component" @@ -2040,29 +1739,29 @@ }, { "type": "RestElement", - "start": 2280, - "end": 2287, + "start": 2168, + "end": 2175, "loc": { "start": { - "line": 96, + "line": 91, "column": 19 }, "end": { - "line": 96, + "line": 91, "column": 26 } }, "argument": { "type": "Identifier", - "start": 2283, - "end": 2287, + "start": 2171, + "end": 2175, "loc": { "start": { - "line": 96, + "line": 91, "column": 22 }, "end": { - "line": 96, + "line": 91, "column": 26 }, "identifierName": "args" @@ -2073,44 +1772,44 @@ ], "body": { "type": "BlockStatement", - "start": 2289, - "end": 2389, + "start": 2177, + "end": 2277, "loc": { "start": { - "line": 96, + "line": 91, "column": 28 }, "end": { - "line": 101, + "line": 96, "column": 2 } }, "body": [ { "type": "IfStatement", - "start": 2293, - "end": 2356, + "start": 2181, + "end": 2244, "loc": { "start": { - "line": 97, + "line": 92, "column": 2 }, "end": { - "line": 99, + "line": 94, "column": 3 } }, "test": { "type": "UnaryExpression", - "start": 2297, - "end": 2317, + "start": 2185, + "end": 2205, "loc": { "start": { - "line": 97, + "line": 92, "column": 6 }, "end": { - "line": 97, + "line": 92, "column": 26 } }, @@ -2118,58 +1817,58 @@ "prefix": true, "argument": { "type": "CallExpression", - "start": 2298, - "end": 2317, + "start": 2186, + "end": 2205, "loc": { "start": { - "line": 97, + "line": 92, "column": 7 }, "end": { - "line": 97, + "line": 92, "column": 26 } }, "callee": { "type": "MemberExpression", - "start": 2298, - "end": 2306, + "start": 2186, + "end": 2194, "loc": { "start": { - "line": 97, + "line": 92, "column": 7 }, "end": { - "line": 97, + "line": 92, "column": 15 } }, "object": { "type": "ThisExpression", - "start": 2298, - "end": 2302, + "start": 2186, + "end": 2190, "loc": { "start": { - "line": 97, + "line": 92, "column": 7 }, "end": { - "line": 97, + "line": 92, "column": 11 } } }, "property": { "type": "Identifier", - "start": 2303, - "end": 2306, + "start": 2191, + "end": 2194, "loc": { "start": { - "line": 97, + "line": 92, "column": 12 }, "end": { - "line": 97, + "line": 92, "column": 15 }, "identifierName": "has" @@ -2181,15 +1880,15 @@ "arguments": [ { "type": "Identifier", - "start": 2307, - "end": 2316, + "start": 2195, + "end": 2204, "loc": { "start": { - "line": 97, + "line": 92, "column": 16 }, "end": { - "line": 97, + "line": 92, "column": 25 }, "identifierName": "component" @@ -2204,87 +1903,87 @@ }, "consequent": { "type": "BlockStatement", - "start": 2319, - "end": 2356, + "start": 2207, + "end": 2244, "loc": { "start": { - "line": 97, + "line": 92, "column": 28 }, "end": { - "line": 99, + "line": 94, "column": 3 } }, "body": [ { "type": "ExpressionStatement", - "start": 2324, - "end": 2352, + "start": 2212, + "end": 2240, "loc": { "start": { - "line": 98, + "line": 93, "column": 3 }, "end": { - "line": 98, + "line": 93, "column": 31 } }, "expression": { "type": "CallExpression", - "start": 2324, - "end": 2352, + "start": 2212, + "end": 2240, "loc": { "start": { - "line": 98, + "line": 93, "column": 3 }, "end": { - "line": 98, + "line": 93, "column": 31 } }, "callee": { "type": "MemberExpression", - "start": 2324, - "end": 2332, + "start": 2212, + "end": 2220, "loc": { "start": { - "line": 98, + "line": 93, "column": 3 }, "end": { - "line": 98, + "line": 93, "column": 11 } }, "object": { "type": "ThisExpression", - "start": 2324, - "end": 2328, + "start": 2212, + "end": 2216, "loc": { "start": { - "line": 98, + "line": 93, "column": 3 }, "end": { - "line": 98, + "line": 93, "column": 7 } } }, "property": { "type": "Identifier", - "start": 2329, - "end": 2332, + "start": 2217, + "end": 2220, "loc": { "start": { - "line": 98, + "line": 93, "column": 8 }, "end": { - "line": 98, + "line": 93, "column": 11 }, "identifierName": "set" @@ -2296,15 +1995,15 @@ "arguments": [ { "type": "Identifier", - "start": 2333, - "end": 2342, + "start": 2221, + "end": 2230, "loc": { "start": { - "line": 98, + "line": 93, "column": 12 }, "end": { - "line": 98, + "line": 93, "column": 21 }, "identifierName": "component" @@ -2313,29 +2012,29 @@ }, { "type": "SpreadElement", - "start": 2344, - "end": 2351, + "start": 2232, + "end": 2239, "loc": { "start": { - "line": 98, + "line": 93, "column": 23 }, "end": { - "line": 98, + "line": 93, "column": 30 } }, "argument": { "type": "Identifier", - "start": 2347, - "end": 2351, + "start": 2235, + "end": 2239, "loc": { "start": { - "line": 98, + "line": 93, "column": 26 }, "end": { - "line": 98, + "line": 93, "column": 30 }, "identifierName": "args" @@ -2353,72 +2052,72 @@ }, { "type": "ReturnStatement", - "start": 2359, - "end": 2386, + "start": 2247, + "end": 2274, "loc": { "start": { - "line": 100, + "line": 95, "column": 2 }, "end": { - "line": 100, + "line": 95, "column": 29 } }, "argument": { "type": "MemberExpression", - "start": 2366, - "end": 2386, + "start": 2254, + "end": 2274, "loc": { "start": { - "line": 100, + "line": 95, "column": 9 }, "end": { - "line": 100, + "line": 95, "column": 29 } }, "object": { "type": "MemberExpression", - "start": 2366, - "end": 2375, + "start": 2254, + "end": 2263, "loc": { "start": { - "line": 100, + "line": 95, "column": 9 }, "end": { - "line": 100, + "line": 95, "column": 18 } }, "object": { "type": "ThisExpression", - "start": 2366, - "end": 2370, + "start": 2254, + "end": 2258, "loc": { "start": { - "line": 100, + "line": 95, "column": 9 }, "end": { - "line": 100, + "line": 95, "column": 13 } } }, "property": { "type": "Identifier", - "start": 2371, - "end": 2375, + "start": 2259, + "end": 2263, "loc": { "start": { - "line": 100, + "line": 95, "column": 14 }, "end": { - "line": 100, + "line": 95, "column": 18 }, "identifierName": "data" @@ -2429,15 +2128,15 @@ }, "property": { "type": "Identifier", - "start": 2376, - "end": 2385, + "start": 2264, + "end": 2273, "loc": { "start": { - "line": 100, + "line": 95, "column": 19 }, "end": { - "line": 100, + "line": 95, "column": 28 }, "identifierName": "component" @@ -2455,15 +2154,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns a component by name (automatically created if it doesn't exist)\n\t *\n\t * @example\n\t * let position = entity.access('position', 3, 4)\n\t *\n\t * @param {string} component - The component name to create/get\n\t * @param {...Object} [args] - The arguments to forward to create the new component, only if it doesn't exist.\n\t *\n\t * @return {Object} Always returns either the existing component, or the newly created one.\n\t ", - "start": 1824, - "end": 2260, + "start": 1712, + "end": 2148, "loc": { "start": { - "line": 85, + "line": 80, "column": 1 }, "end": { - "line": 95, + "line": 90, "column": 4 } } @@ -2473,15 +2172,15 @@ { "type": "CommentBlock", "value": "*\n\t * Adds a new component, or re-creates and overwrites an existing component\n\t *\n\t * @example\n\t * entity.set('position', 1, 2)\n\t *\n\t * @example\n\t * entity.set('anonymousComponent', { keys: 'values' })\n\t *\n\t * @example\n\t * entity.set('anotherAnonymousComponent', 'Any type of any value')\n\t *\n\t * @param {string} component - The component name to create. If there is a registered component for this name, then\n\t * its constructor will be called with (entity, ...args) and an object of that type will be created. The onCreate method\n\t * gets called after the component is added to the entity. This method also gets passed the same parameters.\n\t * @param {...Object} [args] - The arguments to forward to the registered component type. If the component type is\n\t * registered, then only the first additional argument will be used as the value of the entire component.\n\t *\n\t * @return {Object} The original entity that set() was called on, so that operations can be chained.\n\t ", - "start": 2392, - "end": 3375, + "start": 2280, + "end": 3263, "loc": { "start": { - "line": 103, + "line": 98, "column": 1 }, "end": { - "line": 122, + "line": 117, "column": 4 } } @@ -2490,15 +2189,15 @@ }, { "type": "ClassMethod", - "start": 3377, - "end": 4187, + "start": 3265, + "end": 4075, "loc": { "start": { - "line": 123, + "line": 118, "column": 1 }, "end": { - "line": 145, + "line": 140, "column": 2 } }, @@ -2506,15 +2205,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 3377, - "end": 3380, + "start": 3265, + "end": 3268, "loc": { "start": { - "line": 123, + "line": 118, "column": 1 }, "end": { - "line": 123, + "line": 118, "column": 4 }, "identifierName": "set" @@ -2530,15 +2229,15 @@ "params": [ { "type": "Identifier", - "start": 3381, - "end": 3390, + "start": 3269, + "end": 3278, "loc": { "start": { - "line": 123, + "line": 118, "column": 5 }, "end": { - "line": 123, + "line": 118, "column": 14 }, "identifierName": "component" @@ -2547,29 +2246,29 @@ }, { "type": "RestElement", - "start": 3392, - "end": 3399, + "start": 3280, + "end": 3287, "loc": { "start": { - "line": 123, + "line": 118, "column": 16 }, "end": { - "line": 123, + "line": 118, "column": 23 } }, "argument": { "type": "Identifier", - "start": 3395, - "end": 3399, + "start": 3283, + "end": 3287, "loc": { "start": { - "line": 123, + "line": 118, "column": 19 }, "end": { - "line": 123, + "line": 118, "column": 23 }, "identifierName": "args" @@ -2580,101 +2279,101 @@ ], "body": { "type": "BlockStatement", - "start": 3401, - "end": 4187, + "start": 3289, + "end": 4075, "loc": { "start": { - "line": 123, + "line": 118, "column": 25 }, "end": { - "line": 145, + "line": 140, "column": 2 } }, "body": [ { "type": "IfStatement", - "start": 3405, - "end": 3874, + "start": 3293, + "end": 3762, "loc": { "start": { - "line": 124, + "line": 119, "column": 2 }, "end": { - "line": 134, + "line": 129, "column": 3 } }, "test": { "type": "LogicalExpression", - "start": 3409, - "end": 3459, + "start": 3297, + "end": 3347, "loc": { "start": { - "line": 124, + "line": 119, "column": 6 }, "end": { - "line": 124, + "line": 119, "column": 56 } }, "left": { "type": "CallExpression", - "start": 3409, - "end": 3421, + "start": 3297, + "end": 3309, "loc": { "start": { - "line": 124, + "line": 119, "column": 6 }, "end": { - "line": 124, + "line": 119, "column": 18 } }, "callee": { "type": "MemberExpression", - "start": 3409, - "end": 3419, + "start": 3297, + "end": 3307, "loc": { "start": { - "line": 124, + "line": 119, "column": 6 }, "end": { - "line": 124, + "line": 119, "column": 16 } }, "object": { "type": "ThisExpression", - "start": 3409, - "end": 3413, + "start": 3297, + "end": 3301, "loc": { "start": { - "line": 124, + "line": 119, "column": 6 }, "end": { - "line": 124, + "line": 119, "column": 10 } } }, "property": { "type": "Identifier", - "start": 3414, - "end": 3419, + "start": 3302, + "end": 3307, "loc": { "start": { - "line": 124, + "line": 119, "column": 11 }, "end": { - "line": 124, + "line": 119, "column": 16 }, "identifierName": "valid" @@ -2688,29 +2387,29 @@ "operator": "&&", "right": { "type": "BinaryExpression", - "start": 3425, - "end": 3459, + "start": 3313, + "end": 3347, "loc": { "start": { - "line": 124, + "line": 119, "column": 22 }, "end": { - "line": 124, + "line": 119, "column": 56 } }, "left": { "type": "Identifier", - "start": 3425, - "end": 3434, + "start": 3313, + "end": 3322, "loc": { "start": { - "line": 124, + "line": 119, "column": 22 }, "end": { - "line": 124, + "line": 119, "column": 31 }, "identifierName": "component" @@ -2720,58 +2419,58 @@ "operator": "in", "right": { "type": "MemberExpression", - "start": 3438, - "end": 3459, + "start": 3326, + "end": 3347, "loc": { "start": { - "line": 124, + "line": 119, "column": 35 }, "end": { - "line": 124, + "line": 119, "column": 56 } }, "object": { "type": "MemberExpression", - "start": 3438, - "end": 3448, + "start": 3326, + "end": 3336, "loc": { "start": { - "line": 124, + "line": 119, "column": 35 }, "end": { - "line": 124, + "line": 119, "column": 45 } }, "object": { "type": "ThisExpression", - "start": 3438, - "end": 3442, + "start": 3326, + "end": 3330, "loc": { "start": { - "line": 124, + "line": 119, "column": 35 }, "end": { - "line": 124, + "line": 119, "column": 39 } } }, "property": { "type": "Identifier", - "start": 3443, - "end": 3448, + "start": 3331, + "end": 3336, "loc": { "start": { - "line": 124, + "line": 119, "column": 40 }, "end": { - "line": 124, + "line": 119, "column": 45 }, "identifierName": "world" @@ -2782,15 +2481,15 @@ }, "property": { "type": "Identifier", - "start": 3449, - "end": 3459, + "start": 3337, + "end": 3347, "loc": { "start": { - "line": 124, + "line": 119, "column": 46 }, "end": { - "line": 124, + "line": 119, "column": 56 }, "identifierName": "components" @@ -2803,87 +2502,87 @@ }, "consequent": { "type": "BlockStatement", - "start": 3461, - "end": 3697, + "start": 3349, + "end": 3585, "loc": { "start": { - "line": 124, + "line": 119, "column": 58 }, "end": { - "line": 128, + "line": 123, "column": 3 } }, "body": [ { "type": "ExpressionStatement", - "start": 3619, - "end": 3693, + "start": 3507, + "end": 3581, "loc": { "start": { - "line": 127, + "line": 122, "column": 3 }, "end": { - "line": 127, + "line": 122, "column": 77 } }, "expression": { "type": "AssignmentExpression", - "start": 3619, - "end": 3693, + "start": 3507, + "end": 3581, "loc": { "start": { - "line": 127, + "line": 122, "column": 3 }, "end": { - "line": 127, + "line": 122, "column": 77 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 3619, - "end": 3639, + "start": 3507, + "end": 3527, "loc": { "start": { - "line": 127, + "line": 122, "column": 3 }, "end": { - "line": 127, + "line": 122, "column": 23 } }, "object": { "type": "MemberExpression", - "start": 3619, - "end": 3628, + "start": 3507, + "end": 3516, "loc": { "start": { - "line": 127, + "line": 122, "column": 3 }, "end": { - "line": 127, + "line": 122, "column": 12 } }, "object": { "type": "ThisExpression", - "start": 3619, - "end": 3623, + "start": 3507, + "end": 3511, "loc": { "start": { - "line": 127, + "line": 122, "column": 3 }, "end": { - "line": 127, + "line": 122, "column": 7 } }, @@ -2891,15 +2590,15 @@ }, "property": { "type": "Identifier", - "start": 3624, - "end": 3628, + "start": 3512, + "end": 3516, "loc": { "start": { - "line": 127, + "line": 122, "column": 8 }, "end": { - "line": 127, + "line": 122, "column": 12 }, "identifierName": "data" @@ -2911,15 +2610,15 @@ }, "property": { "type": "Identifier", - "start": 3629, - "end": 3638, + "start": 3517, + "end": 3526, "loc": { "start": { - "line": 127, + "line": 122, "column": 13 }, "end": { - "line": 127, + "line": 122, "column": 22 }, "identifierName": "component" @@ -2931,86 +2630,86 @@ }, "right": { "type": "NewExpression", - "start": 3642, - "end": 3693, + "start": 3530, + "end": 3581, "loc": { "start": { - "line": 127, + "line": 122, "column": 26 }, "end": { - "line": 127, + "line": 122, "column": 77 } }, "callee": { "type": "MemberExpression", - "start": 3646, - "end": 3678, + "start": 3534, + "end": 3566, "loc": { "start": { - "line": 127, + "line": 122, "column": 30 }, "end": { - "line": 127, + "line": 122, "column": 62 } }, "object": { "type": "MemberExpression", - "start": 3646, - "end": 3667, + "start": 3534, + "end": 3555, "loc": { "start": { - "line": 127, + "line": 122, "column": 30 }, "end": { - "line": 127, + "line": 122, "column": 51 } }, "object": { "type": "MemberExpression", - "start": 3646, - "end": 3656, + "start": 3534, + "end": 3544, "loc": { "start": { - "line": 127, + "line": 122, "column": 30 }, "end": { - "line": 127, + "line": 122, "column": 40 } }, "object": { "type": "ThisExpression", - "start": 3646, - "end": 3650, + "start": 3534, + "end": 3538, "loc": { "start": { - "line": 127, + "line": 122, "column": 30 }, "end": { - "line": 127, + "line": 122, "column": 34 } } }, "property": { "type": "Identifier", - "start": 3651, - "end": 3656, + "start": 3539, + "end": 3544, "loc": { "start": { - "line": 127, + "line": 122, "column": 35 }, "end": { - "line": 127, + "line": 122, "column": 40 }, "identifierName": "world" @@ -3021,15 +2720,15 @@ }, "property": { "type": "Identifier", - "start": 3657, - "end": 3667, + "start": 3545, + "end": 3555, "loc": { "start": { - "line": 127, + "line": 122, "column": 41 }, "end": { - "line": 127, + "line": 122, "column": 51 }, "identifierName": "components" @@ -3040,15 +2739,15 @@ }, "property": { "type": "Identifier", - "start": 3668, - "end": 3677, + "start": 3556, + "end": 3565, "loc": { "start": { - "line": 127, + "line": 122, "column": 52 }, "end": { - "line": 127, + "line": 122, "column": 61 }, "identifierName": "component" @@ -3060,44 +2759,44 @@ "arguments": [ { "type": "ThisExpression", - "start": 3679, - "end": 3683, + "start": 3567, + "end": 3571, "loc": { "start": { - "line": 127, + "line": 122, "column": 63 }, "end": { - "line": 127, + "line": 122, "column": 67 } } }, { "type": "SpreadElement", - "start": 3685, - "end": 3692, + "start": 3573, + "end": 3580, "loc": { "start": { - "line": 127, + "line": 122, "column": 69 }, "end": { - "line": 127, + "line": 122, "column": 76 } }, "argument": { "type": "Identifier", - "start": 3688, - "end": 3692, + "start": 3576, + "end": 3580, "loc": { "start": { - "line": 127, + "line": 122, "column": 72 }, "end": { - "line": 127, + "line": 122, "column": 76 }, "identifierName": "args" @@ -3113,15 +2812,15 @@ { "type": "CommentLine", "value": " Create component and store in entity", - "start": 3466, - "end": 3505, + "start": 3354, + "end": 3393, "loc": { "start": { - "line": 125, + "line": 120, "column": 3 }, "end": { - "line": 125, + "line": 120, "column": 42 } } @@ -3129,15 +2828,15 @@ { "type": "CommentLine", "value": " Note: The entity parameter is dangerous to use, since the component hasn't been added to the entity yet", - "start": 3509, - "end": 3615, + "start": 3397, + "end": 3503, "loc": { "start": { - "line": 126, + "line": 121, "column": 3 }, "end": { - "line": 126, + "line": 121, "column": 109 } } @@ -3149,57 +2848,57 @@ }, "alternate": { "type": "IfStatement", - "start": 3703, - "end": 3874, + "start": 3591, + "end": 3762, "loc": { "start": { - "line": 128, + "line": 123, "column": 9 }, "end": { - "line": 134, + "line": 129, "column": 3 } }, "test": { "type": "BinaryExpression", - "start": 3707, - "end": 3722, + "start": 3595, + "end": 3610, "loc": { "start": { - "line": 128, + "line": 123, "column": 13 }, "end": { - "line": 128, + "line": 123, "column": 28 } }, "left": { "type": "MemberExpression", - "start": 3707, - "end": 3718, + "start": 3595, + "end": 3606, "loc": { "start": { - "line": 128, + "line": 123, "column": 13 }, "end": { - "line": 128, + "line": 123, "column": 24 } }, "object": { "type": "Identifier", - "start": 3707, - "end": 3711, + "start": 3595, + "end": 3599, "loc": { "start": { - "line": 128, + "line": 123, "column": 13 }, "end": { - "line": 128, + "line": 123, "column": 17 }, "identifierName": "args" @@ -3208,15 +2907,15 @@ }, "property": { "type": "Identifier", - "start": 3712, - "end": 3718, + "start": 3600, + "end": 3606, "loc": { "start": { - "line": 128, + "line": 123, "column": 18 }, "end": { - "line": 128, + "line": 123, "column": 24 }, "identifierName": "length" @@ -3228,15 +2927,15 @@ "operator": ">", "right": { "type": "NumericLiteral", - "start": 3721, - "end": 3722, + "start": 3609, + "end": 3610, "loc": { "start": { - "line": 128, + "line": 123, "column": 27 }, "end": { - "line": 128, + "line": 123, "column": 28 } }, @@ -3249,87 +2948,87 @@ }, "consequent": { "type": "BlockStatement", - "start": 3724, - "end": 3807, + "start": 3612, + "end": 3695, "loc": { "start": { - "line": 128, + "line": 123, "column": 30 }, "end": { - "line": 131, + "line": 126, "column": 3 } }, "body": [ { "type": "ExpressionStatement", - "start": 3773, - "end": 3803, + "start": 3661, + "end": 3691, "loc": { "start": { - "line": 130, + "line": 125, "column": 3 }, "end": { - "line": 130, + "line": 125, "column": 33 } }, "expression": { "type": "AssignmentExpression", - "start": 3773, - "end": 3803, + "start": 3661, + "end": 3691, "loc": { "start": { - "line": 130, + "line": 125, "column": 3 }, "end": { - "line": 130, + "line": 125, "column": 33 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 3773, - "end": 3793, + "start": 3661, + "end": 3681, "loc": { "start": { - "line": 130, + "line": 125, "column": 3 }, "end": { - "line": 130, + "line": 125, "column": 23 } }, "object": { "type": "MemberExpression", - "start": 3773, - "end": 3782, + "start": 3661, + "end": 3670, "loc": { "start": { - "line": 130, + "line": 125, "column": 3 }, "end": { - "line": 130, + "line": 125, "column": 12 } }, "object": { "type": "ThisExpression", - "start": 3773, - "end": 3777, + "start": 3661, + "end": 3665, "loc": { "start": { - "line": 130, + "line": 125, "column": 3 }, "end": { - "line": 130, + "line": 125, "column": 7 } }, @@ -3337,15 +3036,15 @@ }, "property": { "type": "Identifier", - "start": 3778, - "end": 3782, + "start": 3666, + "end": 3670, "loc": { "start": { - "line": 130, + "line": 125, "column": 8 }, "end": { - "line": 130, + "line": 125, "column": 12 }, "identifierName": "data" @@ -3357,15 +3056,15 @@ }, "property": { "type": "Identifier", - "start": 3783, - "end": 3792, + "start": 3671, + "end": 3680, "loc": { "start": { - "line": 130, + "line": 125, "column": 13 }, "end": { - "line": 130, + "line": 125, "column": 22 }, "identifierName": "component" @@ -3377,29 +3076,29 @@ }, "right": { "type": "MemberExpression", - "start": 3796, - "end": 3803, + "start": 3684, + "end": 3691, "loc": { "start": { - "line": 130, + "line": 125, "column": 26 }, "end": { - "line": 130, + "line": 125, "column": 33 } }, "object": { "type": "Identifier", - "start": 3796, - "end": 3800, + "start": 3684, + "end": 3688, "loc": { "start": { - "line": 130, + "line": 125, "column": 26 }, "end": { - "line": 130, + "line": 125, "column": 30 }, "identifierName": "args" @@ -3408,15 +3107,15 @@ }, "property": { "type": "NumericLiteral", - "start": 3801, - "end": 3802, + "start": 3689, + "end": 3690, "loc": { "start": { - "line": 130, + "line": 125, "column": 31 }, "end": { - "line": 130, + "line": 125, "column": 32 } }, @@ -3434,15 +3133,15 @@ { "type": "CommentLine", "value": " Use first argument as component value", - "start": 3729, - "end": 3769, + "start": 3617, + "end": 3657, "loc": { "start": { - "line": 129, + "line": 124, "column": 3 }, "end": { - "line": 129, + "line": 124, "column": 43 } } @@ -3454,87 +3153,87 @@ }, "alternate": { "type": "BlockStatement", - "start": 3813, - "end": 3874, + "start": 3701, + "end": 3762, "loc": { "start": { - "line": 131, + "line": 126, "column": 9 }, "end": { - "line": 134, + "line": 129, "column": 3 } }, "body": [ { "type": "ExpressionStatement", - "start": 3845, - "end": 3870, + "start": 3733, + "end": 3758, "loc": { "start": { - "line": 133, + "line": 128, "column": 3 }, "end": { - "line": 133, + "line": 128, "column": 28 } }, "expression": { "type": "AssignmentExpression", - "start": 3845, - "end": 3870, + "start": 3733, + "end": 3758, "loc": { "start": { - "line": 133, + "line": 128, "column": 3 }, "end": { - "line": 133, + "line": 128, "column": 28 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 3845, - "end": 3865, + "start": 3733, + "end": 3753, "loc": { "start": { - "line": 133, + "line": 128, "column": 3 }, "end": { - "line": 133, + "line": 128, "column": 23 } }, "object": { "type": "MemberExpression", - "start": 3845, - "end": 3854, + "start": 3733, + "end": 3742, "loc": { "start": { - "line": 133, + "line": 128, "column": 3 }, "end": { - "line": 133, + "line": 128, "column": 12 } }, "object": { "type": "ThisExpression", - "start": 3845, - "end": 3849, + "start": 3733, + "end": 3737, "loc": { "start": { - "line": 133, + "line": 128, "column": 3 }, "end": { - "line": 133, + "line": 128, "column": 7 } }, @@ -3542,15 +3241,15 @@ }, "property": { "type": "Identifier", - "start": 3850, - "end": 3854, + "start": 3738, + "end": 3742, "loc": { "start": { - "line": 133, + "line": 128, "column": 8 }, "end": { - "line": 133, + "line": 128, "column": 12 }, "identifierName": "data" @@ -3562,15 +3261,15 @@ }, "property": { "type": "Identifier", - "start": 3855, - "end": 3864, + "start": 3743, + "end": 3752, "loc": { "start": { - "line": 133, + "line": 128, "column": 13 }, "end": { - "line": 133, + "line": 128, "column": 22 }, "identifierName": "component" @@ -3582,15 +3281,15 @@ }, "right": { "type": "ObjectExpression", - "start": 3868, - "end": 3870, + "start": 3756, + "end": 3758, "loc": { "start": { - "line": 133, + "line": 128, "column": 26 }, "end": { - "line": 133, + "line": 128, "column": 28 } }, @@ -3602,15 +3301,15 @@ { "type": "CommentLine", "value": " Make an empty object", - "start": 3818, - "end": 3841, + "start": 3706, + "end": 3729, "loc": { "start": { - "line": 132, + "line": 127, "column": 3 }, "end": { - "line": 132, + "line": 127, "column": 26 } } @@ -3627,15 +3326,15 @@ { "type": "CommentLine", "value": " Update the index with this new component", - "start": 3878, - "end": 3921, + "start": 3766, + "end": 3809, "loc": { "start": { - "line": 136, + "line": 131, "column": 2 }, "end": { - "line": 136, + "line": 131, "column": 45 } } @@ -3644,57 +3343,57 @@ }, { "type": "IfStatement", - "start": 3924, - "end": 3988, + "start": 3812, + "end": 3876, "loc": { "start": { - "line": 137, + "line": 132, "column": 2 }, "end": { - "line": 139, + "line": 134, "column": 3 } }, "test": { "type": "CallExpression", - "start": 3928, - "end": 3940, + "start": 3816, + "end": 3828, "loc": { "start": { - "line": 137, + "line": 132, "column": 6 }, "end": { - "line": 137, + "line": 132, "column": 18 } }, "callee": { "type": "MemberExpression", - "start": 3928, - "end": 3938, + "start": 3816, + "end": 3826, "loc": { "start": { - "line": 137, + "line": 132, "column": 6 }, "end": { - "line": 137, + "line": 132, "column": 16 } }, "object": { "type": "ThisExpression", - "start": 3928, - "end": 3932, + "start": 3816, + "end": 3820, "loc": { "start": { - "line": 137, + "line": 132, "column": 6 }, "end": { - "line": 137, + "line": 132, "column": 10 } }, @@ -3702,15 +3401,15 @@ }, "property": { "type": "Identifier", - "start": 3933, - "end": 3938, + "start": 3821, + "end": 3826, "loc": { "start": { - "line": 137, + "line": 132, "column": 11 }, "end": { - "line": 137, + "line": 132, "column": 16 }, "identifierName": "valid" @@ -3725,115 +3424,115 @@ }, "consequent": { "type": "BlockStatement", - "start": 3942, - "end": 3988, + "start": 3830, + "end": 3876, "loc": { "start": { - "line": 137, + "line": 132, "column": 20 }, "end": { - "line": 139, + "line": 134, "column": 3 } }, "body": [ { "type": "ExpressionStatement", - "start": 3947, - "end": 3984, + "start": 3835, + "end": 3872, "loc": { "start": { - "line": 138, + "line": 133, "column": 3 }, "end": { - "line": 138, + "line": 133, "column": 40 } }, "expression": { "type": "CallExpression", - "start": 3947, - "end": 3984, + "start": 3835, + "end": 3872, "loc": { "start": { - "line": 138, + "line": 133, "column": 3 }, "end": { - "line": 138, + "line": 133, "column": 40 } }, "callee": { "type": "MemberExpression", - "start": 3947, - "end": 3967, + "start": 3835, + "end": 3855, "loc": { "start": { - "line": 138, + "line": 133, "column": 3 }, "end": { - "line": 138, + "line": 133, "column": 23 } }, "object": { "type": "MemberExpression", - "start": 3947, - "end": 3963, + "start": 3835, + "end": 3851, "loc": { "start": { - "line": 138, + "line": 133, "column": 3 }, "end": { - "line": 138, + "line": 133, "column": 19 } }, "object": { "type": "MemberExpression", - "start": 3947, - "end": 3957, + "start": 3835, + "end": 3845, "loc": { "start": { - "line": 138, + "line": 133, "column": 3 }, "end": { - "line": 138, + "line": 133, "column": 13 } }, "object": { "type": "ThisExpression", - "start": 3947, - "end": 3951, + "start": 3835, + "end": 3839, "loc": { "start": { - "line": 138, + "line": 133, "column": 3 }, "end": { - "line": 138, + "line": 133, "column": 7 } } }, "property": { "type": "Identifier", - "start": 3952, - "end": 3957, + "start": 3840, + "end": 3845, "loc": { "start": { - "line": 138, + "line": 133, "column": 8 }, "end": { - "line": 138, + "line": 133, "column": 13 }, "identifierName": "world" @@ -3844,15 +3543,15 @@ }, "property": { "type": "Identifier", - "start": 3958, - "end": 3963, + "start": 3846, + "end": 3851, "loc": { "start": { - "line": 138, + "line": 133, "column": 14 }, "end": { - "line": 138, + "line": 133, "column": 19 }, "identifierName": "index" @@ -3863,15 +3562,15 @@ }, "property": { "type": "Identifier", - "start": 3964, - "end": 3967, + "start": 3852, + "end": 3855, "loc": { "start": { - "line": 138, + "line": 133, "column": 20 }, "end": { - "line": 138, + "line": 133, "column": 23 }, "identifierName": "add" @@ -3883,30 +3582,30 @@ "arguments": [ { "type": "ThisExpression", - "start": 3968, - "end": 3972, + "start": 3856, + "end": 3860, "loc": { "start": { - "line": 138, + "line": 133, "column": 24 }, "end": { - "line": 138, + "line": 133, "column": 28 } } }, { "type": "Identifier", - "start": 3974, - "end": 3983, + "start": 3862, + "end": 3871, "loc": { "start": { - "line": 138, + "line": 133, "column": 30 }, "end": { - "line": 138, + "line": 133, "column": 39 }, "identifierName": "component" @@ -3925,15 +3624,15 @@ { "type": "CommentLine", "value": " Update the index with this new component", - "start": 3878, - "end": 3921, + "start": 3766, + "end": 3809, "loc": { "start": { - "line": 136, + "line": 131, "column": 2 }, "end": { - "line": 136, + "line": 131, "column": 45 } } @@ -3943,15 +3642,15 @@ { "type": "CommentLine", "value": " Call custom onCreate to initialize component, pass the entity (this), and any additional arguments passed into set()", - "start": 3992, - "end": 4111, + "start": 3880, + "end": 3999, "loc": { "start": { - "line": 141, + "line": 136, "column": 2 }, "end": { - "line": 141, + "line": 136, "column": 121 } } @@ -3960,43 +3659,43 @@ }, { "type": "ExpressionStatement", - "start": 4114, - "end": 4169, + "start": 4002, + "end": 4057, "loc": { "start": { - "line": 142, + "line": 137, "column": 2 }, "end": { - "line": 142, + "line": 137, "column": 57 } }, "expression": { "type": "CallExpression", - "start": 4114, - "end": 4169, + "start": 4002, + "end": 4057, "loc": { "start": { - "line": 142, + "line": 137, "column": 2 }, "end": { - "line": 142, + "line": 137, "column": 57 } }, "callee": { "type": "Identifier", - "start": 4114, - "end": 4120, + "start": 4002, + "end": 4008, "loc": { "start": { - "line": 142, + "line": 137, "column": 2 }, "end": { - "line": 142, + "line": 137, "column": 8 }, "identifierName": "invoke" @@ -4007,58 +3706,58 @@ "arguments": [ { "type": "MemberExpression", - "start": 4121, - "end": 4141, + "start": 4009, + "end": 4029, "loc": { "start": { - "line": 142, + "line": 137, "column": 9 }, "end": { - "line": 142, + "line": 137, "column": 29 } }, "object": { "type": "MemberExpression", - "start": 4121, - "end": 4130, + "start": 4009, + "end": 4018, "loc": { "start": { - "line": 142, + "line": 137, "column": 9 }, "end": { - "line": 142, + "line": 137, "column": 18 } }, "object": { "type": "ThisExpression", - "start": 4121, - "end": 4125, + "start": 4009, + "end": 4013, "loc": { "start": { - "line": 142, + "line": 137, "column": 9 }, "end": { - "line": 142, + "line": 137, "column": 13 } } }, "property": { "type": "Identifier", - "start": 4126, - "end": 4130, + "start": 4014, + "end": 4018, "loc": { "start": { - "line": 142, + "line": 137, "column": 14 }, "end": { - "line": 142, + "line": 137, "column": 18 }, "identifierName": "data" @@ -4069,15 +3768,15 @@ }, "property": { "type": "Identifier", - "start": 4131, - "end": 4140, + "start": 4019, + "end": 4028, "loc": { "start": { - "line": 142, + "line": 137, "column": 19 }, "end": { - "line": 142, + "line": 137, "column": 28 }, "identifierName": "component" @@ -4088,15 +3787,15 @@ }, { "type": "StringLiteral", - "start": 4143, - "end": 4153, + "start": 4031, + "end": 4041, "loc": { "start": { - "line": 142, + "line": 137, "column": 31 }, "end": { - "line": 142, + "line": 137, "column": 41 } }, @@ -4108,44 +3807,44 @@ }, { "type": "ThisExpression", - "start": 4155, - "end": 4159, + "start": 4043, + "end": 4047, "loc": { "start": { - "line": 142, + "line": 137, "column": 43 }, "end": { - "line": 142, + "line": 137, "column": 47 } } }, { "type": "SpreadElement", - "start": 4161, - "end": 4168, + "start": 4049, + "end": 4056, "loc": { "start": { - "line": 142, + "line": 137, "column": 49 }, "end": { - "line": 142, + "line": 137, "column": 56 } }, "argument": { "type": "Identifier", - "start": 4164, - "end": 4168, + "start": 4052, + "end": 4056, "loc": { "start": { - "line": 142, + "line": 137, "column": 52 }, "end": { - "line": 142, + "line": 137, "column": 56 }, "identifierName": "args" @@ -4160,15 +3859,15 @@ { "type": "CommentLine", "value": " Call custom onCreate to initialize component, pass the entity (this), and any additional arguments passed into set()", - "start": 3992, - "end": 4111, + "start": 3880, + "end": 3999, "loc": { "start": { - "line": 141, + "line": 136, "column": 2 }, "end": { - "line": 141, + "line": 136, "column": 121 } } @@ -4177,29 +3876,29 @@ }, { "type": "ReturnStatement", - "start": 4173, - "end": 4184, + "start": 4061, + "end": 4072, "loc": { "start": { - "line": 144, + "line": 139, "column": 2 }, "end": { - "line": 144, + "line": 139, "column": 13 } }, "argument": { "type": "ThisExpression", - "start": 4180, - "end": 4184, + "start": 4068, + "end": 4072, "loc": { "start": { - "line": 144, + "line": 139, "column": 9 }, "end": { - "line": 144, + "line": 139, "column": 13 } } @@ -4213,15 +3912,15 @@ { "type": "CommentBlock", "value": "*\n\t * Adds a new component, or re-creates and overwrites an existing component\n\t *\n\t * @example\n\t * entity.set('position', 1, 2)\n\t *\n\t * @example\n\t * entity.set('anonymousComponent', { keys: 'values' })\n\t *\n\t * @example\n\t * entity.set('anotherAnonymousComponent', 'Any type of any value')\n\t *\n\t * @param {string} component - The component name to create. If there is a registered component for this name, then\n\t * its constructor will be called with (entity, ...args) and an object of that type will be created. The onCreate method\n\t * gets called after the component is added to the entity. This method also gets passed the same parameters.\n\t * @param {...Object} [args] - The arguments to forward to the registered component type. If the component type is\n\t * registered, then only the first additional argument will be used as the value of the entire component.\n\t *\n\t * @return {Object} The original entity that set() was called on, so that operations can be chained.\n\t ", - "start": 2392, - "end": 3375, + "start": 2280, + "end": 3263, "loc": { "start": { - "line": 103, + "line": 98, "column": 1 }, "end": { - "line": 122, + "line": 117, "column": 4 } } @@ -4231,15 +3930,15 @@ { "type": "CommentBlock", "value": "*\n\t * Updates component data from an object or other component. Similar to access() with a shallow merge applied after.\n\t *\n\t * @example\n\t * entity.update('position', { x: 1, y: 2 })\n\t *\n\t * @param {string} component - The component name to update\n\t * @param {Object} data - The object or other component to merge into the specified component.\n\t *\n\t * @return {Object} The original entity that update() was called on, so that operations can be chained.\n\t ", - "start": 4190, - "end": 4654, + "start": 4078, + "end": 4542, "loc": { "start": { - "line": 147, + "line": 142, "column": 1 }, "end": { - "line": 157, + "line": 152, "column": 4 } } @@ -4248,15 +3947,15 @@ }, { "type": "ClassMethod", - "start": 4656, - "end": 4830, + "start": 4544, + "end": 4718, "loc": { "start": { - "line": 158, + "line": 153, "column": 1 }, "end": { - "line": 167, + "line": 162, "column": 2 } }, @@ -4264,15 +3963,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 4656, - "end": 4662, + "start": 4544, + "end": 4550, "loc": { "start": { - "line": 158, + "line": 153, "column": 1 }, "end": { - "line": 158, + "line": 153, "column": 7 }, "identifierName": "update" @@ -4288,15 +3987,15 @@ "params": [ { "type": "Identifier", - "start": 4663, - "end": 4672, + "start": 4551, + "end": 4560, "loc": { "start": { - "line": 158, + "line": 153, "column": 8 }, "end": { - "line": 158, + "line": 153, "column": 17 }, "identifierName": "component" @@ -4305,15 +4004,15 @@ }, { "type": "Identifier", - "start": 4674, - "end": 4678, + "start": 4562, + "end": 4566, "loc": { "start": { - "line": 158, + "line": 153, "column": 19 }, "end": { - "line": 158, + "line": 153, "column": 23 }, "identifierName": "data" @@ -4323,59 +4022,59 @@ ], "body": { "type": "BlockStatement", - "start": 4680, - "end": 4830, + "start": 4568, + "end": 4718, "loc": { "start": { - "line": 158, + "line": 153, "column": 25 }, "end": { - "line": 167, + "line": 162, "column": 2 } }, "body": [ { "type": "VariableDeclaration", - "start": 4684, - "end": 4717, + "start": 4572, + "end": 4605, "loc": { "start": { - "line": 159, + "line": 154, "column": 2 }, "end": { - "line": 159, + "line": 154, "column": 35 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 4688, - "end": 4717, + "start": 4576, + "end": 4605, "loc": { "start": { - "line": 159, + "line": 154, "column": 6 }, "end": { - "line": 159, + "line": 154, "column": 35 } }, "id": { "type": "Identifier", - "start": 4688, - "end": 4692, + "start": 4576, + "end": 4580, "loc": { "start": { - "line": 159, + "line": 154, "column": 6 }, "end": { - "line": 159, + "line": 154, "column": 10 }, "identifierName": "comp" @@ -4384,58 +4083,58 @@ }, "init": { "type": "CallExpression", - "start": 4695, - "end": 4717, + "start": 4583, + "end": 4605, "loc": { "start": { - "line": 159, + "line": 154, "column": 13 }, "end": { - "line": 159, + "line": 154, "column": 35 } }, "callee": { "type": "MemberExpression", - "start": 4695, - "end": 4706, + "start": 4583, + "end": 4594, "loc": { "start": { - "line": 159, + "line": 154, "column": 13 }, "end": { - "line": 159, + "line": 154, "column": 24 } }, "object": { "type": "ThisExpression", - "start": 4695, - "end": 4699, + "start": 4583, + "end": 4587, "loc": { "start": { - "line": 159, + "line": 154, "column": 13 }, "end": { - "line": 159, + "line": 154, "column": 17 } } }, "property": { "type": "Identifier", - "start": 4700, - "end": 4706, + "start": 4588, + "end": 4594, "loc": { "start": { - "line": 159, + "line": 154, "column": 18 }, "end": { - "line": 159, + "line": 154, "column": 24 }, "identifierName": "access" @@ -4447,15 +4146,15 @@ "arguments": [ { "type": "Identifier", - "start": 4707, - "end": 4716, + "start": 4595, + "end": 4604, "loc": { "start": { - "line": 159, + "line": 154, "column": 25 }, "end": { - "line": 159, + "line": 154, "column": 34 }, "identifierName": "component" @@ -4473,15 +4172,15 @@ { "type": "CommentLine", "value": " Shallow set keys of the component", - "start": 4721, - "end": 4757, + "start": 4609, + "end": 4645, "loc": { "start": { - "line": 161, + "line": 156, "column": 2 }, "end": { - "line": 161, + "line": 156, "column": 38 } } @@ -4490,58 +4189,58 @@ }, { "type": "ForInStatement", - "start": 4760, - "end": 4812, + "start": 4648, + "end": 4700, "loc": { "start": { - "line": 162, + "line": 157, "column": 2 }, "end": { - "line": 164, + "line": 159, "column": 3 } }, "left": { "type": "VariableDeclaration", - "start": 4765, - "end": 4772, + "start": 4653, + "end": 4660, "loc": { "start": { - "line": 162, + "line": 157, "column": 7 }, "end": { - "line": 162, + "line": 157, "column": 14 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 4769, - "end": 4772, + "start": 4657, + "end": 4660, "loc": { "start": { - "line": 162, + "line": 157, "column": 11 }, "end": { - "line": 162, + "line": 157, "column": 14 } }, "id": { "type": "Identifier", - "start": 4769, - "end": 4772, + "start": 4657, + "end": 4660, "loc": { "start": { - "line": 162, + "line": 157, "column": 11 }, "end": { - "line": 162, + "line": 157, "column": 14 }, "identifierName": "key" @@ -4558,15 +4257,15 @@ }, "right": { "type": "Identifier", - "start": 4776, - "end": 4780, + "start": 4664, + "end": 4668, "loc": { "start": { - "line": 162, + "line": 157, "column": 18 }, "end": { - "line": 162, + "line": 157, "column": 22 }, "identifierName": "data" @@ -4575,73 +4274,73 @@ }, "body": { "type": "BlockStatement", - "start": 4782, - "end": 4812, + "start": 4670, + "end": 4700, "loc": { "start": { - "line": 162, + "line": 157, "column": 24 }, "end": { - "line": 164, + "line": 159, "column": 3 } }, "body": [ { "type": "ExpressionStatement", - "start": 4787, - "end": 4808, + "start": 4675, + "end": 4696, "loc": { "start": { - "line": 163, + "line": 158, "column": 3 }, "end": { - "line": 163, + "line": 158, "column": 24 } }, "expression": { "type": "AssignmentExpression", - "start": 4787, - "end": 4808, + "start": 4675, + "end": 4696, "loc": { "start": { - "line": 163, + "line": 158, "column": 3 }, "end": { - "line": 163, + "line": 158, "column": 24 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 4787, - "end": 4796, + "start": 4675, + "end": 4684, "loc": { "start": { - "line": 163, + "line": 158, "column": 3 }, "end": { - "line": 163, + "line": 158, "column": 12 } }, "object": { "type": "Identifier", - "start": 4787, - "end": 4791, + "start": 4675, + "end": 4679, "loc": { "start": { - "line": 163, + "line": 158, "column": 3 }, "end": { - "line": 163, + "line": 158, "column": 7 }, "identifierName": "comp" @@ -4650,15 +4349,15 @@ }, "property": { "type": "Identifier", - "start": 4792, - "end": 4795, + "start": 4680, + "end": 4683, "loc": { "start": { - "line": 163, + "line": 158, "column": 8 }, "end": { - "line": 163, + "line": 158, "column": 11 }, "identifierName": "key" @@ -4669,29 +4368,29 @@ }, "right": { "type": "MemberExpression", - "start": 4799, - "end": 4808, + "start": 4687, + "end": 4696, "loc": { "start": { - "line": 163, + "line": 158, "column": 15 }, "end": { - "line": 163, + "line": 158, "column": 24 } }, "object": { "type": "Identifier", - "start": 4799, - "end": 4803, + "start": 4687, + "end": 4691, "loc": { "start": { - "line": 163, + "line": 158, "column": 15 }, "end": { - "line": 163, + "line": 158, "column": 19 }, "identifierName": "data" @@ -4700,15 +4399,15 @@ }, "property": { "type": "Identifier", - "start": 4804, - "end": 4807, + "start": 4692, + "end": 4695, "loc": { "start": { - "line": 163, + "line": 158, "column": 20 }, "end": { - "line": 163, + "line": 158, "column": 23 }, "identifierName": "key" @@ -4726,15 +4425,15 @@ { "type": "CommentLine", "value": " Shallow set keys of the component", - "start": 4721, - "end": 4757, + "start": 4609, + "end": 4645, "loc": { "start": { - "line": 161, + "line": 156, "column": 2 }, "end": { - "line": 161, + "line": 156, "column": 38 } } @@ -4743,29 +4442,29 @@ }, { "type": "ReturnStatement", - "start": 4816, - "end": 4827, + "start": 4704, + "end": 4715, "loc": { "start": { - "line": 166, + "line": 161, "column": 2 }, "end": { - "line": 166, + "line": 161, "column": 13 } }, "argument": { "type": "ThisExpression", - "start": 4823, - "end": 4827, + "start": 4711, + "end": 4715, "loc": { "start": { - "line": 166, + "line": 161, "column": 9 }, "end": { - "line": 166, + "line": 161, "column": 13 } } @@ -4779,15 +4478,15 @@ { "type": "CommentBlock", "value": "*\n\t * Updates component data from an object or other component. Similar to access() with a shallow merge applied after.\n\t *\n\t * @example\n\t * entity.update('position', { x: 1, y: 2 })\n\t *\n\t * @param {string} component - The component name to update\n\t * @param {Object} data - The object or other component to merge into the specified component.\n\t *\n\t * @return {Object} The original entity that update() was called on, so that operations can be chained.\n\t ", - "start": 4190, - "end": 4654, + "start": 4078, + "end": 4542, "loc": { "start": { - "line": 147, + "line": 142, "column": 1 }, "end": { - "line": 157, + "line": 152, "column": 4 } } @@ -4797,15 +4496,15 @@ { "type": "CommentBlock", "value": "*\n\t * Removes a component from the entity - has no effect when it doesn't exist.\n\t * Can specify an onRemove() method in your component which gets called before it is removed.\n\t * If nothing is specified, then nothing will be removed. Use removeAll() to remove all components.\n\t *\n\t * @example\n\t * entity.remove('position')\n\t *\n\t * @param {...string} [components] - The component names to remove from the entity.\n\t *\n\t * @return {Object} The original entity that remove() was called on, so that operations can be chained.\n\t ", - "start": 4833, - "end": 5361, + "start": 4721, + "end": 5249, "loc": { "start": { - "line": 169, + "line": 164, "column": 1 }, "end": { - "line": 180, + "line": 175, "column": 4 } } @@ -4814,15 +4513,15 @@ }, { "type": "ClassMethod", - "start": 5363, - "end": 5718, + "start": 5251, + "end": 5606, "loc": { "start": { - "line": 181, + "line": 176, "column": 1 }, "end": { - "line": 198, + "line": 193, "column": 2 } }, @@ -4830,15 +4529,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 5363, - "end": 5369, + "start": 5251, + "end": 5257, "loc": { "start": { - "line": 181, + "line": 176, "column": 1 }, "end": { - "line": 181, + "line": 176, "column": 7 }, "identifierName": "remove" @@ -4854,29 +4553,29 @@ "params": [ { "type": "RestElement", - "start": 5370, - "end": 5383, + "start": 5258, + "end": 5271, "loc": { "start": { - "line": 181, + "line": 176, "column": 8 }, "end": { - "line": 181, + "line": 176, "column": 21 } }, "argument": { "type": "Identifier", - "start": 5373, - "end": 5383, + "start": 5261, + "end": 5271, "loc": { "start": { - "line": 181, + "line": 176, "column": 11 }, "end": { - "line": 181, + "line": 176, "column": 21 }, "identifierName": "components" @@ -4887,73 +4586,73 @@ ], "body": { "type": "BlockStatement", - "start": 5385, - "end": 5718, + "start": 5273, + "end": 5606, "loc": { "start": { - "line": 181, + "line": 176, "column": 23 }, "end": { - "line": 198, + "line": 193, "column": 2 } }, "body": [ { "type": "ForOfStatement", - "start": 5389, - "end": 5701, + "start": 5277, + "end": 5589, "loc": { "start": { - "line": 182, + "line": 177, "column": 2 }, "end": { - "line": 196, + "line": 191, "column": 3 } }, "left": { "type": "VariableDeclaration", - "start": 5394, - "end": 5407, + "start": 5282, + "end": 5295, "loc": { "start": { - "line": 182, + "line": 177, "column": 7 }, "end": { - "line": 182, + "line": 177, "column": 20 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 5398, - "end": 5407, + "start": 5286, + "end": 5295, "loc": { "start": { - "line": 182, + "line": 177, "column": 11 }, "end": { - "line": 182, + "line": 177, "column": 20 } }, "id": { "type": "Identifier", - "start": 5398, - "end": 5407, + "start": 5286, + "end": 5295, "loc": { "start": { - "line": 182, + "line": 177, "column": 11 }, "end": { - "line": 182, + "line": 177, "column": 20 }, "identifierName": "component" @@ -4967,15 +4666,15 @@ }, "right": { "type": "Identifier", - "start": 5411, - "end": 5421, + "start": 5299, + "end": 5309, "loc": { "start": { - "line": 182, + "line": 177, "column": 24 }, "end": { - "line": 182, + "line": 177, "column": 34 }, "identifierName": "components" @@ -4984,58 +4683,58 @@ }, "body": { "type": "BlockStatement", - "start": 5423, - "end": 5701, + "start": 5311, + "end": 5589, "loc": { "start": { - "line": 182, + "line": 177, "column": 36 }, "end": { - "line": 196, + "line": 191, "column": 3 } }, "body": [ { "type": "IfStatement", - "start": 5428, - "end": 5697, + "start": 5316, + "end": 5585, "loc": { "start": { - "line": 183, + "line": 178, "column": 3 }, "end": { - "line": 195, + "line": 190, "column": 4 } }, "test": { "type": "BinaryExpression", - "start": 5432, - "end": 5454, + "start": 5320, + "end": 5342, "loc": { "start": { - "line": 183, + "line": 178, "column": 7 }, "end": { - "line": 183, + "line": 178, "column": 29 } }, "left": { "type": "Identifier", - "start": 5432, - "end": 5441, + "start": 5320, + "end": 5329, "loc": { "start": { - "line": 183, + "line": 178, "column": 7 }, "end": { - "line": 183, + "line": 178, "column": 16 }, "identifierName": "component" @@ -5045,44 +4744,44 @@ "operator": "in", "right": { "type": "MemberExpression", - "start": 5445, - "end": 5454, + "start": 5333, + "end": 5342, "loc": { "start": { - "line": 183, + "line": 178, "column": 20 }, "end": { - "line": 183, + "line": 178, "column": 29 } }, "object": { "type": "ThisExpression", - "start": 5445, - "end": 5449, + "start": 5333, + "end": 5337, "loc": { "start": { - "line": 183, + "line": 178, "column": 20 }, "end": { - "line": 183, + "line": 178, "column": 24 } } }, "property": { "type": "Identifier", - "start": 5450, - "end": 5454, + "start": 5338, + "end": 5342, "loc": { "start": { - "line": 183, + "line": 178, "column": 25 }, "end": { - "line": 183, + "line": 178, "column": 29 }, "identifierName": "data" @@ -5094,58 +4793,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 5456, - "end": 5697, + "start": 5344, + "end": 5585, "loc": { "start": { - "line": 183, + "line": 178, "column": 31 }, "end": { - "line": 195, + "line": 190, "column": 4 } }, "body": [ { "type": "ExpressionStatement", - "start": 5491, - "end": 5531, + "start": 5379, + "end": 5419, "loc": { "start": { - "line": 186, + "line": 181, "column": 4 }, "end": { - "line": 186, + "line": 181, "column": 44 } }, "expression": { "type": "CallExpression", - "start": 5491, - "end": 5531, + "start": 5379, + "end": 5419, "loc": { "start": { - "line": 186, + "line": 181, "column": 4 }, "end": { - "line": 186, + "line": 181, "column": 44 } }, "callee": { "type": "Identifier", - "start": 5491, - "end": 5497, + "start": 5379, + "end": 5385, "loc": { "start": { - "line": 186, + "line": 181, "column": 4 }, "end": { - "line": 186, + "line": 181, "column": 10 }, "identifierName": "invoke" @@ -5156,58 +4855,58 @@ "arguments": [ { "type": "MemberExpression", - "start": 5498, - "end": 5518, + "start": 5386, + "end": 5406, "loc": { "start": { - "line": 186, + "line": 181, "column": 11 }, "end": { - "line": 186, + "line": 181, "column": 31 } }, "object": { "type": "MemberExpression", - "start": 5498, - "end": 5507, + "start": 5386, + "end": 5395, "loc": { "start": { - "line": 186, + "line": 181, "column": 11 }, "end": { - "line": 186, + "line": 181, "column": 20 } }, "object": { "type": "ThisExpression", - "start": 5498, - "end": 5502, + "start": 5386, + "end": 5390, "loc": { "start": { - "line": 186, + "line": 181, "column": 11 }, "end": { - "line": 186, + "line": 181, "column": 15 } } }, "property": { "type": "Identifier", - "start": 5503, - "end": 5507, + "start": 5391, + "end": 5395, "loc": { "start": { - "line": 186, + "line": 181, "column": 16 }, "end": { - "line": 186, + "line": 181, "column": 20 }, "identifierName": "data" @@ -5218,15 +4917,15 @@ }, "property": { "type": "Identifier", - "start": 5508, - "end": 5517, + "start": 5396, + "end": 5405, "loc": { "start": { - "line": 186, + "line": 181, "column": 21 }, "end": { - "line": 186, + "line": 181, "column": 30 }, "identifierName": "component" @@ -5237,15 +4936,15 @@ }, { "type": "StringLiteral", - "start": 5520, - "end": 5530, + "start": 5408, + "end": 5418, "loc": { "start": { - "line": 186, + "line": 181, "column": 33 }, "end": { - "line": 186, + "line": 181, "column": 43 } }, @@ -5263,15 +4962,15 @@ { "type": "CommentLine", "value": " Call custom onRemove", - "start": 5463, - "end": 5486, + "start": 5351, + "end": 5374, "loc": { "start": { - "line": 185, + "line": 180, "column": 4 }, "end": { - "line": 185, + "line": 180, "column": 27 } } @@ -5281,15 +4980,15 @@ { "type": "CommentLine", "value": " Remove from index", - "start": 5537, - "end": 5557, + "start": 5425, + "end": 5445, "loc": { "start": { - "line": 188, + "line": 183, "column": 4 }, "end": { - "line": 188, + "line": 183, "column": 24 } } @@ -5298,57 +4997,57 @@ }, { "type": "IfStatement", - "start": 5562, - "end": 5633, + "start": 5450, + "end": 5521, "loc": { "start": { - "line": 189, + "line": 184, "column": 4 }, "end": { - "line": 191, + "line": 186, "column": 5 } }, "test": { "type": "CallExpression", - "start": 5566, - "end": 5578, + "start": 5454, + "end": 5466, "loc": { "start": { - "line": 189, + "line": 184, "column": 8 }, "end": { - "line": 189, + "line": 184, "column": 20 } }, "callee": { "type": "MemberExpression", - "start": 5566, - "end": 5576, + "start": 5454, + "end": 5464, "loc": { "start": { - "line": 189, + "line": 184, "column": 8 }, "end": { - "line": 189, + "line": 184, "column": 18 } }, "object": { "type": "ThisExpression", - "start": 5566, - "end": 5570, + "start": 5454, + "end": 5458, "loc": { "start": { - "line": 189, + "line": 184, "column": 8 }, "end": { - "line": 189, + "line": 184, "column": 12 } }, @@ -5356,15 +5055,15 @@ }, "property": { "type": "Identifier", - "start": 5571, - "end": 5576, + "start": 5459, + "end": 5464, "loc": { "start": { - "line": 189, + "line": 184, "column": 13 }, "end": { - "line": 189, + "line": 184, "column": 18 }, "identifierName": "valid" @@ -5379,115 +5078,115 @@ }, "consequent": { "type": "BlockStatement", - "start": 5580, - "end": 5633, + "start": 5468, + "end": 5521, "loc": { "start": { - "line": 189, + "line": 184, "column": 22 }, "end": { - "line": 191, + "line": 186, "column": 5 } }, "body": [ { "type": "ExpressionStatement", - "start": 5587, - "end": 5627, + "start": 5475, + "end": 5515, "loc": { "start": { - "line": 190, + "line": 185, "column": 5 }, "end": { - "line": 190, + "line": 185, "column": 45 } }, "expression": { "type": "CallExpression", - "start": 5587, - "end": 5627, + "start": 5475, + "end": 5515, "loc": { "start": { - "line": 190, + "line": 185, "column": 5 }, "end": { - "line": 190, + "line": 185, "column": 45 } }, "callee": { "type": "MemberExpression", - "start": 5587, - "end": 5610, + "start": 5475, + "end": 5498, "loc": { "start": { - "line": 190, + "line": 185, "column": 5 }, "end": { - "line": 190, + "line": 185, "column": 28 } }, "object": { "type": "MemberExpression", - "start": 5587, - "end": 5603, + "start": 5475, + "end": 5491, "loc": { "start": { - "line": 190, + "line": 185, "column": 5 }, "end": { - "line": 190, + "line": 185, "column": 21 } }, "object": { "type": "MemberExpression", - "start": 5587, - "end": 5597, + "start": 5475, + "end": 5485, "loc": { "start": { - "line": 190, + "line": 185, "column": 5 }, "end": { - "line": 190, + "line": 185, "column": 15 } }, "object": { "type": "ThisExpression", - "start": 5587, - "end": 5591, + "start": 5475, + "end": 5479, "loc": { "start": { - "line": 190, + "line": 185, "column": 5 }, "end": { - "line": 190, + "line": 185, "column": 9 } } }, "property": { "type": "Identifier", - "start": 5592, - "end": 5597, + "start": 5480, + "end": 5485, "loc": { "start": { - "line": 190, + "line": 185, "column": 10 }, "end": { - "line": 190, + "line": 185, "column": 15 }, "identifierName": "world" @@ -5498,15 +5197,15 @@ }, "property": { "type": "Identifier", - "start": 5598, - "end": 5603, + "start": 5486, + "end": 5491, "loc": { "start": { - "line": 190, + "line": 185, "column": 16 }, "end": { - "line": 190, + "line": 185, "column": 21 }, "identifierName": "index" @@ -5517,15 +5216,15 @@ }, "property": { "type": "Identifier", - "start": 5604, - "end": 5610, + "start": 5492, + "end": 5498, "loc": { "start": { - "line": 190, + "line": 185, "column": 22 }, "end": { - "line": 190, + "line": 185, "column": 28 }, "identifierName": "remove" @@ -5537,30 +5236,30 @@ "arguments": [ { "type": "ThisExpression", - "start": 5611, - "end": 5615, + "start": 5499, + "end": 5503, "loc": { "start": { - "line": 190, + "line": 185, "column": 29 }, "end": { - "line": 190, + "line": 185, "column": 33 } } }, { "type": "Identifier", - "start": 5617, - "end": 5626, + "start": 5505, + "end": 5514, "loc": { "start": { - "line": 190, + "line": 185, "column": 35 }, "end": { - "line": 190, + "line": 185, "column": 44 }, "identifierName": "component" @@ -5579,15 +5278,15 @@ { "type": "CommentLine", "value": " Remove from index", - "start": 5537, - "end": 5557, + "start": 5425, + "end": 5445, "loc": { "start": { - "line": 188, + "line": 183, "column": 4 }, "end": { - "line": 188, + "line": 183, "column": 24 } } @@ -5597,15 +5296,15 @@ { "type": "CommentLine", "value": " Remove from entity", - "start": 5639, - "end": 5660, + "start": 5527, + "end": 5548, "loc": { "start": { - "line": 193, + "line": 188, "column": 4 }, "end": { - "line": 193, + "line": 188, "column": 25 } } @@ -5614,29 +5313,29 @@ }, { "type": "ExpressionStatement", - "start": 5665, - "end": 5692, + "start": 5553, + "end": 5580, "loc": { "start": { - "line": 194, + "line": 189, "column": 4 }, "end": { - "line": 194, + "line": 189, "column": 31 } }, "expression": { "type": "UnaryExpression", - "start": 5665, - "end": 5692, + "start": 5553, + "end": 5580, "loc": { "start": { - "line": 194, + "line": 189, "column": 4 }, "end": { - "line": 194, + "line": 189, "column": 31 } }, @@ -5644,43 +5343,43 @@ "prefix": true, "argument": { "type": "MemberExpression", - "start": 5672, - "end": 5692, + "start": 5560, + "end": 5580, "loc": { "start": { - "line": 194, + "line": 189, "column": 11 }, "end": { - "line": 194, + "line": 189, "column": 31 } }, "object": { "type": "MemberExpression", - "start": 5672, - "end": 5681, + "start": 5560, + "end": 5569, "loc": { "start": { - "line": 194, + "line": 189, "column": 11 }, "end": { - "line": 194, + "line": 189, "column": 20 } }, "object": { "type": "ThisExpression", - "start": 5672, - "end": 5676, + "start": 5560, + "end": 5564, "loc": { "start": { - "line": 194, + "line": 189, "column": 11 }, "end": { - "line": 194, + "line": 189, "column": 15 } }, @@ -5688,15 +5387,15 @@ }, "property": { "type": "Identifier", - "start": 5677, - "end": 5681, + "start": 5565, + "end": 5569, "loc": { "start": { - "line": 194, + "line": 189, "column": 16 }, "end": { - "line": 194, + "line": 189, "column": 20 }, "identifierName": "data" @@ -5708,15 +5407,15 @@ }, "property": { "type": "Identifier", - "start": 5682, - "end": 5691, + "start": 5570, + "end": 5579, "loc": { "start": { - "line": 194, + "line": 189, "column": 21 }, "end": { - "line": 194, + "line": 189, "column": 30 }, "identifierName": "component" @@ -5735,15 +5434,15 @@ { "type": "CommentLine", "value": " Remove from entity", - "start": 5639, - "end": 5660, + "start": 5527, + "end": 5548, "loc": { "start": { - "line": 193, + "line": 188, "column": 4 }, "end": { - "line": 193, + "line": 188, "column": 25 } } @@ -5761,29 +5460,29 @@ }, { "type": "ReturnStatement", - "start": 5704, - "end": 5715, + "start": 5592, + "end": 5603, "loc": { "start": { - "line": 197, + "line": 192, "column": 2 }, "end": { - "line": 197, + "line": 192, "column": 13 } }, "argument": { "type": "ThisExpression", - "start": 5711, - "end": 5715, + "start": 5599, + "end": 5603, "loc": { "start": { - "line": 197, + "line": 192, "column": 9 }, "end": { - "line": 197, + "line": 192, "column": 13 } } @@ -5797,15 +5496,15 @@ { "type": "CommentBlock", "value": "*\n\t * Removes a component from the entity - has no effect when it doesn't exist.\n\t * Can specify an onRemove() method in your component which gets called before it is removed.\n\t * If nothing is specified, then nothing will be removed. Use removeAll() to remove all components.\n\t *\n\t * @example\n\t * entity.remove('position')\n\t *\n\t * @param {...string} [components] - The component names to remove from the entity.\n\t *\n\t * @return {Object} The original entity that remove() was called on, so that operations can be chained.\n\t ", - "start": 4833, - "end": 5361, + "start": 4721, + "end": 5249, "loc": { "start": { - "line": 169, + "line": 164, "column": 1 }, "end": { - "line": 180, + "line": 175, "column": 4 } } @@ -5815,15 +5514,15 @@ { "type": "CommentLine", "value": " Remove all components", - "start": 5721, - "end": 5745, + "start": 5609, + "end": 5633, "loc": { "start": { - "line": 200, + "line": 195, "column": 1 }, "end": { - "line": 200, + "line": 195, "column": 25 } } @@ -5831,15 +5530,15 @@ { "type": "CommentBlock", "value": "*\n\t * Removes all components from the entity.\n\t *\n\t * @example\n\t * entity.removeAll()\n\t *\n\t * @return {Object} The original entity that removeAll() was called on, so that operations can be chained.\n\t ", - "start": 5748, - "end": 5952, + "start": 5636, + "end": 5840, "loc": { "start": { - "line": 202, + "line": 197, "column": 1 }, "end": { - "line": 209, + "line": 204, "column": 4 } } @@ -5848,15 +5547,15 @@ }, { "type": "ClassMethod", - "start": 5954, - "end": 6171, + "start": 5842, + "end": 6059, "loc": { "start": { - "line": 210, + "line": 205, "column": 1 }, "end": { - "line": 218, + "line": 213, "column": 2 } }, @@ -5864,15 +5563,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 5954, - "end": 5963, + "start": 5842, + "end": 5851, "loc": { "start": { - "line": 210, + "line": 205, "column": 1 }, "end": { - "line": 210, + "line": 205, "column": 10 }, "identifierName": "removeAll" @@ -5888,87 +5587,87 @@ "params": [], "body": { "type": "BlockStatement", - "start": 5966, - "end": 6171, + "start": 5854, + "end": 6059, "loc": { "start": { - "line": 210, + "line": 205, "column": 13 }, "end": { - "line": 218, + "line": 213, "column": 2 } }, "body": [ { "type": "ExpressionStatement", - "start": 5970, - "end": 6001, + "start": 5858, + "end": 5889, "loc": { "start": { - "line": 211, + "line": 206, "column": 2 }, "end": { - "line": 211, + "line": 206, "column": 33 } }, "expression": { "type": "CallExpression", - "start": 5970, - "end": 6001, + "start": 5858, + "end": 5889, "loc": { "start": { - "line": 211, + "line": 206, "column": 2 }, "end": { - "line": 211, + "line": 206, "column": 33 } }, "callee": { "type": "MemberExpression", - "start": 5970, - "end": 5981, + "start": 5858, + "end": 5869, "loc": { "start": { - "line": 211, + "line": 206, "column": 2 }, "end": { - "line": 211, + "line": 206, "column": 13 } }, "object": { "type": "ThisExpression", - "start": 5970, - "end": 5974, + "start": 5858, + "end": 5862, "loc": { "start": { - "line": 211, + "line": 206, "column": 2 }, "end": { - "line": 211, + "line": 206, "column": 6 } } }, "property": { "type": "Identifier", - "start": 5975, - "end": 5981, + "start": 5863, + "end": 5869, "loc": { "start": { - "line": 211, + "line": 206, "column": 7 }, "end": { - "line": 211, + "line": 206, "column": 13 }, "identifierName": "remove" @@ -5980,58 +5679,58 @@ "arguments": [ { "type": "SpreadElement", - "start": 5982, - "end": 6000, + "start": 5870, + "end": 5888, "loc": { "start": { - "line": 211, + "line": 206, "column": 14 }, "end": { - "line": 211, + "line": 206, "column": 32 } }, "argument": { "type": "MemberExpression", - "start": 5985, - "end": 6000, + "start": 5873, + "end": 5888, "loc": { "start": { - "line": 211, + "line": 206, "column": 17 }, "end": { - "line": 211, + "line": 206, "column": 32 } }, "object": { "type": "ThisExpression", - "start": 5985, - "end": 5989, + "start": 5873, + "end": 5877, "loc": { "start": { - "line": 211, + "line": 206, "column": 17 }, "end": { - "line": 211, + "line": 206, "column": 21 } } }, "property": { "type": "Identifier", - "start": 5990, - "end": 6000, + "start": 5878, + "end": 5888, "loc": { "start": { - "line": 211, + "line": 206, "column": 22 }, "end": { - "line": 211, + "line": 206, "column": 32 }, "identifierName": "components" @@ -6046,86 +5745,86 @@ }, { "type": "IfStatement", - "start": 6005, - "end": 6153, + "start": 5893, + "end": 6041, "loc": { "start": { - "line": 213, + "line": 208, "column": 2 }, "end": { - "line": 215, + "line": 210, "column": 3 } }, "test": { "type": "BinaryExpression", - "start": 6009, - "end": 6035, + "start": 5897, + "end": 5923, "loc": { "start": { - "line": 213, + "line": 208, "column": 6 }, "end": { - "line": 213, + "line": 208, "column": 32 } }, "left": { "type": "MemberExpression", - "start": 6009, - "end": 6031, + "start": 5897, + "end": 5919, "loc": { "start": { - "line": 213, + "line": 208, "column": 6 }, "end": { - "line": 213, + "line": 208, "column": 28 } }, "object": { "type": "MemberExpression", - "start": 6009, - "end": 6024, + "start": 5897, + "end": 5912, "loc": { "start": { - "line": 213, + "line": 208, "column": 6 }, "end": { - "line": 213, + "line": 208, "column": 21 } }, "object": { "type": "ThisExpression", - "start": 6009, - "end": 6013, + "start": 5897, + "end": 5901, "loc": { "start": { - "line": 213, + "line": 208, "column": 6 }, "end": { - "line": 213, + "line": 208, "column": 10 } } }, "property": { "type": "Identifier", - "start": 6014, - "end": 6024, + "start": 5902, + "end": 5912, "loc": { "start": { - "line": 213, + "line": 208, "column": 11 }, "end": { - "line": 213, + "line": 208, "column": 21 }, "identifierName": "components" @@ -6136,15 +5835,15 @@ }, "property": { "type": "Identifier", - "start": 6025, - "end": 6031, + "start": 5913, + "end": 5919, "loc": { "start": { - "line": 213, + "line": 208, "column": 22 }, "end": { - "line": 213, + "line": 208, "column": 28 }, "identifierName": "length" @@ -6156,15 +5855,15 @@ "operator": ">", "right": { "type": "NumericLiteral", - "start": 6034, - "end": 6035, + "start": 5922, + "end": 5923, "loc": { "start": { - "line": 213, + "line": 208, "column": 31 }, "end": { - "line": 213, + "line": 208, "column": 32 } }, @@ -6177,58 +5876,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 6037, - "end": 6153, + "start": 5925, + "end": 6041, "loc": { "start": { - "line": 213, + "line": 208, "column": 34 }, "end": { - "line": 215, + "line": 210, "column": 3 } }, "body": [ { "type": "ThrowStatement", - "start": 6042, - "end": 6149, + "start": 5930, + "end": 6037, "loc": { "start": { - "line": 214, + "line": 209, "column": 3 }, "end": { - "line": 214, + "line": 209, "column": 110 } }, "argument": { "type": "NewExpression", - "start": 6048, - "end": 6149, + "start": 5936, + "end": 6037, "loc": { "start": { - "line": 214, + "line": 209, "column": 9 }, "end": { - "line": 214, + "line": 209, "column": 110 } }, "callee": { "type": "Identifier", - "start": 6052, - "end": 6057, + "start": 5940, + "end": 5945, "loc": { "start": { - "line": 214, + "line": 209, "column": 13 }, "end": { - "line": 214, + "line": 209, "column": 18 }, "identifierName": "Error" @@ -6238,15 +5937,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 6058, - "end": 6148, + "start": 5946, + "end": 6036, "loc": { "start": { - "line": 214, + "line": 209, "column": 19 }, "end": { - "line": 214, + "line": 209, "column": 109 } }, @@ -6266,29 +5965,29 @@ }, { "type": "ReturnStatement", - "start": 6157, - "end": 6168, + "start": 6045, + "end": 6056, "loc": { "start": { - "line": 217, + "line": 212, "column": 2 }, "end": { - "line": 217, + "line": 212, "column": 13 } }, "argument": { "type": "ThisExpression", - "start": 6164, - "end": 6168, + "start": 6052, + "end": 6056, "loc": { "start": { - "line": 217, + "line": 212, "column": 9 }, "end": { - "line": 217, + "line": 212, "column": 13 } } @@ -6302,15 +6001,15 @@ { "type": "CommentLine", "value": " Remove all components", - "start": 5721, - "end": 5745, + "start": 5609, + "end": 5633, "loc": { "start": { - "line": 200, + "line": 195, "column": 1 }, "end": { - "line": 200, + "line": 195, "column": 25 } } @@ -6318,15 +6017,15 @@ { "type": "CommentBlock", "value": "*\n\t * Removes all components from the entity.\n\t *\n\t * @example\n\t * entity.removeAll()\n\t *\n\t * @return {Object} The original entity that removeAll() was called on, so that operations can be chained.\n\t ", - "start": 5748, - "end": 5952, + "start": 5636, + "end": 5840, "loc": { "start": { - "line": 202, + "line": 197, "column": 1 }, "end": { - "line": 209, + "line": 204, "column": 4 } } @@ -6336,15 +6035,15 @@ { "type": "CommentBlock", "value": "*\n\t * Remove this entity and all of its components from the world. After an entity is destroyed, the object should be discarded,\n\t * and it is recommended to avoid re-using it.\n\t *\n\t * @example\n\t * entity.destroy()\n\t ", - "start": 6174, - "end": 6395, + "start": 6062, + "end": 6283, "loc": { "start": { - "line": 220, + "line": 215, "column": 1 }, "end": { - "line": 226, + "line": 221, "column": 4 } } @@ -6353,15 +6052,15 @@ }, { "type": "ClassMethod", - "start": 6397, - "end": 6647, + "start": 6285, + "end": 6433, "loc": { "start": { - "line": 227, + "line": 222, "column": 1 }, "end": { - "line": 238, + "line": 230, "column": 2 } }, @@ -6369,15 +6068,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 6397, - "end": 6404, + "start": 6285, + "end": 6292, "loc": { "start": { - "line": 227, + "line": 222, "column": 1 }, "end": { - "line": 227, + "line": 222, "column": 8 }, "identifierName": "destroy" @@ -6393,87 +6092,87 @@ "params": [], "body": { "type": "BlockStatement", - "start": 6407, - "end": 6647, + "start": 6295, + "end": 6433, "loc": { "start": { - "line": 227, + "line": 222, "column": 11 }, "end": { - "line": 238, + "line": 230, "column": 2 } }, "body": [ { "type": "ExpressionStatement", - "start": 6411, - "end": 6427, + "start": 6299, + "end": 6315, "loc": { "start": { - "line": 228, + "line": 223, "column": 2 }, "end": { - "line": 228, + "line": 223, "column": 18 } }, "expression": { "type": "CallExpression", - "start": 6411, - "end": 6427, + "start": 6299, + "end": 6315, "loc": { "start": { - "line": 228, + "line": 223, "column": 2 }, "end": { - "line": 228, + "line": 223, "column": 18 } }, "callee": { "type": "MemberExpression", - "start": 6411, - "end": 6425, + "start": 6299, + "end": 6313, "loc": { "start": { - "line": 228, + "line": 223, "column": 2 }, "end": { - "line": 228, + "line": 223, "column": 16 } }, "object": { "type": "ThisExpression", - "start": 6411, - "end": 6415, + "start": 6299, + "end": 6303, "loc": { "start": { - "line": 228, + "line": 223, "column": 2 }, "end": { - "line": 228, + "line": 223, "column": 6 } } }, "property": { "type": "Identifier", - "start": 6416, - "end": 6425, + "start": 6304, + "end": 6313, "loc": { "start": { - "line": 228, + "line": 223, "column": 7 }, "end": { - "line": 228, + "line": 223, "column": 16 }, "identifierName": "removeAll" @@ -6487,72 +6186,72 @@ }, { "type": "IfStatement", - "start": 6431, - "end": 6644, + "start": 6319, + "end": 6430, "loc": { "start": { - "line": 230, + "line": 225, "column": 2 }, "end": { - "line": 237, + "line": 229, "column": 3 } }, "test": { "type": "CallExpression", - "start": 6435, - "end": 6447, + "start": 6323, + "end": 6335, "loc": { "start": { - "line": 230, + "line": 225, "column": 6 }, "end": { - "line": 230, + "line": 225, "column": 18 } }, "callee": { "type": "MemberExpression", - "start": 6435, - "end": 6445, + "start": 6323, + "end": 6333, "loc": { "start": { - "line": 230, + "line": 225, "column": 6 }, "end": { - "line": 230, + "line": 225, "column": 16 } }, "object": { "type": "ThisExpression", - "start": 6435, - "end": 6439, + "start": 6323, + "end": 6327, "loc": { "start": { - "line": 230, + "line": 225, "column": 6 }, "end": { - "line": 230, + "line": 225, "column": 10 } } }, "property": { "type": "Identifier", - "start": 6440, - "end": 6445, + "start": 6328, + "end": 6333, "loc": { "start": { - "line": 230, + "line": 225, "column": 11 }, "end": { - "line": 230, + "line": 225, "column": 16 }, "identifierName": "valid" @@ -6565,100 +6264,100 @@ }, "consequent": { "type": "BlockStatement", - "start": 6449, - "end": 6644, + "start": 6337, + "end": 6430, "loc": { "start": { - "line": 230, + "line": 225, "column": 20 }, "end": { - "line": 237, + "line": 229, "column": 3 } }, "body": [ { "type": "ExpressionStatement", - "start": 6516, - "end": 6551, + "start": 6366, + "end": 6402, "loc": { "start": { - "line": 232, + "line": 227, "column": 3 }, "end": { - "line": 232, - "column": 38 + "line": 227, + "column": 39 } }, "expression": { "type": "CallExpression", - "start": 6516, - "end": 6551, + "start": 6366, + "end": 6402, "loc": { "start": { - "line": 232, + "line": 227, "column": 3 }, "end": { - "line": 232, - "column": 38 + "line": 227, + "column": 39 } }, "callee": { "type": "MemberExpression", - "start": 6516, - "end": 6545, + "start": 6366, + "end": 6392, "loc": { "start": { - "line": 232, + "line": 227, "column": 3 }, "end": { - "line": 232, - "column": 32 + "line": 227, + "column": 29 } }, "object": { "type": "MemberExpression", - "start": 6516, - "end": 6532, + "start": 6366, + "end": 6385, "loc": { "start": { - "line": 232, + "line": 227, "column": 3 }, "end": { - "line": 232, - "column": 19 + "line": 227, + "column": 22 } }, "object": { "type": "MemberExpression", - "start": 6516, - "end": 6526, + "start": 6366, + "end": 6376, "loc": { "start": { - "line": 232, + "line": 227, "column": 3 }, "end": { - "line": 232, + "line": 227, "column": 13 } }, "object": { "type": "ThisExpression", - "start": 6516, - "end": 6520, + "start": 6366, + "end": 6370, "loc": { "start": { - "line": 232, + "line": 227, "column": 3 }, "end": { - "line": 232, + "line": 227, "column": 7 } }, @@ -6666,15 +6365,15 @@ }, "property": { "type": "Identifier", - "start": 6521, - "end": 6526, + "start": 6371, + "end": 6376, "loc": { "start": { - "line": 232, + "line": 227, "column": 8 }, "end": { - "line": 232, + "line": 227, "column": 13 }, "identifierName": "world" @@ -6686,95 +6385,109 @@ }, "property": { "type": "Identifier", - "start": 6527, - "end": 6532, + "start": 6377, + "end": 6385, "loc": { "start": { - "line": 232, + "line": 227, "column": 14 }, "end": { - "line": 232, - "column": 19 + "line": 227, + "column": 22 }, - "identifierName": "index" + "identifierName": "entities" }, - "name": "index" + "name": "entities" }, "computed": false, "leadingComments": null }, "property": { "type": "Identifier", - "start": 6533, - "end": 6545, + "start": 6386, + "end": 6392, "loc": { "start": { - "line": 232, - "column": 20 + "line": 227, + "column": 23 }, "end": { - "line": 232, - "column": 32 + "line": 227, + "column": 29 }, - "identifierName": "removeEntity" + "identifierName": "delete" }, - "name": "removeEntity" + "name": "delete" }, "computed": false, "leadingComments": null }, "arguments": [ { - "type": "ThisExpression", - "start": 6546, - "end": 6550, + "type": "MemberExpression", + "start": 6393, + "end": 6401, "loc": { "start": { - "line": 232, - "column": 33 + "line": 227, + "column": 30 }, "end": { - "line": 232, - "column": 37 + "line": 227, + "column": 38 } - } + }, + "object": { + "type": "ThisExpression", + "start": 6393, + "end": 6397, + "loc": { + "start": { + "line": 227, + "column": 30 + }, + "end": { + "line": 227, + "column": 34 + } + } + }, + "property": { + "type": "Identifier", + "start": 6398, + "end": 6401, + "loc": { + "start": { + "line": 227, + "column": 35 + }, + "end": { + "line": 227, + "column": 38 + }, + "identifierName": "_id" + }, + "name": "_id" + }, + "computed": false } ], - "leadingComments": null, - "trailingComments": null + "leadingComments": null }, "leadingComments": [ - { - "type": "CommentLine", - "value": " Remove entity from the index, to update match all index", - "start": 6454, - "end": 6512, - "loc": { - "start": { - "line": 231, - "column": 3 - }, - "end": { - "line": 231, - "column": 61 - } - } - } - ], - "trailingComments": [ { "type": "CommentLine", "value": " Remove from world", - "start": 6556, - "end": 6576, + "start": 6342, + "end": 6362, "loc": { "start": { - "line": 234, + "line": 226, "column": 3 }, "end": { - "line": 234, + "line": 226, "column": 23 } } @@ -6783,291 +6496,74 @@ }, { "type": "ExpressionStatement", - "start": 6580, - "end": 6616, + "start": 6406, + "end": 6426, "loc": { "start": { - "line": 235, + "line": 228, "column": 3 }, "end": { - "line": 235, - "column": 39 + "line": 228, + "column": 23 } }, "expression": { - "type": "CallExpression", - "start": 6580, - "end": 6616, + "type": "AssignmentExpression", + "start": 6406, + "end": 6426, "loc": { "start": { - "line": 235, + "line": 228, "column": 3 }, "end": { - "line": 235, - "column": 39 + "line": 228, + "column": 23 } }, - "callee": { + "operator": "=", + "left": { "type": "MemberExpression", - "start": 6580, - "end": 6606, + "start": 6406, + "end": 6414, "loc": { "start": { - "line": 235, + "line": 228, "column": 3 }, "end": { - "line": 235, - "column": 29 + "line": 228, + "column": 11 } }, "object": { - "type": "MemberExpression", - "start": 6580, - "end": 6599, + "type": "ThisExpression", + "start": 6406, + "end": 6410, "loc": { "start": { - "line": 235, + "line": 228, "column": 3 }, "end": { - "line": 235, - "column": 22 + "line": 228, + "column": 7 } - }, - "object": { - "type": "MemberExpression", - "start": 6580, - "end": 6590, - "loc": { - "start": { - "line": 235, - "column": 3 - }, - "end": { - "line": 235, - "column": 13 - } + } + }, + "property": { + "type": "Identifier", + "start": 6411, + "end": 6414, + "loc": { + "start": { + "line": 228, + "column": 8 }, - "object": { - "type": "ThisExpression", - "start": 6580, - "end": 6584, - "loc": { - "start": { - "line": 235, - "column": 3 - }, - "end": { - "line": 235, - "column": 7 - } - }, - "leadingComments": null - }, - "property": { - "type": "Identifier", - "start": 6585, - "end": 6590, - "loc": { - "start": { - "line": 235, - "column": 8 - }, - "end": { - "line": 235, - "column": 13 - }, - "identifierName": "world" - }, - "name": "world" - }, - "computed": false, - "leadingComments": null - }, - "property": { - "type": "Identifier", - "start": 6591, - "end": 6599, - "loc": { - "start": { - "line": 235, - "column": 14 - }, - "end": { - "line": 235, - "column": 22 - }, - "identifierName": "entities" - }, - "name": "entities" - }, - "computed": false, - "leadingComments": null - }, - "property": { - "type": "Identifier", - "start": 6600, - "end": 6606, - "loc": { - "start": { - "line": 235, - "column": 23 - }, - "end": { - "line": 235, - "column": 29 - }, - "identifierName": "delete" - }, - "name": "delete" - }, - "computed": false, - "leadingComments": null - }, - "arguments": [ - { - "type": "MemberExpression", - "start": 6607, - "end": 6615, - "loc": { - "start": { - "line": 235, - "column": 30 - }, - "end": { - "line": 235, - "column": 38 - } - }, - "object": { - "type": "ThisExpression", - "start": 6607, - "end": 6611, - "loc": { - "start": { - "line": 235, - "column": 30 - }, - "end": { - "line": 235, - "column": 34 - } - } - }, - "property": { - "type": "Identifier", - "start": 6612, - "end": 6615, - "loc": { - "start": { - "line": 235, - "column": 35 - }, - "end": { - "line": 235, - "column": 38 - }, - "identifierName": "_id" - }, - "name": "_id" - }, - "computed": false - } - ], - "leadingComments": null - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Remove from world", - "start": 6556, - "end": 6576, - "loc": { - "start": { - "line": 234, - "column": 3 - }, - "end": { - "line": 234, - "column": 23 - } - } - } - ] - }, - { - "type": "ExpressionStatement", - "start": 6620, - "end": 6640, - "loc": { - "start": { - "line": 236, - "column": 3 - }, - "end": { - "line": 236, - "column": 23 - } - }, - "expression": { - "type": "AssignmentExpression", - "start": 6620, - "end": 6640, - "loc": { - "start": { - "line": 236, - "column": 3 - }, - "end": { - "line": 236, - "column": 23 - } - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "start": 6620, - "end": 6628, - "loc": { - "start": { - "line": 236, - "column": 3 - }, - "end": { - "line": 236, - "column": 11 - } - }, - "object": { - "type": "ThisExpression", - "start": 6620, - "end": 6624, - "loc": { - "start": { - "line": 236, - "column": 3 - }, - "end": { - "line": 236, - "column": 7 - } - } - }, - "property": { - "type": "Identifier", - "start": 6625, - "end": 6628, - "loc": { - "start": { - "line": 236, - "column": 8 - }, - "end": { - "line": 236, - "column": 11 + "end": { + "line": 228, + "column": 11 }, "identifierName": "_id" }, @@ -7077,15 +6573,15 @@ }, "right": { "type": "Identifier", - "start": 6631, - "end": 6640, + "start": 6417, + "end": 6426, "loc": { "start": { - "line": 236, + "line": 228, "column": 14 }, "end": { - "line": 236, + "line": 228, "column": 23 }, "identifierName": "undefined" @@ -7107,15 +6603,15 @@ { "type": "CommentBlock", "value": "*\n\t * Remove this entity and all of its components from the world. After an entity is destroyed, the object should be discarded,\n\t * and it is recommended to avoid re-using it.\n\t *\n\t * @example\n\t * entity.destroy()\n\t ", - "start": 6174, - "end": 6395, + "start": 6062, + "end": 6283, "loc": { "start": { - "line": 220, + "line": 215, "column": 1 }, "end": { - "line": 226, + "line": 221, "column": 4 } } @@ -7125,15 +6621,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns an array of component names this entity currently has.\n\t *\n\t * @return {Array} Array of component names.\n\t ", - "start": 6650, - "end": 6783, + "start": 6436, + "end": 6569, "loc": { "start": { - "line": 240, + "line": 232, "column": 1 }, "end": { - "line": 244, + "line": 236, "column": 4 } } @@ -7142,15 +6638,15 @@ }, { "type": "ClassMethod", - "start": 6785, - "end": 6838, + "start": 6571, + "end": 6624, "loc": { "start": { - "line": 245, + "line": 237, "column": 1 }, "end": { - "line": 247, + "line": 239, "column": 2 } }, @@ -7158,15 +6654,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 6789, - "end": 6799, + "start": 6575, + "end": 6585, "loc": { "start": { - "line": 245, + "line": 237, "column": 5 }, "end": { - "line": 245, + "line": 237, "column": 15 }, "identifierName": "components" @@ -7181,72 +6677,72 @@ "params": [], "body": { "type": "BlockStatement", - "start": 6802, - "end": 6838, + "start": 6588, + "end": 6624, "loc": { "start": { - "line": 245, + "line": 237, "column": 18 }, "end": { - "line": 247, + "line": 239, "column": 2 } }, "body": [ { "type": "ReturnStatement", - "start": 6806, - "end": 6835, + "start": 6592, + "end": 6621, "loc": { "start": { - "line": 246, + "line": 238, "column": 2 }, "end": { - "line": 246, + "line": 238, "column": 31 } }, "argument": { "type": "CallExpression", - "start": 6813, - "end": 6835, + "start": 6599, + "end": 6621, "loc": { "start": { - "line": 246, + "line": 238, "column": 9 }, "end": { - "line": 246, + "line": 238, "column": 31 } }, "callee": { "type": "MemberExpression", - "start": 6813, - "end": 6824, + "start": 6599, + "end": 6610, "loc": { "start": { - "line": 246, + "line": 238, "column": 9 }, "end": { - "line": 246, + "line": 238, "column": 20 } }, "object": { "type": "Identifier", - "start": 6813, - "end": 6819, + "start": 6599, + "end": 6605, "loc": { "start": { - "line": 246, + "line": 238, "column": 9 }, "end": { - "line": 246, + "line": 238, "column": 15 }, "identifierName": "Object" @@ -7255,15 +6751,15 @@ }, "property": { "type": "Identifier", - "start": 6820, - "end": 6824, + "start": 6606, + "end": 6610, "loc": { "start": { - "line": 246, + "line": 238, "column": 16 }, "end": { - "line": 246, + "line": 238, "column": 20 }, "identifierName": "keys" @@ -7275,44 +6771,44 @@ "arguments": [ { "type": "MemberExpression", - "start": 6825, - "end": 6834, + "start": 6611, + "end": 6620, "loc": { "start": { - "line": 246, + "line": 238, "column": 21 }, "end": { - "line": 246, + "line": 238, "column": 30 } }, "object": { "type": "ThisExpression", - "start": 6825, - "end": 6829, + "start": 6611, + "end": 6615, "loc": { "start": { - "line": 246, + "line": 238, "column": 21 }, "end": { - "line": 246, + "line": 238, "column": 25 } } }, "property": { "type": "Identifier", - "start": 6830, - "end": 6834, + "start": 6616, + "end": 6620, "loc": { "start": { - "line": 246, + "line": 238, "column": 26 }, "end": { - "line": 246, + "line": 238, "column": 30 }, "identifierName": "data" @@ -7332,15 +6828,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns an array of component names this entity currently has.\n\t *\n\t * @return {Array} Array of component names.\n\t ", - "start": 6650, - "end": 6783, + "start": 6436, + "end": 6569, "loc": { "start": { - "line": 240, + "line": 232, "column": 1 }, "end": { - "line": 244, + "line": 236, "column": 4 } } @@ -7350,15 +6846,15 @@ { "type": "CommentBlock", "value": "* @ignore ", - "start": 6841, - "end": 6855, + "start": 6627, + "end": 6641, "loc": { "start": { - "line": 249, + "line": 241, "column": 1 }, "end": { - "line": 249, + "line": 241, "column": 15 } } @@ -7367,15 +6863,15 @@ }, { "type": "ClassMethod", - "start": 6857, - "end": 6953, + "start": 6643, + "end": 6739, "loc": { "start": { - "line": 250, + "line": 242, "column": 1 }, "end": { - "line": 252, + "line": 244, "column": 2 } }, @@ -7383,15 +6879,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 6861, - "end": 6871, + "start": 6647, + "end": 6657, "loc": { "start": { - "line": 250, + "line": 242, "column": 5 }, "end": { - "line": 250, + "line": 242, "column": 15 }, "identifierName": "components" @@ -7406,15 +6902,15 @@ "params": [ { "type": "Identifier", - "start": 6872, - "end": 6873, + "start": 6658, + "end": 6659, "loc": { "start": { - "line": 250, + "line": 242, "column": 16 }, "end": { - "line": 250, + "line": 242, "column": 17 }, "identifierName": "c" @@ -7424,58 +6920,58 @@ ], "body": { "type": "BlockStatement", - "start": 6875, - "end": 6953, + "start": 6661, + "end": 6739, "loc": { "start": { - "line": 250, + "line": 242, "column": 19 }, "end": { - "line": 252, + "line": 244, "column": 2 } }, "body": [ { "type": "ThrowStatement", - "start": 6879, - "end": 6950, + "start": 6665, + "end": 6736, "loc": { "start": { - "line": 251, + "line": 243, "column": 2 }, "end": { - "line": 251, + "line": 243, "column": 73 } }, "argument": { "type": "NewExpression", - "start": 6885, - "end": 6950, + "start": 6671, + "end": 6736, "loc": { "start": { - "line": 251, + "line": 243, "column": 8 }, "end": { - "line": 251, + "line": 243, "column": 73 } }, "callee": { "type": "Identifier", - "start": 6889, - "end": 6894, + "start": 6675, + "end": 6680, "loc": { "start": { - "line": 251, + "line": 243, "column": 12 }, "end": { - "line": 251, + "line": 243, "column": 17 }, "identifierName": "Error" @@ -7485,15 +6981,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 6895, - "end": 6949, + "start": 6681, + "end": 6735, "loc": { "start": { - "line": 251, + "line": 243, "column": 18 }, "end": { - "line": 251, + "line": 243, "column": 72 } }, @@ -7514,15 +7010,15 @@ { "type": "CommentBlock", "value": "* @ignore ", - "start": 6841, - "end": 6855, + "start": 6627, + "end": 6641, "loc": { "start": { - "line": 249, + "line": 241, "column": 1 }, "end": { - "line": 249, + "line": 241, "column": 15 } } @@ -7532,15 +7028,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns true if this is a valid, existing, and usable entity, which is attached to a world.\n\t *\n\t * @example\n\t * if (entity.valid()) {...}\n\t *\n\t * @return {boolean} true or false\n\t ", - "start": 6956, - "end": 7147, + "start": 6742, + "end": 6933, "loc": { "start": { - "line": 254, + "line": 246, "column": 1 }, "end": { - "line": 261, + "line": 253, "column": 4 } } @@ -7549,15 +7045,15 @@ }, { "type": "ClassMethod", - "start": 7149, - "end": 7419, + "start": 6935, + "end": 7205, "loc": { "start": { - "line": 262, + "line": 254, "column": 1 }, "end": { - "line": 266, + "line": 258, "column": 2 } }, @@ -7565,15 +7061,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 7149, - "end": 7154, + "start": 6935, + "end": 6940, "loc": { "start": { - "line": 262, + "line": 254, "column": 1 }, "end": { - "line": 262, + "line": 254, "column": 6 }, "identifierName": "valid" @@ -7589,72 +7085,72 @@ "params": [], "body": { "type": "BlockStatement", - "start": 7157, - "end": 7419, + "start": 6943, + "end": 7205, "loc": { "start": { - "line": 262, + "line": 254, "column": 9 }, "end": { - "line": 266, + "line": 258, "column": 2 } }, "body": [ { "type": "ReturnStatement", - "start": 7373, - "end": 7416, + "start": 7159, + "end": 7202, "loc": { "start": { - "line": 265, + "line": 257, "column": 2 }, "end": { - "line": 265, + "line": 257, "column": 45 } }, "argument": { "type": "LogicalExpression", - "start": 7380, - "end": 7416, + "start": 7166, + "end": 7202, "loc": { "start": { - "line": 265, + "line": 257, "column": 9 }, "end": { - "line": 265, + "line": 257, "column": 45 } }, "left": { "type": "MemberExpression", - "start": 7380, - "end": 7390, + "start": 7166, + "end": 7176, "loc": { "start": { - "line": 265, + "line": 257, "column": 9 }, "end": { - "line": 265, + "line": 257, "column": 19 } }, "object": { "type": "ThisExpression", - "start": 7380, - "end": 7384, + "start": 7166, + "end": 7170, "loc": { "start": { - "line": 265, + "line": 257, "column": 9 }, "end": { - "line": 265, + "line": 257, "column": 13 } }, @@ -7662,15 +7158,15 @@ }, "property": { "type": "Identifier", - "start": 7385, - "end": 7390, + "start": 7171, + "end": 7176, "loc": { "start": { - "line": 265, + "line": 257, "column": 14 }, "end": { - "line": 265, + "line": 257, "column": 19 }, "identifierName": "world" @@ -7683,58 +7179,58 @@ "operator": "&&", "right": { "type": "BinaryExpression", - "start": 7394, - "end": 7416, + "start": 7180, + "end": 7202, "loc": { "start": { - "line": 265, + "line": 257, "column": 23 }, "end": { - "line": 265, + "line": 257, "column": 45 } }, "left": { "type": "MemberExpression", - "start": 7394, - "end": 7402, + "start": 7180, + "end": 7188, "loc": { "start": { - "line": 265, + "line": 257, "column": 23 }, "end": { - "line": 265, + "line": 257, "column": 31 } }, "object": { "type": "ThisExpression", - "start": 7394, - "end": 7398, + "start": 7180, + "end": 7184, "loc": { "start": { - "line": 265, + "line": 257, "column": 23 }, "end": { - "line": 265, + "line": 257, "column": 27 } } }, "property": { "type": "Identifier", - "start": 7399, - "end": 7402, + "start": 7185, + "end": 7188, "loc": { "start": { - "line": 265, + "line": 257, "column": 28 }, "end": { - "line": 265, + "line": 257, "column": 31 }, "identifierName": "_id" @@ -7746,15 +7242,15 @@ "operator": "!==", "right": { "type": "Identifier", - "start": 7407, - "end": 7416, + "start": 7193, + "end": 7202, "loc": { "start": { - "line": 265, + "line": 257, "column": 36 }, "end": { - "line": 265, + "line": 257, "column": 45 }, "identifierName": "undefined" @@ -7768,15 +7264,15 @@ { "type": "CommentLine", "value": " Note: No need to actually look in the world for the ID, if entities are only ever copied by reference.", - "start": 7161, - "end": 7266, + "start": 6947, + "end": 7052, "loc": { "start": { - "line": 263, + "line": 255, "column": 2 }, "end": { - "line": 263, + "line": 255, "column": 107 } } @@ -7784,15 +7280,15 @@ { "type": "CommentLine", "value": " If entities are ever deep/shallow copied, this function will need to check this to be more robust.", - "start": 7269, - "end": 7370, + "start": 7055, + "end": 7156, "loc": { "start": { - "line": 264, + "line": 256, "column": 2 }, "end": { - "line": 264, + "line": 256, "column": 103 } } @@ -7807,15 +7303,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns true if this is a valid, existing, and usable entity, which is attached to a world.\n\t *\n\t * @example\n\t * if (entity.valid()) {...}\n\t *\n\t * @return {boolean} true or false\n\t ", - "start": 6956, - "end": 7147, + "start": 6742, + "end": 6933, "loc": { "start": { - "line": 254, + "line": 246, "column": 1 }, "end": { - "line": 261, + "line": 253, "column": 4 } } @@ -7825,15 +7321,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns unique entity ID as a string.\n\t *\n\t * @example\n\t * let entityId = entity.toString()\n\t *\n\t * @return {string} String representation of the entity ID.\n\t ", - "start": 7422, - "end": 7591, + "start": 7208, + "end": 7377, "loc": { "start": { - "line": 268, + "line": 260, "column": 1 }, "end": { - "line": 275, + "line": 267, "column": 4 } } @@ -7842,15 +7338,15 @@ }, { "type": "ClassMethod", - "start": 7593, - "end": 7634, + "start": 7379, + "end": 7420, "loc": { "start": { - "line": 276, + "line": 268, "column": 1 }, "end": { - "line": 278, + "line": 270, "column": 2 } }, @@ -7858,15 +7354,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 7593, - "end": 7601, + "start": 7379, + "end": 7387, "loc": { "start": { - "line": 276, + "line": 268, "column": 1 }, "end": { - "line": 276, + "line": 268, "column": 9 }, "identifierName": "toString" @@ -7882,58 +7378,58 @@ "params": [], "body": { "type": "BlockStatement", - "start": 7604, - "end": 7634, + "start": 7390, + "end": 7420, "loc": { "start": { - "line": 276, + "line": 268, "column": 12 }, "end": { - "line": 278, + "line": 270, "column": 2 } }, "body": [ { "type": "ReturnStatement", - "start": 7608, - "end": 7631, + "start": 7394, + "end": 7417, "loc": { "start": { - "line": 277, + "line": 269, "column": 2 }, "end": { - "line": 277, + "line": 269, "column": 25 } }, "argument": { "type": "CallExpression", - "start": 7615, - "end": 7631, + "start": 7401, + "end": 7417, "loc": { "start": { - "line": 277, + "line": 269, "column": 9 }, "end": { - "line": 277, + "line": 269, "column": 25 } }, "callee": { "type": "Identifier", - "start": 7615, - "end": 7621, + "start": 7401, + "end": 7407, "loc": { "start": { - "line": 277, + "line": 269, "column": 9 }, "end": { - "line": 277, + "line": 269, "column": 15 }, "identifierName": "String" @@ -7943,44 +7439,44 @@ "arguments": [ { "type": "MemberExpression", - "start": 7622, - "end": 7630, + "start": 7408, + "end": 7416, "loc": { "start": { - "line": 277, + "line": 269, "column": 16 }, "end": { - "line": 277, + "line": 269, "column": 24 } }, "object": { "type": "ThisExpression", - "start": 7622, - "end": 7626, + "start": 7408, + "end": 7412, "loc": { "start": { - "line": 277, + "line": 269, "column": 16 }, "end": { - "line": 277, + "line": 269, "column": 20 } } }, "property": { "type": "Identifier", - "start": 7627, - "end": 7630, + "start": 7413, + "end": 7416, "loc": { "start": { - "line": 277, + "line": 269, "column": 21 }, "end": { - "line": 277, + "line": 269, "column": 24 }, "identifierName": "_id" @@ -8000,15 +7496,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns unique entity ID as a string.\n\t *\n\t * @example\n\t * let entityId = entity.toString()\n\t *\n\t * @return {string} String representation of the entity ID.\n\t ", - "start": 7422, - "end": 7591, + "start": 7208, + "end": 7377, "loc": { "start": { - "line": 268, + "line": 260, "column": 1 }, "end": { - "line": 275, + "line": 267, "column": 4 } } @@ -8018,15 +7514,15 @@ { "type": "CommentBlock", "value": "*\n\t * Serializes entire entity and components to JSON.\n\t * Note: Defining toJSON methods in your components will override the built-in behavior.\n\t *\n\t * @example\n\t * let serializedEntity = entity.toJSON()\n\t *\n\t * @return {string} JSON encoded string\n\t ", - "start": 7637, - "end": 7893, + "start": 7423, + "end": 7679, "loc": { "start": { - "line": 280, + "line": 272, "column": 1 }, "end": { - "line": 288, + "line": 280, "column": 4 } } @@ -8035,15 +7531,15 @@ }, { "type": "ClassMethod", - "start": 7895, - "end": 7943, + "start": 7681, + "end": 7729, "loc": { "start": { - "line": 289, + "line": 281, "column": 1 }, "end": { - "line": 291, + "line": 283, "column": 2 } }, @@ -8051,15 +7547,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 7895, - "end": 7901, + "start": 7681, + "end": 7687, "loc": { "start": { - "line": 289, + "line": 281, "column": 1 }, "end": { - "line": 289, + "line": 281, "column": 7 }, "identifierName": "toJSON" @@ -8075,72 +7571,72 @@ "params": [], "body": { "type": "BlockStatement", - "start": 7904, - "end": 7943, + "start": 7690, + "end": 7729, "loc": { "start": { - "line": 289, + "line": 281, "column": 10 }, "end": { - "line": 291, + "line": 283, "column": 2 } }, "body": [ { "type": "ReturnStatement", - "start": 7908, - "end": 7940, + "start": 7694, + "end": 7726, "loc": { "start": { - "line": 290, + "line": 282, "column": 2 }, "end": { - "line": 290, + "line": 282, "column": 34 } }, "argument": { "type": "CallExpression", - "start": 7915, - "end": 7940, + "start": 7701, + "end": 7726, "loc": { "start": { - "line": 290, + "line": 282, "column": 9 }, "end": { - "line": 290, + "line": 282, "column": 34 } }, "callee": { "type": "MemberExpression", - "start": 7915, - "end": 7929, + "start": 7701, + "end": 7715, "loc": { "start": { - "line": 290, + "line": 282, "column": 9 }, "end": { - "line": 290, + "line": 282, "column": 23 } }, "object": { "type": "Identifier", - "start": 7915, - "end": 7919, + "start": 7701, + "end": 7705, "loc": { "start": { - "line": 290, + "line": 282, "column": 9 }, "end": { - "line": 290, + "line": 282, "column": 13 }, "identifierName": "JSON" @@ -8149,15 +7645,15 @@ }, "property": { "type": "Identifier", - "start": 7920, - "end": 7929, + "start": 7706, + "end": 7715, "loc": { "start": { - "line": 290, + "line": 282, "column": 14 }, "end": { - "line": 290, + "line": 282, "column": 23 }, "identifierName": "stringify" @@ -8169,44 +7665,44 @@ "arguments": [ { "type": "MemberExpression", - "start": 7930, - "end": 7939, + "start": 7716, + "end": 7725, "loc": { "start": { - "line": 290, + "line": 282, "column": 24 }, "end": { - "line": 290, + "line": 282, "column": 33 } }, "object": { "type": "ThisExpression", - "start": 7930, - "end": 7934, + "start": 7716, + "end": 7720, "loc": { "start": { - "line": 290, + "line": 282, "column": 24 }, "end": { - "line": 290, + "line": 282, "column": 28 } } }, "property": { "type": "Identifier", - "start": 7935, - "end": 7939, + "start": 7721, + "end": 7725, "loc": { "start": { - "line": 290, + "line": 282, "column": 29 }, "end": { - "line": 290, + "line": 282, "column": 33 }, "identifierName": "data" @@ -8226,15 +7722,15 @@ { "type": "CommentBlock", "value": "*\n\t * Serializes entire entity and components to JSON.\n\t * Note: Defining toJSON methods in your components will override the built-in behavior.\n\t *\n\t * @example\n\t * let serializedEntity = entity.toJSON()\n\t *\n\t * @return {string} JSON encoded string\n\t ", - "start": 7637, - "end": 7893, + "start": 7423, + "end": 7679, "loc": { "start": { - "line": 280, + "line": 272, "column": 1 }, "end": { - "line": 288, + "line": 280, "column": 4 } } @@ -8244,15 +7740,15 @@ { "type": "CommentBlock", "value": "*\n\t * Deserializes data from JSON, creating new components and overwriting existing components.\n\t * Note: Defining fromJSON methods in your components will override the built-in behavior.\n\t *\n\t * @example\n\t * entity.fromJSON(serializedEntity)\n\t *\n\t * @param {string} data - A JSON string containing component data to parse, and store in this entity.\n\t *\n\t * @return {Object} The original entity that fromJSON() was called on, so that operations can be chained.\n\t ", - "start": 7946, - "end": 8413, + "start": 7732, + "end": 8199, "loc": { "start": { - "line": 293, + "line": 285, "column": 1 }, "end": { - "line": 303, + "line": 295, "column": 4 } } @@ -8261,15 +7757,15 @@ }, { "type": "ClassMethod", - "start": 8415, - "end": 8732, + "start": 8201, + "end": 8518, "loc": { "start": { - "line": 304, + "line": 296, "column": 1 }, "end": { - "line": 317, + "line": 309, "column": 2 } }, @@ -8277,15 +7773,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 8415, - "end": 8423, + "start": 8201, + "end": 8209, "loc": { "start": { - "line": 304, + "line": 296, "column": 1 }, "end": { - "line": 304, + "line": 296, "column": 9 }, "identifierName": "fromJSON" @@ -8301,15 +7797,15 @@ "params": [ { "type": "Identifier", - "start": 8424, - "end": 8428, + "start": 8210, + "end": 8214, "loc": { "start": { - "line": 304, + "line": 296, "column": 10 }, "end": { - "line": 304, + "line": 296, "column": 14 }, "identifierName": "data" @@ -8319,59 +7815,59 @@ ], "body": { "type": "BlockStatement", - "start": 8430, - "end": 8732, + "start": 8216, + "end": 8518, "loc": { "start": { - "line": 304, + "line": 296, "column": 16 }, "end": { - "line": 317, + "line": 309, "column": 2 } }, "body": [ { "type": "VariableDeclaration", - "start": 8434, - "end": 8463, + "start": 8220, + "end": 8249, "loc": { "start": { - "line": 305, + "line": 297, "column": 2 }, "end": { - "line": 305, + "line": 297, "column": 31 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 8438, - "end": 8463, + "start": 8224, + "end": 8249, "loc": { "start": { - "line": 305, + "line": 297, "column": 6 }, "end": { - "line": 305, + "line": 297, "column": 31 } }, "id": { "type": "Identifier", - "start": 8438, - "end": 8444, + "start": 8224, + "end": 8230, "loc": { "start": { - "line": 305, + "line": 297, "column": 6 }, "end": { - "line": 305, + "line": 297, "column": 12 }, "identifierName": "parsed" @@ -8380,43 +7876,43 @@ }, "init": { "type": "CallExpression", - "start": 8447, - "end": 8463, + "start": 8233, + "end": 8249, "loc": { "start": { - "line": 305, + "line": 297, "column": 15 }, "end": { - "line": 305, + "line": 297, "column": 31 } }, "callee": { "type": "MemberExpression", - "start": 8447, - "end": 8457, + "start": 8233, + "end": 8243, "loc": { "start": { - "line": 305, + "line": 297, "column": 15 }, "end": { - "line": 305, + "line": 297, "column": 25 } }, "object": { "type": "Identifier", - "start": 8447, - "end": 8451, + "start": 8233, + "end": 8237, "loc": { "start": { - "line": 305, + "line": 297, "column": 15 }, "end": { - "line": 305, + "line": 297, "column": 19 }, "identifierName": "JSON" @@ -8425,15 +7921,15 @@ }, "property": { "type": "Identifier", - "start": 8452, - "end": 8457, + "start": 8238, + "end": 8243, "loc": { "start": { - "line": 305, + "line": 297, "column": 20 }, "end": { - "line": 305, + "line": 297, "column": 25 }, "identifierName": "parse" @@ -8445,15 +7941,15 @@ "arguments": [ { "type": "Identifier", - "start": 8458, - "end": 8462, + "start": 8244, + "end": 8248, "loc": { "start": { - "line": 305, + "line": 297, "column": 26 }, "end": { - "line": 305, + "line": 297, "column": 30 }, "identifierName": "data" @@ -8468,58 +7964,58 @@ }, { "type": "ForInStatement", - "start": 8466, - "end": 8715, + "start": 8252, + "end": 8501, "loc": { "start": { - "line": 306, + "line": 298, "column": 2 }, "end": { - "line": 315, + "line": 307, "column": 3 } }, "left": { "type": "VariableDeclaration", - "start": 8471, - "end": 8479, + "start": 8257, + "end": 8265, "loc": { "start": { - "line": 306, + "line": 298, "column": 7 }, "end": { - "line": 306, + "line": 298, "column": 15 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 8475, - "end": 8479, + "start": 8261, + "end": 8265, "loc": { "start": { - "line": 306, + "line": 298, "column": 11 }, "end": { - "line": 306, + "line": 298, "column": 15 } }, "id": { "type": "Identifier", - "start": 8475, - "end": 8479, + "start": 8261, + "end": 8265, "loc": { "start": { - "line": 306, + "line": 298, "column": 11 }, "end": { - "line": 306, + "line": 298, "column": 15 }, "identifierName": "name" @@ -8533,15 +8029,15 @@ }, "right": { "type": "Identifier", - "start": 8483, - "end": 8489, + "start": 8269, + "end": 8275, "loc": { "start": { - "line": 306, + "line": 298, "column": 19 }, "end": { - "line": 306, + "line": 298, "column": 25 }, "identifierName": "parsed" @@ -8550,59 +8046,59 @@ }, "body": { "type": "BlockStatement", - "start": 8491, - "end": 8715, + "start": 8277, + "end": 8501, "loc": { "start": { - "line": 306, + "line": 298, "column": 27 }, "end": { - "line": 315, + "line": 307, "column": 3 } }, "body": [ { "type": "VariableDeclaration", - "start": 8496, - "end": 8524, + "start": 8282, + "end": 8310, "loc": { "start": { - "line": 307, + "line": 299, "column": 3 }, "end": { - "line": 307, + "line": 299, "column": 31 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 8500, - "end": 8524, + "start": 8286, + "end": 8310, "loc": { "start": { - "line": 307, + "line": 299, "column": 7 }, "end": { - "line": 307, + "line": 299, "column": 31 } }, "id": { "type": "Identifier", - "start": 8500, - "end": 8504, + "start": 8286, + "end": 8290, "loc": { "start": { - "line": 307, + "line": 299, "column": 7 }, "end": { - "line": 307, + "line": 299, "column": 11 }, "identifierName": "comp" @@ -8611,58 +8107,58 @@ }, "init": { "type": "CallExpression", - "start": 8507, - "end": 8524, + "start": 8293, + "end": 8310, "loc": { "start": { - "line": 307, + "line": 299, "column": 14 }, "end": { - "line": 307, + "line": 299, "column": 31 } }, "callee": { "type": "MemberExpression", - "start": 8507, - "end": 8518, + "start": 8293, + "end": 8304, "loc": { "start": { - "line": 307, + "line": 299, "column": 14 }, "end": { - "line": 307, + "line": 299, "column": 25 } }, "object": { "type": "ThisExpression", - "start": 8507, - "end": 8511, + "start": 8293, + "end": 8297, "loc": { "start": { - "line": 307, + "line": 299, "column": 14 }, "end": { - "line": 307, + "line": 299, "column": 18 } } }, "property": { "type": "Identifier", - "start": 8512, - "end": 8518, + "start": 8298, + "end": 8304, "loc": { "start": { - "line": 307, + "line": 299, "column": 19 }, "end": { - "line": 307, + "line": 299, "column": 25 }, "identifierName": "access" @@ -8674,15 +8170,15 @@ "arguments": [ { "type": "Identifier", - "start": 8519, - "end": 8523, + "start": 8305, + "end": 8309, "loc": { "start": { - "line": 307, + "line": 299, "column": 26 }, "end": { - "line": 307, + "line": 299, "column": 30 }, "identifierName": "name" @@ -8700,15 +8196,15 @@ { "type": "CommentLine", "value": " Either call custom method or copy all properties", - "start": 8529, - "end": 8580, + "start": 8315, + "end": 8366, "loc": { "start": { - "line": 309, + "line": 301, "column": 3 }, "end": { - "line": 309, + "line": 301, "column": 54 } } @@ -8717,43 +8213,43 @@ }, { "type": "IfStatement", - "start": 8584, - "end": 8711, + "start": 8370, + "end": 8497, "loc": { "start": { - "line": 310, + "line": 302, "column": 3 }, "end": { - "line": 314, + "line": 306, "column": 4 } }, "test": { "type": "BinaryExpression", - "start": 8588, - "end": 8623, + "start": 8374, + "end": 8409, "loc": { "start": { - "line": 310, + "line": 302, "column": 7 }, "end": { - "line": 310, + "line": 302, "column": 42 } }, "left": { "type": "UnaryExpression", - "start": 8588, - "end": 8608, + "start": 8374, + "end": 8394, "loc": { "start": { - "line": 310, + "line": 302, "column": 7 }, "end": { - "line": 310, + "line": 302, "column": 27 } }, @@ -8761,29 +8257,29 @@ "prefix": true, "argument": { "type": "MemberExpression", - "start": 8595, - "end": 8608, + "start": 8381, + "end": 8394, "loc": { "start": { - "line": 310, + "line": 302, "column": 14 }, "end": { - "line": 310, + "line": 302, "column": 27 } }, "object": { "type": "Identifier", - "start": 8595, - "end": 8599, + "start": 8381, + "end": 8385, "loc": { "start": { - "line": 310, + "line": 302, "column": 14 }, "end": { - "line": 310, + "line": 302, "column": 18 }, "identifierName": "comp" @@ -8793,15 +8289,15 @@ }, "property": { "type": "Identifier", - "start": 8600, - "end": 8608, + "start": 8386, + "end": 8394, "loc": { "start": { - "line": 310, + "line": 302, "column": 19 }, "end": { - "line": 310, + "line": 302, "column": 27 }, "identifierName": "fromJSON" @@ -8819,15 +8315,15 @@ "operator": "===", "right": { "type": "StringLiteral", - "start": 8613, - "end": 8623, + "start": 8399, + "end": 8409, "loc": { "start": { - "line": 310, + "line": 302, "column": 32 }, "end": { - "line": 310, + "line": 302, "column": 42 } }, @@ -8841,72 +8337,72 @@ }, "consequent": { "type": "BlockStatement", - "start": 8625, - "end": 8663, + "start": 8411, + "end": 8449, "loc": { "start": { - "line": 310, + "line": 302, "column": 44 }, "end": { - "line": 312, + "line": 304, "column": 4 } }, "body": [ { "type": "ExpressionStatement", - "start": 8631, - "end": 8658, + "start": 8417, + "end": 8444, "loc": { "start": { - "line": 311, + "line": 303, "column": 4 }, "end": { - "line": 311, + "line": 303, "column": 31 } }, "expression": { "type": "CallExpression", - "start": 8631, - "end": 8658, + "start": 8417, + "end": 8444, "loc": { "start": { - "line": 311, + "line": 303, "column": 4 }, "end": { - "line": 311, + "line": 303, "column": 31 } }, "callee": { "type": "MemberExpression", - "start": 8631, - "end": 8644, + "start": 8417, + "end": 8430, "loc": { "start": { - "line": 311, + "line": 303, "column": 4 }, "end": { - "line": 311, + "line": 303, "column": 17 } }, "object": { "type": "Identifier", - "start": 8631, - "end": 8635, + "start": 8417, + "end": 8421, "loc": { "start": { - "line": 311, + "line": 303, "column": 4 }, "end": { - "line": 311, + "line": 303, "column": 8 }, "identifierName": "comp" @@ -8915,15 +8411,15 @@ }, "property": { "type": "Identifier", - "start": 8636, - "end": 8644, + "start": 8422, + "end": 8430, "loc": { "start": { - "line": 311, + "line": 303, "column": 9 }, "end": { - "line": 311, + "line": 303, "column": 17 }, "identifierName": "fromJSON" @@ -8935,29 +8431,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 8645, - "end": 8657, + "start": 8431, + "end": 8443, "loc": { "start": { - "line": 311, + "line": 303, "column": 18 }, "end": { - "line": 311, + "line": 303, "column": 30 } }, "object": { "type": "Identifier", - "start": 8645, - "end": 8651, + "start": 8431, + "end": 8437, "loc": { "start": { - "line": 311, + "line": 303, "column": 18 }, "end": { - "line": 311, + "line": 303, "column": 24 }, "identifierName": "parsed" @@ -8966,15 +8462,15 @@ }, "property": { "type": "Identifier", - "start": 8652, - "end": 8656, + "start": 8438, + "end": 8442, "loc": { "start": { - "line": 311, + "line": 303, "column": 25 }, "end": { - "line": 311, + "line": 303, "column": 29 }, "identifierName": "name" @@ -8991,87 +8487,87 @@ }, "alternate": { "type": "BlockStatement", - "start": 8669, - "end": 8711, + "start": 8455, + "end": 8497, "loc": { "start": { - "line": 312, + "line": 304, "column": 10 }, "end": { - "line": 314, + "line": 306, "column": 4 } }, "body": [ { "type": "ExpressionStatement", - "start": 8675, - "end": 8706, + "start": 8461, + "end": 8492, "loc": { "start": { - "line": 313, + "line": 305, "column": 4 }, "end": { - "line": 313, + "line": 305, "column": 35 } }, "expression": { "type": "CallExpression", - "start": 8675, - "end": 8706, + "start": 8461, + "end": 8492, "loc": { "start": { - "line": 313, + "line": 305, "column": 4 }, "end": { - "line": 313, + "line": 305, "column": 35 } }, "callee": { "type": "MemberExpression", - "start": 8675, - "end": 8686, + "start": 8461, + "end": 8472, "loc": { "start": { - "line": 313, + "line": 305, "column": 4 }, "end": { - "line": 313, + "line": 305, "column": 15 } }, "object": { "type": "ThisExpression", - "start": 8675, - "end": 8679, + "start": 8461, + "end": 8465, "loc": { "start": { - "line": 313, + "line": 305, "column": 4 }, "end": { - "line": 313, + "line": 305, "column": 8 } } }, "property": { "type": "Identifier", - "start": 8680, - "end": 8686, + "start": 8466, + "end": 8472, "loc": { "start": { - "line": 313, + "line": 305, "column": 9 }, "end": { - "line": 313, + "line": 305, "column": 15 }, "identifierName": "update" @@ -9083,15 +8579,15 @@ "arguments": [ { "type": "Identifier", - "start": 8687, - "end": 8691, + "start": 8473, + "end": 8477, "loc": { "start": { - "line": 313, + "line": 305, "column": 16 }, "end": { - "line": 313, + "line": 305, "column": 20 }, "identifierName": "name" @@ -9100,29 +8596,29 @@ }, { "type": "MemberExpression", - "start": 8693, - "end": 8705, + "start": 8479, + "end": 8491, "loc": { "start": { - "line": 313, + "line": 305, "column": 22 }, "end": { - "line": 313, + "line": 305, "column": 34 } }, "object": { "type": "Identifier", - "start": 8693, - "end": 8699, + "start": 8479, + "end": 8485, "loc": { "start": { - "line": 313, + "line": 305, "column": 22 }, "end": { - "line": 313, + "line": 305, "column": 28 }, "identifierName": "parsed" @@ -9131,15 +8627,15 @@ }, "property": { "type": "Identifier", - "start": 8700, - "end": 8704, + "start": 8486, + "end": 8490, "loc": { "start": { - "line": 313, + "line": 305, "column": 29 }, "end": { - "line": 313, + "line": 305, "column": 33 }, "identifierName": "name" @@ -9158,15 +8654,15 @@ { "type": "CommentLine", "value": " Either call custom method or copy all properties", - "start": 8529, - "end": 8580, + "start": 8315, + "end": 8366, "loc": { "start": { - "line": 309, + "line": 301, "column": 3 }, "end": { - "line": 309, + "line": 301, "column": 54 } } @@ -9179,29 +8675,29 @@ }, { "type": "ReturnStatement", - "start": 8718, - "end": 8729, + "start": 8504, + "end": 8515, "loc": { "start": { - "line": 316, + "line": 308, "column": 2 }, "end": { - "line": 316, + "line": 308, "column": 13 } }, "argument": { "type": "ThisExpression", - "start": 8725, - "end": 8729, + "start": 8511, + "end": 8515, "loc": { "start": { - "line": 316, + "line": 308, "column": 9 }, "end": { - "line": 316, + "line": 308, "column": 13 } } @@ -9215,15 +8711,15 @@ { "type": "CommentBlock", "value": "*\n\t * Deserializes data from JSON, creating new components and overwriting existing components.\n\t * Note: Defining fromJSON methods in your components will override the built-in behavior.\n\t *\n\t * @example\n\t * entity.fromJSON(serializedEntity)\n\t *\n\t * @param {string} data - A JSON string containing component data to parse, and store in this entity.\n\t *\n\t * @return {Object} The original entity that fromJSON() was called on, so that operations can be chained.\n\t ", - "start": 7946, - "end": 8413, + "start": 7732, + "end": 8199, "loc": { "start": { - "line": 293, + "line": 285, "column": 1 }, "end": { - "line": 303, + "line": 295, "column": 4 } } @@ -9233,15 +8729,15 @@ { "type": "CommentBlock", "value": "*\n\t * Attaches a currently detached entity back to a world.\n\t * Note: Do not use detached entities, get() may be safe, but avoid calling other methods\n\t * Note: The ID will be reassigned, so do not rely on this\n\t *\n\t * @example\n\t * entity.attach(world)\n\t *\n\t * @param {World} world - The world to attach this entity to\n\t ", - "start": 8735, - "end": 9060, + "start": 8521, + "end": 8846, "loc": { "start": { - "line": 319, + "line": 311, "column": 1 }, "end": { - "line": 328, + "line": 320, "column": 4 } } @@ -9250,15 +8746,15 @@ }, { "type": "ClassMethod", - "start": 9062, - "end": 9297, + "start": 8848, + "end": 9097, "loc": { "start": { - "line": 329, + "line": 321, "column": 1 }, "end": { - "line": 337, + "line": 329, "column": 2 } }, @@ -9266,15 +8762,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 9062, - "end": 9068, + "start": 8848, + "end": 8854, "loc": { "start": { - "line": 329, + "line": 321, "column": 1 }, "end": { - "line": 329, + "line": 321, "column": 7 }, "identifierName": "attach" @@ -9290,15 +8786,15 @@ "params": [ { "type": "Identifier", - "start": 9069, - "end": 9074, + "start": 8855, + "end": 8860, "loc": { "start": { - "line": 329, + "line": 321, "column": 8 }, "end": { - "line": 329, + "line": 321, "column": 13 }, "identifierName": "world" @@ -9308,58 +8804,58 @@ ], "body": { "type": "BlockStatement", - "start": 9076, - "end": 9297, + "start": 8862, + "end": 9097, "loc": { "start": { - "line": 329, + "line": 321, "column": 15 }, "end": { - "line": 337, + "line": 329, "column": 2 } }, "body": [ { "type": "IfStatement", - "start": 9080, - "end": 9294, + "start": 8866, + "end": 9094, "loc": { "start": { - "line": 330, + "line": 322, "column": 2 }, "end": { - "line": 336, + "line": 328, "column": 3 } }, "test": { "type": "LogicalExpression", - "start": 9084, - "end": 9106, + "start": 8870, + "end": 8892, "loc": { "start": { - "line": 330, + "line": 322, "column": 6 }, "end": { - "line": 330, + "line": 322, "column": 28 } }, "left": { "type": "Identifier", - "start": 9084, - "end": 9089, + "start": 8870, + "end": 8875, "loc": { "start": { - "line": 330, + "line": 322, "column": 6 }, "end": { - "line": 330, + "line": 322, "column": 11 }, "identifierName": "world" @@ -9369,15 +8865,15 @@ "operator": "&&", "right": { "type": "UnaryExpression", - "start": 9093, - "end": 9106, + "start": 8879, + "end": 8892, "loc": { "start": { - "line": 330, + "line": 322, "column": 15 }, "end": { - "line": 330, + "line": 322, "column": 28 } }, @@ -9385,58 +8881,58 @@ "prefix": true, "argument": { "type": "CallExpression", - "start": 9094, - "end": 9106, + "start": 8880, + "end": 8892, "loc": { "start": { - "line": 330, + "line": 322, "column": 16 }, "end": { - "line": 330, + "line": 322, "column": 28 } }, "callee": { "type": "MemberExpression", - "start": 9094, - "end": 9104, + "start": 8880, + "end": 8890, "loc": { "start": { - "line": 330, + "line": 322, "column": 16 }, "end": { - "line": 330, + "line": 322, "column": 26 } }, "object": { "type": "ThisExpression", - "start": 9094, - "end": 9098, + "start": 8880, + "end": 8884, "loc": { "start": { - "line": 330, + "line": 322, "column": 16 }, "end": { - "line": 330, + "line": 322, "column": 20 } } }, "property": { "type": "Identifier", - "start": 9099, - "end": 9104, + "start": 8885, + "end": 8890, "loc": { "start": { - "line": 330, + "line": 322, "column": 21 }, "end": { - "line": 330, + "line": 322, "column": 26 }, "identifierName": "valid" @@ -9454,73 +8950,73 @@ }, "consequent": { "type": "BlockStatement", - "start": 9108, - "end": 9294, + "start": 8894, + "end": 9094, "loc": { "start": { - "line": 330, + "line": 322, "column": 30 }, "end": { - "line": 336, + "line": 328, "column": 3 } }, "body": [ { "type": "ExpressionStatement", - "start": 9156, - "end": 9174, + "start": 8942, + "end": 8960, "loc": { "start": { - "line": 332, + "line": 324, "column": 3 }, "end": { - "line": 332, + "line": 324, "column": 21 } }, "expression": { "type": "AssignmentExpression", - "start": 9156, - "end": 9174, + "start": 8942, + "end": 8960, "loc": { "start": { - "line": 332, + "line": 324, "column": 3 }, "end": { - "line": 332, + "line": 324, "column": 21 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 9156, - "end": 9166, + "start": 8942, + "end": 8952, "loc": { "start": { - "line": 332, + "line": 324, "column": 3 }, "end": { - "line": 332, + "line": 324, "column": 13 } }, "object": { "type": "ThisExpression", - "start": 9156, - "end": 9160, + "start": 8942, + "end": 8946, "loc": { "start": { - "line": 332, + "line": 324, "column": 3 }, "end": { - "line": 332, + "line": 324, "column": 7 } }, @@ -9528,15 +9024,15 @@ }, "property": { "type": "Identifier", - "start": 9161, - "end": 9166, + "start": 8947, + "end": 8952, "loc": { "start": { - "line": 332, + "line": 324, "column": 8 }, "end": { - "line": 332, + "line": 324, "column": 13 }, "identifierName": "world" @@ -9548,15 +9044,15 @@ }, "right": { "type": "Identifier", - "start": 9169, - "end": 9174, + "start": 8955, + "end": 8960, "loc": { "start": { - "line": 332, + "line": 324, "column": 16 }, "end": { - "line": 332, + "line": 324, "column": 21 }, "identifierName": "world" @@ -9569,15 +9065,15 @@ { "type": "CommentLine", "value": " Assign new id, and reattach to world", - "start": 9113, - "end": 9152, + "start": 8899, + "end": 8938, "loc": { "start": { - "line": 331, + "line": 323, "column": 3 }, "end": { - "line": 331, + "line": 323, "column": 42 } } @@ -9586,73 +9082,73 @@ }, { "type": "ExpressionStatement", - "start": 9178, - "end": 9211, + "start": 8964, + "end": 8997, "loc": { "start": { - "line": 333, + "line": 325, "column": 3 }, "end": { - "line": 333, + "line": 325, "column": 36 } }, "expression": { "type": "AssignmentExpression", - "start": 9178, - "end": 9211, + "start": 8964, + "end": 8997, "loc": { "start": { - "line": 333, + "line": 325, "column": 3 }, "end": { - "line": 333, + "line": 325, "column": 36 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 9178, - "end": 9186, + "start": 8964, + "end": 8972, "loc": { "start": { - "line": 333, + "line": 325, "column": 3 }, "end": { - "line": 333, + "line": 325, "column": 11 } }, "object": { "type": "ThisExpression", - "start": 9178, - "end": 9182, + "start": 8964, + "end": 8968, "loc": { "start": { - "line": 333, + "line": 325, "column": 3 }, "end": { - "line": 333, + "line": 325, "column": 7 } } }, "property": { "type": "Identifier", - "start": 9183, - "end": 9186, + "start": 8969, + "end": 8972, "loc": { "start": { - "line": 333, + "line": 325, "column": 8 }, "end": { - "line": 333, + "line": 325, "column": 11 }, "identifierName": "_id" @@ -9663,15 +9159,15 @@ }, "right": { "type": "UpdateExpression", - "start": 9189, - "end": 9211, + "start": 8975, + "end": 8997, "loc": { "start": { - "line": 333, + "line": 325, "column": 14 }, "end": { - "line": 333, + "line": 325, "column": 36 } }, @@ -9679,58 +9175,58 @@ "prefix": false, "argument": { "type": "MemberExpression", - "start": 9189, - "end": 9209, + "start": 8975, + "end": 8995, "loc": { "start": { - "line": 333, + "line": 325, "column": 14 }, "end": { - "line": 333, + "line": 325, "column": 34 } }, "object": { "type": "MemberExpression", - "start": 9189, - "end": 9199, + "start": 8975, + "end": 8985, "loc": { "start": { - "line": 333, + "line": 325, "column": 14 }, "end": { - "line": 333, + "line": 325, "column": 24 } }, "object": { "type": "ThisExpression", - "start": 9189, - "end": 9193, + "start": 8975, + "end": 8979, "loc": { "start": { - "line": 333, + "line": 325, "column": 14 }, "end": { - "line": 333, + "line": 325, "column": 18 } } }, "property": { "type": "Identifier", - "start": 9194, - "end": 9199, + "start": 8980, + "end": 8985, "loc": { "start": { - "line": 333, + "line": 325, "column": 19 }, "end": { - "line": 333, + "line": 325, "column": 24 }, "identifierName": "world" @@ -9741,15 +9237,15 @@ }, "property": { "type": "Identifier", - "start": 9200, - "end": 9209, + "start": 8986, + "end": 8995, "loc": { "start": { - "line": 333, + "line": 325, "column": 25 }, "end": { - "line": 333, + "line": 325, "column": 34 }, "identifierName": "idCounter" @@ -9763,100 +9259,100 @@ }, { "type": "ExpressionStatement", - "start": 9215, - "end": 9254, + "start": 9001, + "end": 9040, "loc": { "start": { - "line": 334, + "line": 326, "column": 3 }, "end": { - "line": 334, + "line": 326, "column": 42 } }, "expression": { "type": "CallExpression", - "start": 9215, - "end": 9254, + "start": 9001, + "end": 9040, "loc": { "start": { - "line": 334, + "line": 326, "column": 3 }, "end": { - "line": 334, + "line": 326, "column": 42 } }, "callee": { "type": "MemberExpression", - "start": 9215, - "end": 9238, + "start": 9001, + "end": 9024, "loc": { "start": { - "line": 334, + "line": 326, "column": 3 }, "end": { - "line": 334, + "line": 326, "column": 26 } }, "object": { "type": "MemberExpression", - "start": 9215, - "end": 9234, + "start": 9001, + "end": 9020, "loc": { "start": { - "line": 334, + "line": 326, "column": 3 }, "end": { - "line": 334, + "line": 326, "column": 22 } }, "object": { "type": "MemberExpression", - "start": 9215, - "end": 9225, + "start": 9001, + "end": 9011, "loc": { "start": { - "line": 334, + "line": 326, "column": 3 }, "end": { - "line": 334, + "line": 326, "column": 13 } }, "object": { "type": "ThisExpression", - "start": 9215, - "end": 9219, + "start": 9001, + "end": 9005, "loc": { "start": { - "line": 334, + "line": 326, "column": 3 }, "end": { - "line": 334, + "line": 326, "column": 7 } } }, "property": { "type": "Identifier", - "start": 9220, - "end": 9225, + "start": 9006, + "end": 9011, "loc": { "start": { - "line": 334, + "line": 326, "column": 8 }, "end": { - "line": 334, + "line": 326, "column": 13 }, "identifierName": "world" @@ -9867,15 +9363,15 @@ }, "property": { "type": "Identifier", - "start": 9226, - "end": 9234, + "start": 9012, + "end": 9020, "loc": { "start": { - "line": 334, + "line": 326, "column": 14 }, "end": { - "line": 334, + "line": 326, "column": 22 }, "identifierName": "entities" @@ -9886,15 +9382,15 @@ }, "property": { "type": "Identifier", - "start": 9235, - "end": 9238, + "start": 9021, + "end": 9024, "loc": { "start": { - "line": 334, + "line": 326, "column": 23 }, "end": { - "line": 334, + "line": 326, "column": 26 }, "identifierName": "set" @@ -9906,44 +9402,44 @@ "arguments": [ { "type": "MemberExpression", - "start": 9239, - "end": 9247, + "start": 9025, + "end": 9033, "loc": { "start": { - "line": 334, + "line": 326, "column": 27 }, "end": { - "line": 334, + "line": 326, "column": 35 } }, "object": { "type": "ThisExpression", - "start": 9239, - "end": 9243, + "start": 9025, + "end": 9029, "loc": { "start": { - "line": 334, + "line": 326, "column": 27 }, "end": { - "line": 334, + "line": 326, "column": 31 } } }, "property": { "type": "Identifier", - "start": 9244, - "end": 9247, + "start": 9030, + "end": 9033, "loc": { "start": { - "line": 334, + "line": 326, "column": 32 }, "end": { - "line": 334, + "line": 326, "column": 35 }, "identifierName": "_id" @@ -9954,15 +9450,15 @@ }, { "type": "ThisExpression", - "start": 9249, - "end": 9253, + "start": 9035, + "end": 9039, "loc": { "start": { - "line": 334, + "line": 326, "column": 37 }, "end": { - "line": 334, + "line": 326, "column": 41 } } @@ -9972,100 +9468,100 @@ }, { "type": "ExpressionStatement", - "start": 9258, - "end": 9290, + "start": 9044, + "end": 9090, "loc": { "start": { - "line": 335, + "line": 327, "column": 3 }, "end": { - "line": 335, - "column": 35 + "line": 327, + "column": 49 } }, "expression": { "type": "CallExpression", - "start": 9258, - "end": 9290, + "start": 9044, + "end": 9090, "loc": { "start": { - "line": 335, + "line": 327, "column": 3 }, "end": { - "line": 335, - "column": 35 + "line": 327, + "column": 49 } }, "callee": { "type": "MemberExpression", - "start": 9258, - "end": 9284, + "start": 9044, + "end": 9064, "loc": { "start": { - "line": 335, + "line": 327, "column": 3 }, "end": { - "line": 335, - "column": 29 + "line": 327, + "column": 23 } }, "object": { "type": "MemberExpression", - "start": 9258, - "end": 9274, + "start": 9044, + "end": 9060, "loc": { "start": { - "line": 335, + "line": 327, "column": 3 }, "end": { - "line": 335, + "line": 327, "column": 19 } }, "object": { "type": "MemberExpression", - "start": 9258, - "end": 9268, + "start": 9044, + "end": 9054, "loc": { "start": { - "line": 335, + "line": 327, "column": 3 }, "end": { - "line": 335, + "line": 327, "column": 13 } }, "object": { "type": "ThisExpression", - "start": 9258, - "end": 9262, + "start": 9044, + "end": 9048, "loc": { "start": { - "line": 335, + "line": 327, "column": 3 }, "end": { - "line": 335, + "line": 327, "column": 7 } } }, "property": { "type": "Identifier", - "start": 9263, - "end": 9268, + "start": 9049, + "end": 9054, "loc": { "start": { - "line": 335, + "line": 327, "column": 8 }, "end": { - "line": 335, + "line": 327, "column": 13 }, "identifierName": "world" @@ -10076,15 +9572,15 @@ }, "property": { "type": "Identifier", - "start": 9269, - "end": 9274, + "start": 9055, + "end": 9060, "loc": { "start": { - "line": 335, + "line": 327, "column": 14 }, "end": { - "line": 335, + "line": 327, "column": 19 }, "identifierName": "index" @@ -10095,37 +9591,100 @@ }, "property": { "type": "Identifier", - "start": 9275, - "end": 9284, + "start": 9061, + "end": 9064, "loc": { "start": { - "line": 335, + "line": 327, "column": 20 }, "end": { - "line": 335, - "column": 29 + "line": 327, + "column": 23 }, - "identifierName": "addEntity" + "identifierName": "add" }, - "name": "addEntity" + "name": "add" }, "computed": false }, "arguments": [ { "type": "ThisExpression", - "start": 9285, - "end": 9289, + "start": 9065, + "end": 9069, + "loc": { + "start": { + "line": 327, + "column": 24 + }, + "end": { + "line": 327, + "column": 28 + } + } + }, + { + "type": "SpreadElement", + "start": 9071, + "end": 9089, "loc": { "start": { - "line": 335, + "line": 327, "column": 30 }, "end": { - "line": 335, - "column": 34 + "line": 327, + "column": 48 } + }, + "argument": { + "type": "MemberExpression", + "start": 9074, + "end": 9089, + "loc": { + "start": { + "line": 327, + "column": 33 + }, + "end": { + "line": 327, + "column": 48 + } + }, + "object": { + "type": "ThisExpression", + "start": 9074, + "end": 9078, + "loc": { + "start": { + "line": 327, + "column": 33 + }, + "end": { + "line": 327, + "column": 37 + } + } + }, + "property": { + "type": "Identifier", + "start": 9079, + "end": 9089, + "loc": { + "start": { + "line": 327, + "column": 38 + }, + "end": { + "line": 327, + "column": 48 + }, + "identifierName": "components" + }, + "name": "components" + }, + "computed": false } } ] @@ -10144,15 +9703,15 @@ { "type": "CommentBlock", "value": "*\n\t * Attaches a currently detached entity back to a world.\n\t * Note: Do not use detached entities, get() may be safe, but avoid calling other methods\n\t * Note: The ID will be reassigned, so do not rely on this\n\t *\n\t * @example\n\t * entity.attach(world)\n\t *\n\t * @param {World} world - The world to attach this entity to\n\t ", - "start": 8735, - "end": 9060, + "start": 8521, + "end": 8846, "loc": { "start": { - "line": 319, + "line": 311, "column": 1 }, "end": { - "line": 328, + "line": 320, "column": 4 } } @@ -10162,15 +9721,15 @@ { "type": "CommentBlock", "value": "*\n\t * Removes this entity from the current world, without removing any components or data.\n\t * It can be re-attached to another world (or the same world), using the attach() method.\n\t * Note: Do not use detached entities, get() may be safe, but avoid calling other methods\n\t * Note: The ID will be reassigned, so do not rely on this\n\t *\n\t * @example\n\t * entity.detach()\n\t ", - "start": 9300, - "end": 9676, + "start": 9100, + "end": 9476, "loc": { "start": { - "line": 339, + "line": 331, "column": 1 }, "end": { - "line": 347, + "line": 339, "column": 4 } } @@ -10179,15 +9738,15 @@ }, { "type": "ClassMethod", - "start": 9678, - "end": 9878, + "start": 9478, + "end": 9692, "loc": { "start": { - "line": 348, + "line": 340, "column": 1 }, "end": { - "line": 356, + "line": 348, "column": 2 } }, @@ -10195,15 +9754,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 9678, - "end": 9684, + "start": 9478, + "end": 9484, "loc": { "start": { - "line": 348, + "line": 340, "column": 1 }, "end": { - "line": 348, + "line": 340, "column": 7 }, "identifierName": "detach" @@ -10219,87 +9778,87 @@ "params": [], "body": { "type": "BlockStatement", - "start": 9687, - "end": 9878, + "start": 9487, + "end": 9692, "loc": { "start": { - "line": 348, + "line": 340, "column": 10 }, "end": { - "line": 356, + "line": 348, "column": 2 } }, "body": [ { "type": "IfStatement", - "start": 9691, - "end": 9875, + "start": 9491, + "end": 9689, "loc": { "start": { - "line": 349, + "line": 341, "column": 2 }, "end": { - "line": 355, + "line": 347, "column": 3 } }, "test": { "type": "CallExpression", - "start": 9695, - "end": 9707, + "start": 9495, + "end": 9507, "loc": { "start": { - "line": 349, + "line": 341, "column": 6 }, "end": { - "line": 349, + "line": 341, "column": 18 } }, "callee": { "type": "MemberExpression", - "start": 9695, - "end": 9705, + "start": 9495, + "end": 9505, "loc": { "start": { - "line": 349, + "line": 341, "column": 6 }, "end": { - "line": 349, + "line": 341, "column": 16 } }, "object": { "type": "ThisExpression", - "start": 9695, - "end": 9699, + "start": 9495, + "end": 9499, "loc": { "start": { - "line": 349, + "line": 341, "column": 6 }, "end": { - "line": 349, + "line": 341, "column": 10 } } }, "property": { "type": "Identifier", - "start": 9700, - "end": 9705, + "start": 9500, + "end": 9505, "loc": { "start": { - "line": 349, + "line": 341, "column": 11 }, "end": { - "line": 349, + "line": 341, "column": 16 }, "identifierName": "valid" @@ -10312,100 +9871,100 @@ }, "consequent": { "type": "BlockStatement", - "start": 9709, - "end": 9875, + "start": 9509, + "end": 9689, "loc": { "start": { - "line": 349, + "line": 341, "column": 20 }, "end": { - "line": 355, + "line": 347, "column": 3 } }, "body": [ { "type": "ExpressionStatement", - "start": 9746, - "end": 9781, + "start": 9546, + "end": 9595, "loc": { "start": { - "line": 351, + "line": 343, "column": 3 }, "end": { - "line": 351, - "column": 38 + "line": 343, + "column": 52 } }, "expression": { "type": "CallExpression", - "start": 9746, - "end": 9781, + "start": 9546, + "end": 9595, "loc": { "start": { - "line": 351, + "line": 343, "column": 3 }, "end": { - "line": 351, - "column": 38 + "line": 343, + "column": 52 } }, "callee": { "type": "MemberExpression", - "start": 9746, - "end": 9775, + "start": 9546, + "end": 9569, "loc": { "start": { - "line": 351, + "line": 343, "column": 3 }, "end": { - "line": 351, - "column": 32 + "line": 343, + "column": 26 } }, "object": { "type": "MemberExpression", - "start": 9746, - "end": 9762, + "start": 9546, + "end": 9562, "loc": { "start": { - "line": 351, + "line": 343, "column": 3 }, "end": { - "line": 351, + "line": 343, "column": 19 } }, "object": { "type": "MemberExpression", - "start": 9746, - "end": 9756, + "start": 9546, + "end": 9556, "loc": { "start": { - "line": 351, + "line": 343, "column": 3 }, "end": { - "line": 351, + "line": 343, "column": 13 } }, "object": { "type": "ThisExpression", - "start": 9746, - "end": 9750, + "start": 9546, + "end": 9550, "loc": { "start": { - "line": 351, + "line": 343, "column": 3 }, "end": { - "line": 351, + "line": 343, "column": 7 } }, @@ -10413,15 +9972,15 @@ }, "property": { "type": "Identifier", - "start": 9751, - "end": 9756, + "start": 9551, + "end": 9556, "loc": { "start": { - "line": 351, + "line": 343, "column": 8 }, "end": { - "line": 351, + "line": 343, "column": 13 }, "identifierName": "world" @@ -10433,15 +9992,15 @@ }, "property": { "type": "Identifier", - "start": 9757, - "end": 9762, + "start": 9557, + "end": 9562, "loc": { "start": { - "line": 351, + "line": 343, "column": 14 }, "end": { - "line": 351, + "line": 343, "column": 19 }, "identifierName": "index" @@ -10453,20 +10012,20 @@ }, "property": { "type": "Identifier", - "start": 9763, - "end": 9775, + "start": 9563, + "end": 9569, "loc": { "start": { - "line": 351, + "line": 343, "column": 20 }, "end": { - "line": 351, - "column": 32 + "line": 343, + "column": 26 }, - "identifierName": "removeEntity" + "identifierName": "remove" }, - "name": "removeEntity" + "name": "remove" }, "computed": false, "leadingComments": null @@ -10474,137 +10033,200 @@ "arguments": [ { "type": "ThisExpression", - "start": 9776, - "end": 9780, + "start": 9570, + "end": 9574, "loc": { "start": { - "line": 351, - "column": 33 + "line": 343, + "column": 27 }, "end": { - "line": 351, - "column": 37 + "line": 343, + "column": 31 } } - } - ], - "leadingComments": null - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Remove from current world", - "start": 9714, - "end": 9742, - "loc": { - "start": { - "line": 350, - "column": 3 + }, + { + "type": "SpreadElement", + "start": 9576, + "end": 9594, + "loc": { + "start": { + "line": 343, + "column": 33 + }, + "end": { + "line": 343, + "column": 51 + } }, - "end": { - "line": 350, - "column": 31 - } + "argument": { + "type": "MemberExpression", + "start": 9579, + "end": 9594, + "loc": { + "start": { + "line": 343, + "column": 36 + }, + "end": { + "line": 343, + "column": 51 + } + }, + "object": { + "type": "ThisExpression", + "start": 9579, + "end": 9583, + "loc": { + "start": { + "line": 343, + "column": 36 + }, + "end": { + "line": 343, + "column": 40 + } + } + }, + "property": { + "type": "Identifier", + "start": 9584, + "end": 9594, + "loc": { + "start": { + "line": 343, + "column": 41 + }, + "end": { + "line": 343, + "column": 51 + }, + "identifierName": "components" + }, + "name": "components" + }, + "computed": false + } + } + ], + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Remove from current world", + "start": 9514, + "end": 9542, + "loc": { + "start": { + "line": 342, + "column": 3 + }, + "end": { + "line": 342, + "column": 31 + } } } ] }, { "type": "ExpressionStatement", - "start": 9785, - "end": 9821, + "start": 9599, + "end": 9635, "loc": { "start": { - "line": 352, + "line": 344, "column": 3 }, "end": { - "line": 352, + "line": 344, "column": 39 } }, "expression": { "type": "CallExpression", - "start": 9785, - "end": 9821, + "start": 9599, + "end": 9635, "loc": { "start": { - "line": 352, + "line": 344, "column": 3 }, "end": { - "line": 352, + "line": 344, "column": 39 } }, "callee": { "type": "MemberExpression", - "start": 9785, - "end": 9811, + "start": 9599, + "end": 9625, "loc": { "start": { - "line": 352, + "line": 344, "column": 3 }, "end": { - "line": 352, + "line": 344, "column": 29 } }, "object": { "type": "MemberExpression", - "start": 9785, - "end": 9804, + "start": 9599, + "end": 9618, "loc": { "start": { - "line": 352, + "line": 344, "column": 3 }, "end": { - "line": 352, + "line": 344, "column": 22 } }, "object": { "type": "MemberExpression", - "start": 9785, - "end": 9795, + "start": 9599, + "end": 9609, "loc": { "start": { - "line": 352, + "line": 344, "column": 3 }, "end": { - "line": 352, + "line": 344, "column": 13 } }, "object": { "type": "ThisExpression", - "start": 9785, - "end": 9789, + "start": 9599, + "end": 9603, "loc": { "start": { - "line": 352, + "line": 344, "column": 3 }, "end": { - "line": 352, + "line": 344, "column": 7 } } }, "property": { "type": "Identifier", - "start": 9790, - "end": 9795, + "start": 9604, + "end": 9609, "loc": { "start": { - "line": 352, + "line": 344, "column": 8 }, "end": { - "line": 352, + "line": 344, "column": 13 }, "identifierName": "world" @@ -10615,15 +10237,15 @@ }, "property": { "type": "Identifier", - "start": 9796, - "end": 9804, + "start": 9610, + "end": 9618, "loc": { "start": { - "line": 352, + "line": 344, "column": 14 }, "end": { - "line": 352, + "line": 344, "column": 22 }, "identifierName": "entities" @@ -10634,15 +10256,15 @@ }, "property": { "type": "Identifier", - "start": 9805, - "end": 9811, + "start": 9619, + "end": 9625, "loc": { "start": { - "line": 352, + "line": 344, "column": 23 }, "end": { - "line": 352, + "line": 344, "column": 29 }, "identifierName": "delete" @@ -10654,44 +10276,44 @@ "arguments": [ { "type": "MemberExpression", - "start": 9812, - "end": 9820, + "start": 9626, + "end": 9634, "loc": { "start": { - "line": 352, + "line": 344, "column": 30 }, "end": { - "line": 352, + "line": 344, "column": 38 } }, "object": { "type": "ThisExpression", - "start": 9812, - "end": 9816, + "start": 9626, + "end": 9630, "loc": { "start": { - "line": 352, + "line": 344, "column": 30 }, "end": { - "line": 352, + "line": 344, "column": 34 } } }, "property": { "type": "Identifier", - "start": 9817, - "end": 9820, + "start": 9631, + "end": 9634, "loc": { "start": { - "line": 352, + "line": 344, "column": 35 }, "end": { - "line": 352, + "line": 344, "column": 38 }, "identifierName": "_id" @@ -10705,73 +10327,73 @@ }, { "type": "ExpressionStatement", - "start": 9825, - "end": 9845, + "start": 9639, + "end": 9659, "loc": { "start": { - "line": 353, + "line": 345, "column": 3 }, "end": { - "line": 353, + "line": 345, "column": 23 } }, "expression": { "type": "AssignmentExpression", - "start": 9825, - "end": 9845, + "start": 9639, + "end": 9659, "loc": { "start": { - "line": 353, + "line": 345, "column": 3 }, "end": { - "line": 353, + "line": 345, "column": 23 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 9825, - "end": 9833, + "start": 9639, + "end": 9647, "loc": { "start": { - "line": 353, + "line": 345, "column": 3 }, "end": { - "line": 353, + "line": 345, "column": 11 } }, "object": { "type": "ThisExpression", - "start": 9825, - "end": 9829, + "start": 9639, + "end": 9643, "loc": { "start": { - "line": 353, + "line": 345, "column": 3 }, "end": { - "line": 353, + "line": 345, "column": 7 } } }, "property": { "type": "Identifier", - "start": 9830, - "end": 9833, + "start": 9644, + "end": 9647, "loc": { "start": { - "line": 353, + "line": 345, "column": 8 }, "end": { - "line": 353, + "line": 345, "column": 11 }, "identifierName": "_id" @@ -10782,15 +10404,15 @@ }, "right": { "type": "Identifier", - "start": 9836, - "end": 9845, + "start": 9650, + "end": 9659, "loc": { "start": { - "line": 353, + "line": 345, "column": 14 }, "end": { - "line": 353, + "line": 345, "column": 23 }, "identifierName": "undefined" @@ -10801,73 +10423,73 @@ }, { "type": "ExpressionStatement", - "start": 9849, - "end": 9871, + "start": 9663, + "end": 9685, "loc": { "start": { - "line": 354, + "line": 346, "column": 3 }, "end": { - "line": 354, + "line": 346, "column": 25 } }, "expression": { "type": "AssignmentExpression", - "start": 9849, - "end": 9871, + "start": 9663, + "end": 9685, "loc": { "start": { - "line": 354, + "line": 346, "column": 3 }, "end": { - "line": 354, + "line": 346, "column": 25 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 9849, - "end": 9859, + "start": 9663, + "end": 9673, "loc": { "start": { - "line": 354, + "line": 346, "column": 3 }, "end": { - "line": 354, + "line": 346, "column": 13 } }, "object": { "type": "ThisExpression", - "start": 9849, - "end": 9853, + "start": 9663, + "end": 9667, "loc": { "start": { - "line": 354, + "line": 346, "column": 3 }, "end": { - "line": 354, + "line": 346, "column": 7 } } }, "property": { "type": "Identifier", - "start": 9854, - "end": 9859, + "start": 9668, + "end": 9673, "loc": { "start": { - "line": 354, + "line": 346, "column": 8 }, "end": { - "line": 354, + "line": 346, "column": 13 }, "identifierName": "world" @@ -10878,15 +10500,15 @@ }, "right": { "type": "Identifier", - "start": 9862, - "end": 9871, + "start": 9676, + "end": 9685, "loc": { "start": { - "line": 354, + "line": 346, "column": 16 }, "end": { - "line": 354, + "line": 346, "column": 25 }, "identifierName": "undefined" @@ -10907,15 +10529,15 @@ { "type": "CommentBlock", "value": "*\n\t * Removes this entity from the current world, without removing any components or data.\n\t * It can be re-attached to another world (or the same world), using the attach() method.\n\t * Note: Do not use detached entities, get() may be safe, but avoid calling other methods\n\t * Note: The ID will be reassigned, so do not rely on this\n\t *\n\t * @example\n\t * entity.detach()\n\t ", - "start": 9300, - "end": 9676, + "start": 9100, + "end": 9476, "loc": { "start": { - "line": 339, + "line": 331, "column": 1 }, "end": { - "line": 347, + "line": 339, "column": 4 } } @@ -10945,58 +10567,58 @@ }, { "type": "ExpressionStatement", - "start": 9882, - "end": 9905, + "start": 9696, + "end": 9719, "loc": { "start": { - "line": 359, + "line": 351, "column": 0 }, "end": { - "line": 359, + "line": 351, "column": 23 } }, "expression": { "type": "AssignmentExpression", - "start": 9882, - "end": 9905, + "start": 9696, + "end": 9719, "loc": { "start": { - "line": 359, + "line": 351, "column": 0 }, "end": { - "line": 359, + "line": 351, "column": 23 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 9882, - "end": 9896, + "start": 9696, + "end": 9710, "loc": { "start": { - "line": 359, + "line": 351, "column": 0 }, "end": { - "line": 359, + "line": 351, "column": 14 } }, "object": { "type": "Identifier", - "start": 9882, - "end": 9889, + "start": 9696, + "end": 9703, "loc": { "start": { - "line": 359, + "line": 351, "column": 0 }, "end": { - "line": 359, + "line": 351, "column": 7 }, "identifierName": "exports" @@ -11005,15 +10627,15 @@ }, "property": { "type": "Identifier", - "start": 9890, - "end": 9896, + "start": 9704, + "end": 9710, "loc": { "start": { - "line": 359, + "line": 351, "column": 8 }, "end": { - "line": 359, + "line": 351, "column": 14 }, "identifierName": "Entity" @@ -11024,15 +10646,15 @@ }, "right": { "type": "Identifier", - "start": 9899, - "end": 9905, + "start": 9713, + "end": 9719, "loc": { "start": { - "line": 359, + "line": 351, "column": 17 }, "end": { - "line": 359, + "line": 351, "column": 23 }, "identifierName": "Entity" @@ -11141,34 +10763,18 @@ } } }, - { - "type": "CommentLine", - "value": " Add to the index, to update match all index", - "start": 573, - "end": 619, - "loc": { - "start": { - "line": 29, - "column": 2 - }, - "end": { - "line": 29, - "column": 48 - } - } - }, { "type": "CommentBlock", "value": "*\n\t * Return the entity ID.\n\t *\n\t * @return {number} Integer entity ID\n\t ", - "start": 687, - "end": 764, + "start": 575, + "end": 652, "loc": { "start": { - "line": 35, + "line": 30, "column": 1 }, "end": { - "line": 39, + "line": 34, "column": 4 } } @@ -11176,15 +10782,15 @@ { "type": "CommentBlock", "value": "*\n\t * ID is read-only, attempting to set it will throw an error.\n\t *\n\t * @private\n\t *\n\t * @throws {Error} Cannot set entity id\n\t ", - "start": 800, - "end": 933, + "start": 688, + "end": 821, "loc": { "start": { - "line": 44, + "line": 39, "column": 1 }, "end": { - "line": 50, + "line": 45, "column": 4 } } @@ -11192,15 +10798,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns true if the entity has ALL of the specified component names.\n\t * Additional components that the entity has, which are not specified in has(), will be ignored.\n\t * If no component names are specified, this method returns true.\n\t *\n\t * @example\n\t * if (entity.has('position', 'velocity')) {...}\n\t *\n\t * @param {...string} [components] - The component names to check for\n\t *\n\t * @return {boolean} true or false\n\t ", - "start": 995, - "end": 1423, + "start": 883, + "end": 1311, "loc": { "start": { - "line": 55, + "line": 50, "column": 1 }, "end": { - "line": 66, + "line": 61, "column": 4 } } @@ -11208,15 +10814,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns a component by name, or undefined if it doesn't exist\n\t *\n\t * @example\n\t * let position = entity.get('position')\n\t *\n\t * @param {string} component - The component name to get\n\t *\n\t * @return {Object} The component if defined, otherwise undefined\n\t ", - "start": 1504, - "end": 1770, + "start": 1392, + "end": 1658, "loc": { "start": { - "line": 71, + "line": 66, "column": 1 }, "end": { - "line": 80, + "line": 75, "column": 4 } } @@ -11224,15 +10830,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns a component by name (automatically created if it doesn't exist)\n\t *\n\t * @example\n\t * let position = entity.access('position', 3, 4)\n\t *\n\t * @param {string} component - The component name to create/get\n\t * @param {...Object} [args] - The arguments to forward to create the new component, only if it doesn't exist.\n\t *\n\t * @return {Object} Always returns either the existing component, or the newly created one.\n\t ", - "start": 1824, - "end": 2260, + "start": 1712, + "end": 2148, "loc": { "start": { - "line": 85, + "line": 80, "column": 1 }, "end": { - "line": 95, + "line": 90, "column": 4 } } @@ -11240,15 +10846,15 @@ { "type": "CommentBlock", "value": "*\n\t * Adds a new component, or re-creates and overwrites an existing component\n\t *\n\t * @example\n\t * entity.set('position', 1, 2)\n\t *\n\t * @example\n\t * entity.set('anonymousComponent', { keys: 'values' })\n\t *\n\t * @example\n\t * entity.set('anotherAnonymousComponent', 'Any type of any value')\n\t *\n\t * @param {string} component - The component name to create. If there is a registered component for this name, then\n\t * its constructor will be called with (entity, ...args) and an object of that type will be created. The onCreate method\n\t * gets called after the component is added to the entity. This method also gets passed the same parameters.\n\t * @param {...Object} [args] - The arguments to forward to the registered component type. If the component type is\n\t * registered, then only the first additional argument will be used as the value of the entire component.\n\t *\n\t * @return {Object} The original entity that set() was called on, so that operations can be chained.\n\t ", - "start": 2392, - "end": 3375, + "start": 2280, + "end": 3263, "loc": { "start": { - "line": 103, + "line": 98, "column": 1 }, "end": { - "line": 122, + "line": 117, "column": 4 } } @@ -11256,15 +10862,15 @@ { "type": "CommentLine", "value": " Create component and store in entity", - "start": 3466, - "end": 3505, + "start": 3354, + "end": 3393, "loc": { "start": { - "line": 125, + "line": 120, "column": 3 }, "end": { - "line": 125, + "line": 120, "column": 42 } } @@ -11272,15 +10878,15 @@ { "type": "CommentLine", "value": " Note: The entity parameter is dangerous to use, since the component hasn't been added to the entity yet", - "start": 3509, - "end": 3615, + "start": 3397, + "end": 3503, "loc": { "start": { - "line": 126, + "line": 121, "column": 3 }, "end": { - "line": 126, + "line": 121, "column": 109 } } @@ -11288,15 +10894,15 @@ { "type": "CommentLine", "value": " Use first argument as component value", - "start": 3729, - "end": 3769, + "start": 3617, + "end": 3657, "loc": { "start": { - "line": 129, + "line": 124, "column": 3 }, "end": { - "line": 129, + "line": 124, "column": 43 } } @@ -11304,15 +10910,15 @@ { "type": "CommentLine", "value": " Make an empty object", - "start": 3818, - "end": 3841, + "start": 3706, + "end": 3729, "loc": { "start": { - "line": 132, + "line": 127, "column": 3 }, "end": { - "line": 132, + "line": 127, "column": 26 } } @@ -11320,15 +10926,15 @@ { "type": "CommentLine", "value": " Update the index with this new component", - "start": 3878, - "end": 3921, + "start": 3766, + "end": 3809, "loc": { "start": { - "line": 136, + "line": 131, "column": 2 }, "end": { - "line": 136, + "line": 131, "column": 45 } } @@ -11336,15 +10942,15 @@ { "type": "CommentLine", "value": " Call custom onCreate to initialize component, pass the entity (this), and any additional arguments passed into set()", - "start": 3992, - "end": 4111, + "start": 3880, + "end": 3999, "loc": { "start": { - "line": 141, + "line": 136, "column": 2 }, "end": { - "line": 141, + "line": 136, "column": 121 } } @@ -11352,15 +10958,15 @@ { "type": "CommentBlock", "value": "*\n\t * Updates component data from an object or other component. Similar to access() with a shallow merge applied after.\n\t *\n\t * @example\n\t * entity.update('position', { x: 1, y: 2 })\n\t *\n\t * @param {string} component - The component name to update\n\t * @param {Object} data - The object or other component to merge into the specified component.\n\t *\n\t * @return {Object} The original entity that update() was called on, so that operations can be chained.\n\t ", - "start": 4190, - "end": 4654, + "start": 4078, + "end": 4542, "loc": { "start": { - "line": 147, + "line": 142, "column": 1 }, "end": { - "line": 157, + "line": 152, "column": 4 } } @@ -11368,15 +10974,15 @@ { "type": "CommentLine", "value": " Shallow set keys of the component", - "start": 4721, - "end": 4757, + "start": 4609, + "end": 4645, "loc": { "start": { - "line": 161, + "line": 156, "column": 2 }, "end": { - "line": 161, + "line": 156, "column": 38 } } @@ -11384,15 +10990,15 @@ { "type": "CommentBlock", "value": "*\n\t * Removes a component from the entity - has no effect when it doesn't exist.\n\t * Can specify an onRemove() method in your component which gets called before it is removed.\n\t * If nothing is specified, then nothing will be removed. Use removeAll() to remove all components.\n\t *\n\t * @example\n\t * entity.remove('position')\n\t *\n\t * @param {...string} [components] - The component names to remove from the entity.\n\t *\n\t * @return {Object} The original entity that remove() was called on, so that operations can be chained.\n\t ", - "start": 4833, - "end": 5361, + "start": 4721, + "end": 5249, "loc": { "start": { - "line": 169, + "line": 164, "column": 1 }, "end": { - "line": 180, + "line": 175, "column": 4 } } @@ -11400,15 +11006,15 @@ { "type": "CommentLine", "value": " Call custom onRemove", - "start": 5463, - "end": 5486, + "start": 5351, + "end": 5374, "loc": { "start": { - "line": 185, + "line": 180, "column": 4 }, "end": { - "line": 185, + "line": 180, "column": 27 } } @@ -11416,15 +11022,15 @@ { "type": "CommentLine", "value": " Remove from index", - "start": 5537, - "end": 5557, + "start": 5425, + "end": 5445, "loc": { "start": { - "line": 188, + "line": 183, "column": 4 }, "end": { - "line": 188, + "line": 183, "column": 24 } } @@ -11432,15 +11038,15 @@ { "type": "CommentLine", "value": " Remove from entity", - "start": 5639, - "end": 5660, + "start": 5527, + "end": 5548, "loc": { "start": { - "line": 193, + "line": 188, "column": 4 }, "end": { - "line": 193, + "line": 188, "column": 25 } } @@ -11448,15 +11054,15 @@ { "type": "CommentLine", "value": " Remove all components", - "start": 5721, - "end": 5745, + "start": 5609, + "end": 5633, "loc": { "start": { - "line": 200, + "line": 195, "column": 1 }, "end": { - "line": 200, + "line": 195, "column": 25 } } @@ -11464,15 +11070,15 @@ { "type": "CommentBlock", "value": "*\n\t * Removes all components from the entity.\n\t *\n\t * @example\n\t * entity.removeAll()\n\t *\n\t * @return {Object} The original entity that removeAll() was called on, so that operations can be chained.\n\t ", - "start": 5748, - "end": 5952, + "start": 5636, + "end": 5840, "loc": { "start": { - "line": 202, + "line": 197, "column": 1 }, "end": { - "line": 209, + "line": 204, "column": 4 } } @@ -11480,47 +11086,31 @@ { "type": "CommentBlock", "value": "*\n\t * Remove this entity and all of its components from the world. After an entity is destroyed, the object should be discarded,\n\t * and it is recommended to avoid re-using it.\n\t *\n\t * @example\n\t * entity.destroy()\n\t ", - "start": 6174, - "end": 6395, + "start": 6062, + "end": 6283, "loc": { "start": { - "line": 220, + "line": 215, "column": 1 }, "end": { - "line": 226, + "line": 221, "column": 4 } } }, - { - "type": "CommentLine", - "value": " Remove entity from the index, to update match all index", - "start": 6454, - "end": 6512, - "loc": { - "start": { - "line": 231, - "column": 3 - }, - "end": { - "line": 231, - "column": 61 - } - } - }, { "type": "CommentLine", "value": " Remove from world", - "start": 6556, - "end": 6576, + "start": 6342, + "end": 6362, "loc": { "start": { - "line": 234, + "line": 226, "column": 3 }, "end": { - "line": 234, + "line": 226, "column": 23 } } @@ -11528,15 +11118,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns an array of component names this entity currently has.\n\t *\n\t * @return {Array} Array of component names.\n\t ", - "start": 6650, - "end": 6783, + "start": 6436, + "end": 6569, "loc": { "start": { - "line": 240, + "line": 232, "column": 1 }, "end": { - "line": 244, + "line": 236, "column": 4 } } @@ -11544,15 +11134,15 @@ { "type": "CommentBlock", "value": "* @ignore ", - "start": 6841, - "end": 6855, + "start": 6627, + "end": 6641, "loc": { "start": { - "line": 249, + "line": 241, "column": 1 }, "end": { - "line": 249, + "line": 241, "column": 15 } } @@ -11560,15 +11150,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns true if this is a valid, existing, and usable entity, which is attached to a world.\n\t *\n\t * @example\n\t * if (entity.valid()) {...}\n\t *\n\t * @return {boolean} true or false\n\t ", - "start": 6956, - "end": 7147, + "start": 6742, + "end": 6933, "loc": { "start": { - "line": 254, + "line": 246, "column": 1 }, "end": { - "line": 261, + "line": 253, "column": 4 } } @@ -11576,15 +11166,15 @@ { "type": "CommentLine", "value": " Note: No need to actually look in the world for the ID, if entities are only ever copied by reference.", - "start": 7161, - "end": 7266, + "start": 6947, + "end": 7052, "loc": { "start": { - "line": 263, + "line": 255, "column": 2 }, "end": { - "line": 263, + "line": 255, "column": 107 } } @@ -11592,15 +11182,15 @@ { "type": "CommentLine", "value": " If entities are ever deep/shallow copied, this function will need to check this to be more robust.", - "start": 7269, - "end": 7370, + "start": 7055, + "end": 7156, "loc": { "start": { - "line": 264, + "line": 256, "column": 2 }, "end": { - "line": 264, + "line": 256, "column": 103 } } @@ -11608,15 +11198,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns unique entity ID as a string.\n\t *\n\t * @example\n\t * let entityId = entity.toString()\n\t *\n\t * @return {string} String representation of the entity ID.\n\t ", - "start": 7422, - "end": 7591, + "start": 7208, + "end": 7377, "loc": { "start": { - "line": 268, + "line": 260, "column": 1 }, "end": { - "line": 275, + "line": 267, "column": 4 } } @@ -11624,15 +11214,15 @@ { "type": "CommentBlock", "value": "*\n\t * Serializes entire entity and components to JSON.\n\t * Note: Defining toJSON methods in your components will override the built-in behavior.\n\t *\n\t * @example\n\t * let serializedEntity = entity.toJSON()\n\t *\n\t * @return {string} JSON encoded string\n\t ", - "start": 7637, - "end": 7893, + "start": 7423, + "end": 7679, "loc": { "start": { - "line": 280, + "line": 272, "column": 1 }, "end": { - "line": 288, + "line": 280, "column": 4 } } @@ -11640,15 +11230,15 @@ { "type": "CommentBlock", "value": "*\n\t * Deserializes data from JSON, creating new components and overwriting existing components.\n\t * Note: Defining fromJSON methods in your components will override the built-in behavior.\n\t *\n\t * @example\n\t * entity.fromJSON(serializedEntity)\n\t *\n\t * @param {string} data - A JSON string containing component data to parse, and store in this entity.\n\t *\n\t * @return {Object} The original entity that fromJSON() was called on, so that operations can be chained.\n\t ", - "start": 7946, - "end": 8413, + "start": 7732, + "end": 8199, "loc": { "start": { - "line": 293, + "line": 285, "column": 1 }, "end": { - "line": 303, + "line": 295, "column": 4 } } @@ -11656,15 +11246,15 @@ { "type": "CommentLine", "value": " Either call custom method or copy all properties", - "start": 8529, - "end": 8580, + "start": 8315, + "end": 8366, "loc": { "start": { - "line": 309, + "line": 301, "column": 3 }, "end": { - "line": 309, + "line": 301, "column": 54 } } @@ -11672,15 +11262,15 @@ { "type": "CommentBlock", "value": "*\n\t * Attaches a currently detached entity back to a world.\n\t * Note: Do not use detached entities, get() may be safe, but avoid calling other methods\n\t * Note: The ID will be reassigned, so do not rely on this\n\t *\n\t * @example\n\t * entity.attach(world)\n\t *\n\t * @param {World} world - The world to attach this entity to\n\t ", - "start": 8735, - "end": 9060, + "start": 8521, + "end": 8846, "loc": { "start": { - "line": 319, + "line": 311, "column": 1 }, "end": { - "line": 328, + "line": 320, "column": 4 } } @@ -11688,15 +11278,15 @@ { "type": "CommentLine", "value": " Assign new id, and reattach to world", - "start": 9113, - "end": 9152, + "start": 8899, + "end": 8938, "loc": { "start": { - "line": 331, + "line": 323, "column": 3 }, "end": { - "line": 331, + "line": 323, "column": 42 } } @@ -11704,15 +11294,15 @@ { "type": "CommentBlock", "value": "*\n\t * Removes this entity from the current world, without removing any components or data.\n\t * It can be re-attached to another world (or the same world), using the attach() method.\n\t * Note: Do not use detached entities, get() may be safe, but avoid calling other methods\n\t * Note: The ID will be reassigned, so do not rely on this\n\t *\n\t * @example\n\t * entity.detach()\n\t ", - "start": 9300, - "end": 9676, + "start": 9100, + "end": 9476, "loc": { "start": { - "line": 339, + "line": 331, "column": 1 }, "end": { - "line": 347, + "line": 339, "column": 4 } } @@ -11720,15 +11310,15 @@ { "type": "CommentLine", "value": " Remove from current world", - "start": 9714, - "end": 9742, + "start": 9514, + "end": 9542, "loc": { "start": { - "line": 350, + "line": 342, "column": 3 }, "end": { - "line": 350, + "line": 342, "column": 31 } } @@ -12746,26 +12336,9 @@ } } }, - { - "type": "CommentLine", - "value": " Add to the index, to update match all index", - "start": 573, - "end": 619, - "loc": { - "start": { - "line": 29, - "column": 2 - }, - "end": { - "line": 29, - "column": 48 - } - } - }, { "type": { - "label": "if", - "keyword": "if", + "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -12773,27 +12346,41 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "value": "if", - "start": 622, - "end": 624, + "start": 571, + "end": 572, "loc": { "start": { - "line": 30, - "column": 2 + "line": 28, + "column": 1 }, "end": { + "line": 28, + "column": 2 + } + } + }, + { + "type": "CommentBlock", + "value": "*\n\t * Return the entity ID.\n\t *\n\t * @return {number} Integer entity ID\n\t ", + "start": 575, + "end": 652, + "loc": { + "start": { "line": 30, + "column": 1 + }, + "end": { + "line": 34, "column": 4 } } }, { "type": { - "label": "(", - "beforeExpr": true, + "label": "name", + "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -12802,23 +12389,23 @@ "postfix": false, "binop": null }, - "start": 625, - "end": 626, + "value": "get", + "start": 654, + "end": 657, "loc": { "start": { - "line": 30, - "column": 5 + "line": 35, + "column": 1 }, "end": { - "line": 30, - "column": 6 + "line": 35, + "column": 4 } } }, { "type": { - "label": "this", - "keyword": "this", + "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, @@ -12826,54 +12413,52 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "value": "this", - "start": 626, - "end": 630, + "value": "id", + "start": 658, + "end": 660, "loc": { "start": { - "line": 30, - "column": 6 + "line": 35, + "column": 5 }, "end": { - "line": 30, - "column": 10 + "line": 35, + "column": 7 } } }, { "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, + "label": "(", + "beforeExpr": true, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 630, - "end": 631, + "start": 660, + "end": 661, "loc": { "start": { - "line": 30, - "column": 10 + "line": 35, + "column": 7 }, "end": { - "line": 30, - "column": 11 + "line": 35, + "column": 8 } } }, { "type": { - "label": "name", + "label": ")", "beforeExpr": false, - "startsExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -12881,23 +12466,22 @@ "postfix": false, "binop": null }, - "value": "valid", - "start": 631, - "end": 636, + "start": 661, + "end": 662, "loc": { "start": { - "line": 30, - "column": 11 + "line": 35, + "column": 8 }, "end": { - "line": 30, - "column": 16 + "line": 35, + "column": 9 } } }, { "type": { - "label": "(", + "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, @@ -12907,22 +12491,78 @@ "postfix": false, "binop": null }, - "start": 636, - "end": 637, + "start": 663, + "end": 664, "loc": { "start": { - "line": 30, - "column": 16 + "line": 35, + "column": 10 }, "end": { - "line": 30, - "column": 17 + "line": 35, + "column": 11 } } }, { "type": { - "label": ")", + "label": "return", + "keyword": "return", + "beforeExpr": true, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "value": "return", + "start": 667, + "end": 673, + "loc": { + "start": { + "line": 36, + "column": 2 + }, + "end": { + "line": 36, + "column": 8 + } + } + }, + { + "type": { + "label": "this", + "keyword": "this", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "value": "this", + "start": 674, + "end": 678, + "loc": { + "start": { + "line": 36, + "column": 9 + }, + "end": { + "line": 36, + "column": 13 + } + } + }, + { + "type": { + "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -12930,24 +12570,51 @@ "isAssign": false, "prefix": false, "postfix": false, + "binop": null, + "updateContext": null + }, + "start": 678, + "end": 679, + "loc": { + "start": { + "line": 36, + "column": 13 + }, + "end": { + "line": 36, + "column": 14 + } + } + }, + { + "type": { + "label": "name", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, "binop": null }, - "start": 637, - "end": 638, + "value": "_id", + "start": 679, + "end": 682, "loc": { "start": { - "line": 30, - "column": 17 + "line": 36, + "column": 14 }, "end": { - "line": 30, - "column": 18 + "line": 36, + "column": 17 } } }, { "type": { - "label": ")", + "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -12957,23 +12624,39 @@ "postfix": false, "binop": null }, - "start": 638, - "end": 639, + "start": 684, + "end": 685, "loc": { "start": { - "line": 30, - "column": 18 + "line": 37, + "column": 1 }, "end": { - "line": 30, - "column": 19 + "line": 37, + "column": 2 + } + } + }, + { + "type": "CommentBlock", + "value": "*\n\t * ID is read-only, attempting to set it will throw an error.\n\t *\n\t * @private\n\t *\n\t * @throws {Error} Cannot set entity id\n\t ", + "start": 688, + "end": 821, + "loc": { + "start": { + "line": 39, + "column": 1 + }, + "end": { + "line": 45, + "column": 4 } } }, { "type": { - "label": "{", - "beforeExpr": true, + "label": "name", + "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -12982,23 +12665,23 @@ "postfix": false, "binop": null }, - "start": 640, - "end": 641, + "value": "set", + "start": 823, + "end": 826, "loc": { "start": { - "line": 30, - "column": 20 + "line": 46, + "column": 1 }, "end": { - "line": 30, - "column": 21 + "line": 46, + "column": 4 } } }, { "type": { - "label": "this", - "keyword": "this", + "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, @@ -13006,45 +12689,43 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "value": "this", - "start": 645, - "end": 649, + "value": "id", + "start": 827, + "end": 829, "loc": { "start": { - "line": 31, - "column": 3 + "line": 46, + "column": 5 }, "end": { - "line": 31, + "line": 46, "column": 7 } } }, { "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, + "label": "(", + "beforeExpr": true, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 649, - "end": 650, + "start": 829, + "end": 830, "loc": { "start": { - "line": 31, + "line": 46, "column": 7 }, "end": { - "line": 31, + "line": 46, "column": 8 } } @@ -13061,23 +12742,23 @@ "postfix": false, "binop": null }, - "value": "world", - "start": 650, - "end": 655, + "value": "id", + "start": 830, + "end": 832, "loc": { "start": { - "line": 31, + "line": 46, "column": 8 }, "end": { - "line": 31, - "column": 13 + "line": 46, + "column": 10 } } }, { "type": { - "label": ".", + "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -13085,26 +12766,25 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 655, - "end": 656, + "start": 832, + "end": 833, "loc": { "start": { - "line": 31, - "column": 13 + "line": 46, + "column": 10 }, "end": { - "line": 31, - "column": 14 + "line": 46, + "column": 11 } } }, { "type": { - "label": "name", - "beforeExpr": false, + "label": "{", + "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -13113,24 +12793,24 @@ "postfix": false, "binop": null }, - "value": "index", - "start": 656, - "end": 661, + "start": 834, + "end": 835, "loc": { "start": { - "line": 31, - "column": 14 + "line": 46, + "column": 12 }, "end": { - "line": 31, - "column": 19 + "line": 46, + "column": 13 } } }, { "type": { - "label": ".", - "beforeExpr": false, + "label": "throw", + "keyword": "throw", + "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, @@ -13140,49 +12820,52 @@ "binop": null, "updateContext": null }, - "start": 661, - "end": 662, + "value": "throw", + "start": 838, + "end": 843, "loc": { "start": { - "line": 31, - "column": 19 + "line": 47, + "column": 2 }, "end": { - "line": 31, - "column": 20 + "line": 47, + "column": 7 } } }, { "type": { - "label": "name", - "beforeExpr": false, + "label": "new", + "keyword": "new", + "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "value": "addEntity", - "start": 662, - "end": 671, + "value": "new", + "start": 844, + "end": 847, "loc": { "start": { - "line": 31, - "column": 20 + "line": 47, + "column": 8 }, "end": { - "line": 31, - "column": 29 + "line": 47, + "column": 11 } } }, { "type": { - "label": "(", - "beforeExpr": true, + "label": "name", + "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -13191,75 +12874,75 @@ "postfix": false, "binop": null }, - "start": 671, - "end": 672, + "value": "Error", + "start": 848, + "end": 853, "loc": { "start": { - "line": 31, - "column": 29 + "line": 47, + "column": 12 }, "end": { - "line": 31, - "column": 30 + "line": 47, + "column": 17 } } }, { "type": { - "label": "this", - "keyword": "this", - "beforeExpr": false, + "label": "(", + "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "value": "this", - "start": 672, - "end": 676, + "start": 853, + "end": 854, "loc": { "start": { - "line": 31, - "column": 30 + "line": 47, + "column": 17 }, "end": { - "line": 31, - "column": 34 + "line": 47, + "column": 18 } } }, { "type": { - "label": ")", + "label": "string", "beforeExpr": false, - "startsExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 676, - "end": 677, + "value": "Cannot set entity id", + "start": 854, + "end": 876, "loc": { "start": { - "line": 31, - "column": 34 + "line": 47, + "column": 18 }, "end": { - "line": 31, - "column": 35 + "line": 47, + "column": 40 } } }, { "type": { - "label": "}", + "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -13269,16 +12952,16 @@ "postfix": false, "binop": null }, - "start": 680, - "end": 681, + "start": 876, + "end": 877, "loc": { "start": { - "line": 32, - "column": 2 + "line": 47, + "column": 40 }, "end": { - "line": 32, - "column": 3 + "line": 47, + "column": 41 } } }, @@ -13294,31 +12977,31 @@ "postfix": false, "binop": null }, - "start": 683, - "end": 684, + "start": 879, + "end": 880, "loc": { "start": { - "line": 33, + "line": 48, "column": 1 }, "end": { - "line": 33, + "line": 48, "column": 2 } } }, { "type": "CommentBlock", - "value": "*\n\t * Return the entity ID.\n\t *\n\t * @return {number} Integer entity ID\n\t ", - "start": 687, - "end": 764, + "value": "*\n\t * Returns true if the entity has ALL of the specified component names.\n\t * Additional components that the entity has, which are not specified in has(), will be ignored.\n\t * If no component names are specified, this method returns true.\n\t *\n\t * @example\n\t * if (entity.has('position', 'velocity')) {...}\n\t *\n\t * @param {...string} [components] - The component names to check for\n\t *\n\t * @return {boolean} true or false\n\t ", + "start": 883, + "end": 1311, "loc": { "start": { - "line": 35, + "line": 50, "column": 1 }, "end": { - "line": 39, + "line": 61, "column": 4 } } @@ -13335,24 +13018,24 @@ "postfix": false, "binop": null }, - "value": "get", - "start": 766, - "end": 769, + "value": "has", + "start": 1313, + "end": 1316, "loc": { "start": { - "line": 40, + "line": 62, "column": 1 }, "end": { - "line": 40, + "line": 62, "column": 4 } } }, { "type": { - "label": "name", - "beforeExpr": false, + "label": "(", + "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -13361,50 +13044,50 @@ "postfix": false, "binop": null }, - "value": "id", - "start": 770, - "end": 772, + "start": 1316, + "end": 1317, "loc": { "start": { - "line": 40, - "column": 5 + "line": 62, + "column": 4 }, "end": { - "line": 40, - "column": 7 + "line": 62, + "column": 5 } } }, { "type": { - "label": "(", + "label": "...", "beforeExpr": true, - "startsExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 772, - "end": 773, + "start": 1317, + "end": 1320, "loc": { "start": { - "line": 40, - "column": 7 + "line": 62, + "column": 5 }, "end": { - "line": 40, + "line": 62, "column": 8 } } }, { "type": { - "label": ")", + "label": "name", "beforeExpr": false, - "startsExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -13412,24 +13095,25 @@ "postfix": false, "binop": null }, - "start": 773, - "end": 774, + "value": "components", + "start": 1320, + "end": 1330, "loc": { "start": { - "line": 40, + "line": 62, "column": 8 }, "end": { - "line": 40, - "column": 9 + "line": 62, + "column": 18 } } }, { "type": { - "label": "{", - "beforeExpr": true, - "startsExpr": true, + "label": ")", + "beforeExpr": false, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -13437,79 +13121,49 @@ "postfix": false, "binop": null }, - "start": 775, - "end": 776, + "start": 1330, + "end": 1331, "loc": { "start": { - "line": 40, - "column": 10 + "line": 62, + "column": 18 }, "end": { - "line": 40, - "column": 11 + "line": 62, + "column": 19 } } }, { "type": { - "label": "return", - "keyword": "return", + "label": "{", "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "return", - "start": 779, - "end": 785, - "loc": { - "start": { - "line": 41, - "column": 2 - }, - "end": { - "line": 41, - "column": 8 - } - } - }, - { - "type": { - "label": "this", - "keyword": "this", - "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "value": "this", - "start": 786, - "end": 790, + "start": 1332, + "end": 1333, "loc": { "start": { - "line": 41, - "column": 9 + "line": 62, + "column": 20 }, "end": { - "line": 41, - "column": 13 + "line": 62, + "column": 21 } } }, { "type": { - "label": ".", - "beforeExpr": false, + "label": "return", + "keyword": "return", + "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, @@ -13519,16 +13173,17 @@ "binop": null, "updateContext": null }, - "start": 790, - "end": 791, + "value": "return", + "start": 1336, + "end": 1342, "loc": { "start": { - "line": 41, - "column": 13 + "line": 63, + "column": 2 }, "end": { - "line": 41, - "column": 14 + "line": 63, + "column": 8 } } }, @@ -13544,23 +13199,23 @@ "postfix": false, "binop": null }, - "value": "_id", - "start": 791, - "end": 794, + "value": "components", + "start": 1343, + "end": 1353, "loc": { "start": { - "line": 41, - "column": 14 + "line": 63, + "column": 9 }, "end": { - "line": 41, - "column": 17 + "line": 63, + "column": 19 } } }, { "type": { - "label": "}", + "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -13568,60 +13223,19 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null - }, - "start": 796, - "end": 797, - "loc": { - "start": { - "line": 42, - "column": 1 - }, - "end": { - "line": 42, - "column": 2 - } - } - }, - { - "type": "CommentBlock", - "value": "*\n\t * ID is read-only, attempting to set it will throw an error.\n\t *\n\t * @private\n\t *\n\t * @throws {Error} Cannot set entity id\n\t ", - "start": 800, - "end": 933, - "loc": { - "start": { - "line": 44, - "column": 1 - }, - "end": { - "line": 50, - "column": 4 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "value": "set", - "start": 935, - "end": 938, + "start": 1353, + "end": 1354, "loc": { "start": { - "line": 51, - "column": 1 + "line": 63, + "column": 19 }, "end": { - "line": 51, - "column": 4 + "line": 63, + "column": 20 } } }, @@ -13637,17 +13251,17 @@ "postfix": false, "binop": null }, - "value": "id", - "start": 939, - "end": 941, + "value": "every", + "start": 1354, + "end": 1359, "loc": { "start": { - "line": 51, - "column": 5 + "line": 63, + "column": 20 }, "end": { - "line": 51, - "column": 7 + "line": 63, + "column": 25 } } }, @@ -13663,16 +13277,16 @@ "postfix": false, "binop": null }, - "start": 941, - "end": 942, + "start": 1359, + "end": 1360, "loc": { "start": { - "line": 51, - "column": 7 + "line": 63, + "column": 25 }, "end": { - "line": 51, - "column": 8 + "line": 63, + "column": 26 } } }, @@ -13688,49 +13302,50 @@ "postfix": false, "binop": null }, - "value": "id", - "start": 942, - "end": 944, + "value": "name", + "start": 1360, + "end": 1364, "loc": { "start": { - "line": 51, - "column": 8 + "line": 63, + "column": 26 }, "end": { - "line": 51, - "column": 10 + "line": 63, + "column": 30 } } }, { "type": { - "label": ")", - "beforeExpr": false, + "label": "=>", + "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 944, - "end": 945, + "start": 1365, + "end": 1367, "loc": { "start": { - "line": 51, - "column": 10 + "line": 63, + "column": 31 }, "end": { - "line": 51, - "column": 11 + "line": 63, + "column": 33 } } }, { "type": { - "label": "{", - "beforeExpr": true, + "label": "name", + "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -13739,23 +13354,24 @@ "postfix": false, "binop": null }, - "start": 946, - "end": 947, + "value": "name", + "start": 1368, + "end": 1372, "loc": { "start": { - "line": 51, - "column": 12 + "line": 63, + "column": 34 }, "end": { - "line": 51, - "column": 13 + "line": 63, + "column": 38 } } }, { "type": { - "label": "throw", - "keyword": "throw", + "label": "in", + "keyword": "in", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, @@ -13763,28 +13379,28 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, + "binop": 7, "updateContext": null }, - "value": "throw", - "start": 950, - "end": 955, + "value": "in", + "start": 1373, + "end": 1375, "loc": { "start": { - "line": 52, - "column": 2 + "line": 63, + "column": 39 }, "end": { - "line": 52, - "column": 7 + "line": 63, + "column": 41 } } }, { "type": { - "label": "new", - "keyword": "new", - "beforeExpr": true, + "label": "this", + "keyword": "this", + "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -13794,74 +13410,49 @@ "binop": null, "updateContext": null }, - "value": "new", - "start": 956, - "end": 959, + "value": "this", + "start": 1376, + "end": 1380, "loc": { "start": { - "line": 52, - "column": 8 + "line": 63, + "column": 42 }, "end": { - "line": 52, - "column": 11 + "line": 63, + "column": 46 } } }, { "type": { - "label": "name", + "label": ".", "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "Error", - "start": 960, - "end": 965, - "loc": { - "start": { - "line": 52, - "column": 12 - }, - "end": { - "line": 52, - "column": 17 - } - } - }, - { - "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 965, - "end": 966, + "start": 1380, + "end": 1381, "loc": { "start": { - "line": 52, - "column": 17 + "line": 63, + "column": 46 }, "end": { - "line": 52, - "column": 18 + "line": 63, + "column": 47 } } }, { "type": { - "label": "string", + "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, @@ -13869,20 +13460,19 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "value": "Cannot set entity id", - "start": 966, - "end": 988, + "value": "data", + "start": 1381, + "end": 1385, "loc": { "start": { - "line": 52, - "column": 18 + "line": 63, + "column": 47 }, "end": { - "line": 52, - "column": 40 + "line": 63, + "column": 51 } } }, @@ -13898,16 +13488,16 @@ "postfix": false, "binop": null }, - "start": 988, - "end": 989, + "start": 1385, + "end": 1386, "loc": { "start": { - "line": 52, - "column": 40 + "line": 63, + "column": 51 }, "end": { - "line": 52, - "column": 41 + "line": 63, + "column": 52 } } }, @@ -13923,31 +13513,31 @@ "postfix": false, "binop": null }, - "start": 991, - "end": 992, + "start": 1388, + "end": 1389, "loc": { "start": { - "line": 53, + "line": 64, "column": 1 }, "end": { - "line": 53, + "line": 64, "column": 2 } } }, { "type": "CommentBlock", - "value": "*\n\t * Returns true if the entity has ALL of the specified component names.\n\t * Additional components that the entity has, which are not specified in has(), will be ignored.\n\t * If no component names are specified, this method returns true.\n\t *\n\t * @example\n\t * if (entity.has('position', 'velocity')) {...}\n\t *\n\t * @param {...string} [components] - The component names to check for\n\t *\n\t * @return {boolean} true or false\n\t ", - "start": 995, - "end": 1423, + "value": "*\n\t * Returns a component by name, or undefined if it doesn't exist\n\t *\n\t * @example\n\t * let position = entity.get('position')\n\t *\n\t * @param {string} component - The component name to get\n\t *\n\t * @return {Object} The component if defined, otherwise undefined\n\t ", + "start": 1392, + "end": 1658, "loc": { "start": { - "line": 55, + "line": 66, "column": 1 }, "end": { - "line": 66, + "line": 75, "column": 4 } } @@ -13964,16 +13554,16 @@ "postfix": false, "binop": null }, - "value": "has", - "start": 1425, - "end": 1428, + "value": "get", + "start": 1660, + "end": 1663, "loc": { "start": { - "line": 67, + "line": 76, "column": 1 }, "end": { - "line": 67, + "line": 76, "column": 4 } } @@ -13990,42 +13580,16 @@ "postfix": false, "binop": null }, - "start": 1428, - "end": 1429, + "start": 1663, + "end": 1664, "loc": { "start": { - "line": 67, + "line": 76, "column": 4 }, "end": { - "line": 67, - "column": 5 - } - } - }, - { - "type": { - "label": "...", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 1429, - "end": 1432, - "loc": { - "start": { - "line": 67, + "line": 76, "column": 5 - }, - "end": { - "line": 67, - "column": 8 } } }, @@ -14041,17 +13605,17 @@ "postfix": false, "binop": null }, - "value": "components", - "start": 1432, - "end": 1442, + "value": "component", + "start": 1664, + "end": 1673, "loc": { "start": { - "line": 67, - "column": 8 + "line": 76, + "column": 5 }, "end": { - "line": 67, - "column": 18 + "line": 76, + "column": 14 } } }, @@ -14067,16 +13631,16 @@ "postfix": false, "binop": null }, - "start": 1442, - "end": 1443, + "start": 1673, + "end": 1674, "loc": { "start": { - "line": 67, - "column": 18 + "line": 76, + "column": 14 }, "end": { - "line": 67, - "column": 19 + "line": 76, + "column": 15 } } }, @@ -14092,16 +13656,16 @@ "postfix": false, "binop": null }, - "start": 1444, - "end": 1445, + "start": 1675, + "end": 1676, "loc": { "start": { - "line": 67, - "column": 20 + "line": 76, + "column": 16 }, "end": { - "line": 67, - "column": 21 + "line": 76, + "column": 17 } } }, @@ -14120,22 +13684,23 @@ "updateContext": null }, "value": "return", - "start": 1448, - "end": 1454, + "start": 1679, + "end": 1685, "loc": { "start": { - "line": 68, + "line": 77, "column": 2 }, "end": { - "line": 68, + "line": 77, "column": 8 } } }, { "type": { - "label": "name", + "label": "this", + "keyword": "this", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, @@ -14143,19 +13708,20 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "value": "components", - "start": 1455, - "end": 1465, + "value": "this", + "start": 1686, + "end": 1690, "loc": { "start": { - "line": 68, + "line": 77, "column": 9 }, "end": { - "line": 68, - "column": 19 + "line": 77, + "column": 13 } } }, @@ -14172,16 +13738,16 @@ "binop": null, "updateContext": null }, - "start": 1465, - "end": 1466, + "start": 1690, + "end": 1691, "loc": { "start": { - "line": 68, - "column": 19 + "line": 77, + "column": 13 }, "end": { - "line": 68, - "column": 20 + "line": 77, + "column": 14 } } }, @@ -14197,23 +13763,23 @@ "postfix": false, "binop": null }, - "value": "every", - "start": 1466, - "end": 1471, + "value": "data", + "start": 1691, + "end": 1695, "loc": { "start": { - "line": 68, - "column": 20 + "line": 77, + "column": 14 }, "end": { - "line": 68, - "column": 25 + "line": 77, + "column": 18 } } }, { "type": { - "label": "(", + "label": "[", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, @@ -14221,18 +13787,19 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 1471, - "end": 1472, + "start": 1695, + "end": 1696, "loc": { "start": { - "line": 68, - "column": 25 + "line": 77, + "column": 18 }, "end": { - "line": 68, - "column": 26 + "line": 77, + "column": 19 } } }, @@ -14248,24 +13815,24 @@ "postfix": false, "binop": null }, - "value": "name", - "start": 1472, - "end": 1476, + "value": "component", + "start": 1696, + "end": 1705, "loc": { "start": { - "line": 68, - "column": 26 + "line": 77, + "column": 19 }, "end": { - "line": 68, - "column": 30 + "line": 77, + "column": 28 } } }, { "type": { - "label": "=>", - "beforeExpr": true, + "label": "]", + "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, @@ -14275,24 +13842,24 @@ "binop": null, "updateContext": null }, - "start": 1477, - "end": 1479, + "start": 1705, + "end": 1706, "loc": { "start": { - "line": 68, - "column": 31 + "line": 77, + "column": 28 }, "end": { - "line": 68, - "column": 33 + "line": 77, + "column": 29 } } }, { "type": { - "label": "name", + "label": "}", "beforeExpr": false, - "startsExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -14300,52 +13867,38 @@ "postfix": false, "binop": null }, - "value": "name", - "start": 1480, - "end": 1484, + "start": 1708, + "end": 1709, "loc": { "start": { - "line": 68, - "column": 34 + "line": 78, + "column": 1 }, "end": { - "line": 68, - "column": 38 + "line": 78, + "column": 2 } } }, { - "type": { - "label": "in", - "keyword": "in", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": 7, - "updateContext": null - }, - "value": "in", - "start": 1485, - "end": 1487, + "type": "CommentBlock", + "value": "*\n\t * Returns a component by name (automatically created if it doesn't exist)\n\t *\n\t * @example\n\t * let position = entity.access('position', 3, 4)\n\t *\n\t * @param {string} component - The component name to create/get\n\t * @param {...Object} [args] - The arguments to forward to create the new component, only if it doesn't exist.\n\t *\n\t * @return {Object} Always returns either the existing component, or the newly created one.\n\t ", + "start": 1712, + "end": 2148, "loc": { "start": { - "line": 68, - "column": 39 + "line": 80, + "column": 1 }, "end": { - "line": 68, - "column": 41 + "line": 90, + "column": 4 } } }, { "type": { - "label": "this", - "keyword": "this", + "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, @@ -14353,46 +13906,44 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "value": "this", - "start": 1488, - "end": 1492, + "value": "access", + "start": 2150, + "end": 2156, "loc": { "start": { - "line": 68, - "column": 42 + "line": 91, + "column": 1 }, "end": { - "line": 68, - "column": 46 + "line": 91, + "column": 7 } } }, { "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, + "label": "(", + "beforeExpr": true, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 1492, - "end": 1493, + "start": 2156, + "end": 2157, "loc": { "start": { - "line": 68, - "column": 46 + "line": 91, + "column": 7 }, "end": { - "line": 68, - "column": 47 + "line": 91, + "column": 8 } } }, @@ -14408,83 +13959,69 @@ "postfix": false, "binop": null }, - "value": "data", - "start": 1493, - "end": 1497, + "value": "component", + "start": 2157, + "end": 2166, "loc": { "start": { - "line": 68, - "column": 47 + "line": 91, + "column": 8 }, "end": { - "line": 68, - "column": 51 + "line": 91, + "column": 17 } } }, { "type": { - "label": ")", - "beforeExpr": false, + "label": ",", + "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 1497, - "end": 1498, + "start": 2166, + "end": 2167, "loc": { "start": { - "line": 68, - "column": 51 + "line": 91, + "column": 17 }, "end": { - "line": 68, - "column": 52 + "line": 91, + "column": 18 } } }, { "type": { - "label": "}", - "beforeExpr": false, + "label": "...", + "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 1500, - "end": 1501, - "loc": { - "start": { - "line": 69, - "column": 1 - }, - "end": { - "line": 69, - "column": 2 - } - } - }, - { - "type": "CommentBlock", - "value": "*\n\t * Returns a component by name, or undefined if it doesn't exist\n\t *\n\t * @example\n\t * let position = entity.get('position')\n\t *\n\t * @param {string} component - The component name to get\n\t *\n\t * @return {Object} The component if defined, otherwise undefined\n\t ", - "start": 1504, - "end": 1770, + "start": 2168, + "end": 2171, "loc": { "start": { - "line": 71, - "column": 1 + "line": 91, + "column": 19 }, "end": { - "line": 80, - "column": 4 + "line": 91, + "column": 22 } } }, @@ -14500,25 +14037,25 @@ "postfix": false, "binop": null }, - "value": "get", - "start": 1772, - "end": 1775, + "value": "args", + "start": 2171, + "end": 2175, "loc": { "start": { - "line": 81, - "column": 1 + "line": 91, + "column": 22 }, "end": { - "line": 81, - "column": 4 + "line": 91, + "column": 26 } } }, { "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, + "label": ")", + "beforeExpr": false, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -14526,23 +14063,23 @@ "postfix": false, "binop": null }, - "start": 1775, - "end": 1776, + "start": 2175, + "end": 2176, "loc": { "start": { - "line": 81, - "column": 4 + "line": 91, + "column": 26 }, "end": { - "line": 81, - "column": 5 + "line": 91, + "column": 27 } } }, { "type": { - "label": "name", - "beforeExpr": false, + "label": "{", + "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -14551,23 +14088,23 @@ "postfix": false, "binop": null }, - "value": "component", - "start": 1776, - "end": 1785, + "start": 2177, + "end": 2178, "loc": { "start": { - "line": 81, - "column": 5 + "line": 91, + "column": 28 }, "end": { - "line": 81, - "column": 14 + "line": 91, + "column": 29 } } }, { "type": { - "label": ")", + "label": "if", + "keyword": "if", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -14575,24 +14112,26 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 1785, - "end": 1786, + "value": "if", + "start": 2181, + "end": 2183, "loc": { "start": { - "line": 81, - "column": 14 + "line": 92, + "column": 2 }, "end": { - "line": 81, - "column": 15 + "line": 92, + "column": 4 } } }, { "type": { - "label": "{", + "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, @@ -14602,44 +14141,43 @@ "postfix": false, "binop": null }, - "start": 1787, - "end": 1788, + "start": 2184, + "end": 2185, "loc": { "start": { - "line": 81, - "column": 16 + "line": 92, + "column": 5 }, "end": { - "line": 81, - "column": 17 + "line": 92, + "column": 6 } } }, { "type": { - "label": "return", - "keyword": "return", + "label": "prefix", "beforeExpr": true, - "startsExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, - "prefix": false, + "prefix": true, "postfix": false, "binop": null, "updateContext": null }, - "value": "return", - "start": 1791, - "end": 1797, + "value": "!", + "start": 2185, + "end": 2186, "loc": { "start": { - "line": 82, - "column": 2 + "line": 92, + "column": 6 }, "end": { - "line": 82, - "column": 8 + "line": 92, + "column": 7 } } }, @@ -14658,16 +14196,16 @@ "updateContext": null }, "value": "this", - "start": 1798, - "end": 1802, + "start": 2186, + "end": 2190, "loc": { "start": { - "line": 82, - "column": 9 + "line": 92, + "column": 7 }, "end": { - "line": 82, - "column": 13 + "line": 92, + "column": 11 } } }, @@ -14684,16 +14222,16 @@ "binop": null, "updateContext": null }, - "start": 1802, - "end": 1803, + "start": 2190, + "end": 2191, "loc": { "start": { - "line": 82, - "column": 13 + "line": 92, + "column": 11 }, "end": { - "line": 82, - "column": 14 + "line": 92, + "column": 12 } } }, @@ -14709,23 +14247,23 @@ "postfix": false, "binop": null }, - "value": "data", - "start": 1803, - "end": 1807, + "value": "has", + "start": 2191, + "end": 2194, "loc": { "start": { - "line": 82, - "column": 14 + "line": 92, + "column": 12 }, "end": { - "line": 82, - "column": 18 + "line": 92, + "column": 15 } } }, { "type": { - "label": "[", + "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, @@ -14733,19 +14271,18 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 1807, - "end": 1808, + "start": 2194, + "end": 2195, "loc": { "start": { - "line": 82, - "column": 18 + "line": 92, + "column": 15 }, "end": { - "line": 82, - "column": 19 + "line": 92, + "column": 16 } } }, @@ -14762,22 +14299,22 @@ "binop": null }, "value": "component", - "start": 1808, - "end": 1817, + "start": 2195, + "end": 2204, "loc": { "start": { - "line": 82, - "column": 19 + "line": 92, + "column": 16 }, "end": { - "line": 82, - "column": 28 + "line": 92, + "column": 25 } } }, { "type": { - "label": "]", + "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -14785,25 +14322,24 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 1817, - "end": 1818, + "start": 2204, + "end": 2205, "loc": { "start": { - "line": 82, - "column": 28 + "line": 92, + "column": 25 }, "end": { - "line": 82, - "column": 29 + "line": 92, + "column": 26 } } }, { "type": { - "label": "}", + "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -14813,39 +14349,23 @@ "postfix": false, "binop": null }, - "start": 1820, - "end": 1821, - "loc": { - "start": { - "line": 83, - "column": 1 - }, - "end": { - "line": 83, - "column": 2 - } - } - }, - { - "type": "CommentBlock", - "value": "*\n\t * Returns a component by name (automatically created if it doesn't exist)\n\t *\n\t * @example\n\t * let position = entity.access('position', 3, 4)\n\t *\n\t * @param {string} component - The component name to create/get\n\t * @param {...Object} [args] - The arguments to forward to create the new component, only if it doesn't exist.\n\t *\n\t * @return {Object} Always returns either the existing component, or the newly created one.\n\t ", - "start": 1824, - "end": 2260, + "start": 2205, + "end": 2206, "loc": { "start": { - "line": 85, - "column": 1 + "line": 92, + "column": 26 }, "end": { - "line": 95, - "column": 4 + "line": 92, + "column": 27 } } }, { "type": { - "label": "name", - "beforeExpr": false, + "label": "{", + "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -14854,41 +14374,69 @@ "postfix": false, "binop": null }, - "value": "access", - "start": 2262, - "end": 2268, + "start": 2207, + "end": 2208, "loc": { "start": { - "line": 96, - "column": 1 + "line": 92, + "column": 28 }, "end": { - "line": 96, - "column": 7 + "line": 92, + "column": 29 } } }, { "type": { - "label": "(", - "beforeExpr": true, + "label": "this", + "keyword": "this", + "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 2268, - "end": 2269, + "value": "this", + "start": 2212, + "end": 2216, "loc": { "start": { - "line": 96, + "line": 93, + "column": 3 + }, + "end": { + "line": 93, + "column": 7 + } + } + }, + { + "type": { + "label": ".", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "start": 2216, + "end": 2217, + "loc": { + "start": { + "line": 93, "column": 7 }, "end": { - "line": 96, + "line": 93, "column": 8 } } @@ -14905,127 +14453,127 @@ "postfix": false, "binop": null }, - "value": "component", - "start": 2269, - "end": 2278, + "value": "set", + "start": 2217, + "end": 2220, "loc": { "start": { - "line": 96, + "line": 93, "column": 8 }, "end": { - "line": 96, - "column": 17 + "line": 93, + "column": 11 } } }, { "type": { - "label": ",", + "label": "(", "beforeExpr": true, - "startsExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 2278, - "end": 2279, + "start": 2220, + "end": 2221, "loc": { "start": { - "line": 96, - "column": 17 + "line": 93, + "column": 11 }, "end": { - "line": 96, - "column": 18 + "line": 93, + "column": 12 } } }, { "type": { - "label": "...", - "beforeExpr": true, - "startsExpr": false, + "label": "name", + "beforeExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 2280, - "end": 2283, + "value": "component", + "start": 2221, + "end": 2230, "loc": { "start": { - "line": 96, - "column": 19 + "line": 93, + "column": 12 }, "end": { - "line": 96, - "column": 22 + "line": 93, + "column": 21 } } }, { "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, + "label": ",", + "beforeExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "value": "args", - "start": 2283, - "end": 2287, + "start": 2230, + "end": 2231, "loc": { "start": { - "line": 96, - "column": 22 + "line": 93, + "column": 21 }, "end": { - "line": 96, - "column": 26 + "line": 93, + "column": 22 } } }, { "type": { - "label": ")", - "beforeExpr": false, + "label": "...", + "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 2287, - "end": 2288, + "start": 2232, + "end": 2235, "loc": { "start": { - "line": 96, - "column": 26 + "line": 93, + "column": 23 }, "end": { - "line": 96, - "column": 27 + "line": 93, + "column": 26 } } }, { "type": { - "label": "{", - "beforeExpr": true, + "label": "name", + "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -15034,23 +14582,23 @@ "postfix": false, "binop": null }, - "start": 2289, - "end": 2290, + "value": "args", + "start": 2235, + "end": 2239, "loc": { "start": { - "line": 96, - "column": 28 + "line": 93, + "column": 26 }, "end": { - "line": 96, - "column": 29 + "line": 93, + "column": 30 } } }, { "type": { - "label": "if", - "keyword": "if", + "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -15058,28 +14606,26 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "value": "if", - "start": 2293, - "end": 2295, + "start": 2239, + "end": 2240, "loc": { "start": { - "line": 97, - "column": 2 + "line": 93, + "column": 30 }, "end": { - "line": 97, - "column": 4 + "line": 93, + "column": 31 } } }, { "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, + "label": "}", + "beforeExpr": false, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -15087,43 +14633,44 @@ "postfix": false, "binop": null }, - "start": 2296, - "end": 2297, + "start": 2243, + "end": 2244, "loc": { "start": { - "line": 97, - "column": 5 + "line": 94, + "column": 2 }, "end": { - "line": 97, - "column": 6 + "line": 94, + "column": 3 } } }, { "type": { - "label": "prefix", + "label": "return", + "keyword": "return", "beforeExpr": true, - "startsExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, - "prefix": true, + "prefix": false, "postfix": false, "binop": null, "updateContext": null }, - "value": "!", - "start": 2297, - "end": 2298, + "value": "return", + "start": 2247, + "end": 2253, "loc": { "start": { - "line": 97, - "column": 6 + "line": 95, + "column": 2 }, "end": { - "line": 97, - "column": 7 + "line": 95, + "column": 8 } } }, @@ -15142,16 +14689,16 @@ "updateContext": null }, "value": "this", - "start": 2298, - "end": 2302, + "start": 2254, + "end": 2258, "loc": { "start": { - "line": 97, - "column": 7 + "line": 95, + "column": 9 }, "end": { - "line": 97, - "column": 11 + "line": 95, + "column": 13 } } }, @@ -15168,16 +14715,16 @@ "binop": null, "updateContext": null }, - "start": 2302, - "end": 2303, + "start": 2258, + "end": 2259, "loc": { "start": { - "line": 97, - "column": 11 + "line": 95, + "column": 13 }, "end": { - "line": 97, - "column": 12 + "line": 95, + "column": 14 } } }, @@ -15193,23 +14740,23 @@ "postfix": false, "binop": null }, - "value": "has", - "start": 2303, - "end": 2306, + "value": "data", + "start": 2259, + "end": 2263, "loc": { "start": { - "line": 97, - "column": 12 + "line": 95, + "column": 14 }, "end": { - "line": 97, - "column": 15 + "line": 95, + "column": 18 } } }, { "type": { - "label": "(", + "label": "[", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, @@ -15217,18 +14764,19 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 2306, - "end": 2307, + "start": 2263, + "end": 2264, "loc": { "start": { - "line": 97, - "column": 15 + "line": 95, + "column": 18 }, "end": { - "line": 97, - "column": 16 + "line": 95, + "column": 19 } } }, @@ -15245,22 +14793,22 @@ "binop": null }, "value": "component", - "start": 2307, - "end": 2316, + "start": 2264, + "end": 2273, "loc": { "start": { - "line": 97, - "column": 16 + "line": 95, + "column": 19 }, "end": { - "line": 97, - "column": 25 + "line": 95, + "column": 28 } } }, { "type": { - "label": ")", + "label": "]", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -15268,24 +14816,25 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 2316, - "end": 2317, + "start": 2273, + "end": 2274, "loc": { "start": { - "line": 97, - "column": 25 + "line": 95, + "column": 28 }, "end": { - "line": 97, - "column": 26 + "line": 95, + "column": 29 } } }, { "type": { - "label": ")", + "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -15295,48 +14844,38 @@ "postfix": false, "binop": null }, - "start": 2317, - "end": 2318, + "start": 2276, + "end": 2277, "loc": { "start": { - "line": 97, - "column": 26 + "line": 96, + "column": 1 }, "end": { - "line": 97, - "column": 27 + "line": 96, + "column": 2 } } }, { - "type": { - "label": "{", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 2319, - "end": 2320, + "type": "CommentBlock", + "value": "*\n\t * Adds a new component, or re-creates and overwrites an existing component\n\t *\n\t * @example\n\t * entity.set('position', 1, 2)\n\t *\n\t * @example\n\t * entity.set('anonymousComponent', { keys: 'values' })\n\t *\n\t * @example\n\t * entity.set('anotherAnonymousComponent', 'Any type of any value')\n\t *\n\t * @param {string} component - The component name to create. If there is a registered component for this name, then\n\t * its constructor will be called with (entity, ...args) and an object of that type will be created. The onCreate method\n\t * gets called after the component is added to the entity. This method also gets passed the same parameters.\n\t * @param {...Object} [args] - The arguments to forward to the registered component type. If the component type is\n\t * registered, then only the first additional argument will be used as the value of the entire component.\n\t *\n\t * @return {Object} The original entity that set() was called on, so that operations can be chained.\n\t ", + "start": 2280, + "end": 3263, "loc": { "start": { - "line": 97, - "column": 28 + "line": 98, + "column": 1 }, "end": { - "line": 97, - "column": 29 + "line": 117, + "column": 4 } } }, { "type": { - "label": "this", - "keyword": "this", + "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, @@ -15344,46 +14883,44 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "value": "this", - "start": 2324, - "end": 2328, + "value": "set", + "start": 3265, + "end": 3268, "loc": { "start": { - "line": 98, - "column": 3 + "line": 118, + "column": 1 }, "end": { - "line": 98, - "column": 7 + "line": 118, + "column": 4 } } }, { "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, + "label": "(", + "beforeExpr": true, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 2328, - "end": 2329, + "start": 3268, + "end": 3269, "loc": { "start": { - "line": 98, - "column": 7 + "line": 118, + "column": 4 }, "end": { - "line": 98, - "column": 8 + "line": 118, + "column": 5 } } }, @@ -15399,74 +14936,49 @@ "postfix": false, "binop": null }, - "value": "set", - "start": 2329, - "end": 2332, + "value": "component", + "start": 3269, + "end": 3278, "loc": { "start": { - "line": 98, - "column": 8 + "line": 118, + "column": 5 }, "end": { - "line": 98, - "column": 11 + "line": 118, + "column": 14 } } }, { "type": { - "label": "(", + "label": ",", "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 2332, - "end": 2333, - "loc": { - "start": { - "line": 98, - "column": 11 - }, - "end": { - "line": 98, - "column": 12 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "value": "component", - "start": 2333, - "end": 2342, + "start": 3278, + "end": 3279, "loc": { "start": { - "line": 98, - "column": 12 + "line": 118, + "column": 14 }, "end": { - "line": 98, - "column": 21 + "line": 118, + "column": 15 } } }, { "type": { - "label": ",", + "label": "...", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, @@ -15477,50 +14989,50 @@ "binop": null, "updateContext": null }, - "start": 2342, - "end": 2343, + "start": 3280, + "end": 3283, "loc": { "start": { - "line": 98, - "column": 21 + "line": 118, + "column": 16 }, "end": { - "line": 98, - "column": 22 + "line": 118, + "column": 19 } } }, { "type": { - "label": "...", - "beforeExpr": true, - "startsExpr": false, + "label": "name", + "beforeExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 2344, - "end": 2347, + "value": "args", + "start": 3283, + "end": 3287, "loc": { "start": { - "line": 98, - "column": 23 + "line": 118, + "column": 19 }, "end": { - "line": 98, - "column": 26 + "line": 118, + "column": 23 } } }, { "type": { - "label": "name", + "label": ")", "beforeExpr": false, - "startsExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -15528,25 +15040,24 @@ "postfix": false, "binop": null }, - "value": "args", - "start": 2347, - "end": 2351, + "start": 3287, + "end": 3288, "loc": { "start": { - "line": 98, - "column": 26 + "line": 118, + "column": 23 }, "end": { - "line": 98, - "column": 30 + "line": 118, + "column": 24 } } }, { "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, + "label": "{", + "beforeExpr": true, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -15554,22 +15065,23 @@ "postfix": false, "binop": null }, - "start": 2351, - "end": 2352, + "start": 3289, + "end": 3290, "loc": { "start": { - "line": 98, - "column": 30 + "line": 118, + "column": 25 }, "end": { - "line": 98, - "column": 31 + "line": 118, + "column": 26 } } }, { "type": { - "label": "}", + "label": "if", + "keyword": "if", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -15577,46 +15089,45 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 2355, - "end": 2356, + "value": "if", + "start": 3293, + "end": 3295, "loc": { "start": { - "line": 99, + "line": 119, "column": 2 }, "end": { - "line": 99, - "column": 3 + "line": 119, + "column": 4 } } }, { "type": { - "label": "return", - "keyword": "return", + "label": "(", "beforeExpr": true, - "startsExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "value": "return", - "start": 2359, - "end": 2365, + "start": 3296, + "end": 3297, "loc": { "start": { - "line": 100, - "column": 2 + "line": 119, + "column": 5 }, "end": { - "line": 100, - "column": 8 + "line": 119, + "column": 6 } } }, @@ -15635,16 +15146,16 @@ "updateContext": null }, "value": "this", - "start": 2366, - "end": 2370, + "start": 3297, + "end": 3301, "loc": { "start": { - "line": 100, - "column": 9 + "line": 119, + "column": 6 }, "end": { - "line": 100, - "column": 13 + "line": 119, + "column": 10 } } }, @@ -15661,16 +15172,16 @@ "binop": null, "updateContext": null }, - "start": 2370, - "end": 2371, + "start": 3301, + "end": 3302, "loc": { "start": { - "line": 100, - "column": 13 + "line": 119, + "column": 10 }, "end": { - "line": 100, - "column": 14 + "line": 119, + "column": 11 } } }, @@ -15686,23 +15197,23 @@ "postfix": false, "binop": null }, - "value": "data", - "start": 2371, - "end": 2375, + "value": "valid", + "start": 3302, + "end": 3307, "loc": { "start": { - "line": 100, - "column": 14 + "line": 119, + "column": 11 }, "end": { - "line": 100, - "column": 18 + "line": 119, + "column": 16 } } }, { "type": { - "label": "[", + "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, @@ -15710,27 +15221,26 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 2375, - "end": 2376, + "start": 3307, + "end": 3308, "loc": { "start": { - "line": 100, - "column": 18 + "line": 119, + "column": 16 }, "end": { - "line": 100, - "column": 19 + "line": 119, + "column": 17 } } }, { "type": { - "label": "name", + "label": ")", "beforeExpr": false, - "startsExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -15738,51 +15248,51 @@ "postfix": false, "binop": null }, - "value": "component", - "start": 2376, - "end": 2385, + "start": 3308, + "end": 3309, "loc": { "start": { - "line": 100, - "column": 19 + "line": 119, + "column": 17 }, "end": { - "line": 100, - "column": 28 + "line": 119, + "column": 18 } } }, { "type": { - "label": "]", - "beforeExpr": false, + "label": "&&", + "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, + "binop": 2, "updateContext": null }, - "start": 2385, - "end": 2386, + "value": "&&", + "start": 3310, + "end": 3312, "loc": { "start": { - "line": 100, - "column": 28 + "line": 119, + "column": 19 }, "end": { - "line": 100, - "column": 29 + "line": 119, + "column": 21 } } }, { "type": { - "label": "}", + "label": "name", "beforeExpr": false, - "startsExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -15790,38 +15300,52 @@ "postfix": false, "binop": null }, - "start": 2388, - "end": 2389, + "value": "component", + "start": 3313, + "end": 3322, "loc": { "start": { - "line": 101, - "column": 1 + "line": 119, + "column": 22 }, "end": { - "line": 101, - "column": 2 + "line": 119, + "column": 31 } } }, { - "type": "CommentBlock", - "value": "*\n\t * Adds a new component, or re-creates and overwrites an existing component\n\t *\n\t * @example\n\t * entity.set('position', 1, 2)\n\t *\n\t * @example\n\t * entity.set('anonymousComponent', { keys: 'values' })\n\t *\n\t * @example\n\t * entity.set('anotherAnonymousComponent', 'Any type of any value')\n\t *\n\t * @param {string} component - The component name to create. If there is a registered component for this name, then\n\t * its constructor will be called with (entity, ...args) and an object of that type will be created. The onCreate method\n\t * gets called after the component is added to the entity. This method also gets passed the same parameters.\n\t * @param {...Object} [args] - The arguments to forward to the registered component type. If the component type is\n\t * registered, then only the first additional argument will be used as the value of the entire component.\n\t *\n\t * @return {Object} The original entity that set() was called on, so that operations can be chained.\n\t ", - "start": 2392, - "end": 3375, + "type": { + "label": "in", + "keyword": "in", + "beforeExpr": true, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": 7, + "updateContext": null + }, + "value": "in", + "start": 3323, + "end": 3325, "loc": { "start": { - "line": 103, - "column": 1 + "line": 119, + "column": 32 }, "end": { - "line": 122, - "column": 4 + "line": 119, + "column": 34 } } }, { "type": { - "label": "name", + "label": "this", + "keyword": "this", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, @@ -15829,44 +15353,46 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "value": "set", - "start": 3377, - "end": 3380, + "value": "this", + "start": 3326, + "end": 3330, "loc": { "start": { - "line": 123, - "column": 1 + "line": 119, + "column": 35 }, "end": { - "line": 123, - "column": 4 + "line": 119, + "column": 39 } } }, { "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, + "label": ".", + "beforeExpr": false, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 3380, - "end": 3381, + "start": 3330, + "end": 3331, "loc": { "start": { - "line": 123, - "column": 4 + "line": 119, + "column": 39 }, "end": { - "line": 123, - "column": 5 + "line": 119, + "column": 40 } } }, @@ -15882,24 +15408,24 @@ "postfix": false, "binop": null }, - "value": "component", - "start": 3381, - "end": 3390, + "value": "world", + "start": 3331, + "end": 3336, "loc": { "start": { - "line": 123, - "column": 5 + "line": 119, + "column": 40 }, "end": { - "line": 123, - "column": 14 + "line": 119, + "column": 45 } } }, { "type": { - "label": ",", - "beforeExpr": true, + "label": ".", + "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, @@ -15909,50 +15435,50 @@ "binop": null, "updateContext": null }, - "start": 3390, - "end": 3391, + "start": 3336, + "end": 3337, "loc": { "start": { - "line": 123, - "column": 14 + "line": 119, + "column": 45 }, "end": { - "line": 123, - "column": 15 + "line": 119, + "column": 46 } } }, { "type": { - "label": "...", - "beforeExpr": true, - "startsExpr": false, + "label": "name", + "beforeExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 3392, - "end": 3395, + "value": "components", + "start": 3337, + "end": 3347, "loc": { "start": { - "line": 123, - "column": 16 + "line": 119, + "column": 46 }, "end": { - "line": 123, - "column": 19 + "line": 119, + "column": 56 } } }, { "type": { - "label": "name", + "label": ")", "beforeExpr": false, - "startsExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -15960,487 +15486,15 @@ "postfix": false, "binop": null }, - "value": "args", - "start": 3395, - "end": 3399, + "start": 3347, + "end": 3348, "loc": { "start": { - "line": 123, - "column": 19 + "line": 119, + "column": 56 }, "end": { - "line": 123, - "column": 23 - } - } - }, - { - "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 3399, - "end": 3400, - "loc": { - "start": { - "line": 123, - "column": 23 - }, - "end": { - "line": 123, - "column": 24 - } - } - }, - { - "type": { - "label": "{", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 3401, - "end": 3402, - "loc": { - "start": { - "line": 123, - "column": 25 - }, - "end": { - "line": 123, - "column": 26 - } - } - }, - { - "type": { - "label": "if", - "keyword": "if", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "if", - "start": 3405, - "end": 3407, - "loc": { - "start": { - "line": 124, - "column": 2 - }, - "end": { - "line": 124, - "column": 4 - } - } - }, - { - "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 3408, - "end": 3409, - "loc": { - "start": { - "line": 124, - "column": 5 - }, - "end": { - "line": 124, - "column": 6 - } - } - }, - { - "type": { - "label": "this", - "keyword": "this", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "this", - "start": 3409, - "end": 3413, - "loc": { - "start": { - "line": 124, - "column": 6 - }, - "end": { - "line": 124, - "column": 10 - } - } - }, - { - "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 3413, - "end": 3414, - "loc": { - "start": { - "line": 124, - "column": 10 - }, - "end": { - "line": 124, - "column": 11 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "valid", - "start": 3414, - "end": 3419, - "loc": { - "start": { - "line": 124, - "column": 11 - }, - "end": { - "line": 124, - "column": 16 - } - } - }, - { - "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 3419, - "end": 3420, - "loc": { - "start": { - "line": 124, - "column": 16 - }, - "end": { - "line": 124, - "column": 17 - } - } - }, - { - "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 3420, - "end": 3421, - "loc": { - "start": { - "line": 124, - "column": 17 - }, - "end": { - "line": 124, - "column": 18 - } - } - }, - { - "type": { - "label": "&&", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": 2, - "updateContext": null - }, - "value": "&&", - "start": 3422, - "end": 3424, - "loc": { - "start": { - "line": 124, - "column": 19 - }, - "end": { - "line": 124, - "column": 21 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "component", - "start": 3425, - "end": 3434, - "loc": { - "start": { - "line": 124, - "column": 22 - }, - "end": { - "line": 124, - "column": 31 - } - } - }, - { - "type": { - "label": "in", - "keyword": "in", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": 7, - "updateContext": null - }, - "value": "in", - "start": 3435, - "end": 3437, - "loc": { - "start": { - "line": 124, - "column": 32 - }, - "end": { - "line": 124, - "column": 34 - } - } - }, - { - "type": { - "label": "this", - "keyword": "this", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "this", - "start": 3438, - "end": 3442, - "loc": { - "start": { - "line": 124, - "column": 35 - }, - "end": { - "line": 124, - "column": 39 - } - } - }, - { - "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 3442, - "end": 3443, - "loc": { - "start": { - "line": 124, - "column": 39 - }, - "end": { - "line": 124, - "column": 40 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "world", - "start": 3443, - "end": 3448, - "loc": { - "start": { - "line": 124, - "column": 40 - }, - "end": { - "line": 124, - "column": 45 - } - } - }, - { - "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 3448, - "end": 3449, - "loc": { - "start": { - "line": 124, - "column": 45 - }, - "end": { - "line": 124, - "column": 46 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "components", - "start": 3449, - "end": 3459, - "loc": { - "start": { - "line": 124, - "column": 46 - }, - "end": { - "line": 124, - "column": 56 - } - } - }, - { - "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 3459, - "end": 3460, - "loc": { - "start": { - "line": 124, - "column": 56 - }, - "end": { - "line": 124, + "line": 119, "column": 57 } } @@ -16457,15 +15511,15 @@ "postfix": false, "binop": null }, - "start": 3461, - "end": 3462, + "start": 3349, + "end": 3350, "loc": { "start": { - "line": 124, + "line": 119, "column": 58 }, "end": { - "line": 124, + "line": 119, "column": 59 } } @@ -16473,15 +15527,15 @@ { "type": "CommentLine", "value": " Create component and store in entity", - "start": 3466, - "end": 3505, + "start": 3354, + "end": 3393, "loc": { "start": { - "line": 125, + "line": 120, "column": 3 }, "end": { - "line": 125, + "line": 120, "column": 42 } } @@ -16489,15 +15543,15 @@ { "type": "CommentLine", "value": " Note: The entity parameter is dangerous to use, since the component hasn't been added to the entity yet", - "start": 3509, - "end": 3615, + "start": 3397, + "end": 3503, "loc": { "start": { - "line": 126, + "line": 121, "column": 3 }, "end": { - "line": 126, + "line": 121, "column": 109 } } @@ -16517,15 +15571,15 @@ "updateContext": null }, "value": "this", - "start": 3619, - "end": 3623, + "start": 3507, + "end": 3511, "loc": { "start": { - "line": 127, + "line": 122, "column": 3 }, "end": { - "line": 127, + "line": 122, "column": 7 } } @@ -16543,15 +15597,15 @@ "binop": null, "updateContext": null }, - "start": 3623, - "end": 3624, + "start": 3511, + "end": 3512, "loc": { "start": { - "line": 127, + "line": 122, "column": 7 }, "end": { - "line": 127, + "line": 122, "column": 8 } } @@ -16569,15 +15623,15 @@ "binop": null }, "value": "data", - "start": 3624, - "end": 3628, + "start": 3512, + "end": 3516, "loc": { "start": { - "line": 127, + "line": 122, "column": 8 }, "end": { - "line": 127, + "line": 122, "column": 12 } } @@ -16595,15 +15649,15 @@ "binop": null, "updateContext": null }, - "start": 3628, - "end": 3629, + "start": 3516, + "end": 3517, "loc": { "start": { - "line": 127, + "line": 122, "column": 12 }, "end": { - "line": 127, + "line": 122, "column": 13 } } @@ -16621,15 +15675,15 @@ "binop": null }, "value": "component", - "start": 3629, - "end": 3638, + "start": 3517, + "end": 3526, "loc": { "start": { - "line": 127, + "line": 122, "column": 13 }, "end": { - "line": 127, + "line": 122, "column": 22 } } @@ -16647,15 +15701,15 @@ "binop": null, "updateContext": null }, - "start": 3638, - "end": 3639, + "start": 3526, + "end": 3527, "loc": { "start": { - "line": 127, + "line": 122, "column": 22 }, "end": { - "line": 127, + "line": 122, "column": 23 } } @@ -16674,15 +15728,15 @@ "updateContext": null }, "value": "=", - "start": 3640, - "end": 3641, + "start": 3528, + "end": 3529, "loc": { "start": { - "line": 127, + "line": 122, "column": 24 }, "end": { - "line": 127, + "line": 122, "column": 25 } } @@ -16702,15 +15756,15 @@ "updateContext": null }, "value": "new", - "start": 3642, - "end": 3645, + "start": 3530, + "end": 3533, "loc": { "start": { - "line": 127, + "line": 122, "column": 26 }, "end": { - "line": 127, + "line": 122, "column": 29 } } @@ -16730,15 +15784,15 @@ "updateContext": null }, "value": "this", - "start": 3646, - "end": 3650, + "start": 3534, + "end": 3538, "loc": { "start": { - "line": 127, + "line": 122, "column": 30 }, "end": { - "line": 127, + "line": 122, "column": 34 } } @@ -16756,15 +15810,15 @@ "binop": null, "updateContext": null }, - "start": 3650, - "end": 3651, + "start": 3538, + "end": 3539, "loc": { "start": { - "line": 127, + "line": 122, "column": 34 }, "end": { - "line": 127, + "line": 122, "column": 35 } } @@ -16782,15 +15836,15 @@ "binop": null }, "value": "world", - "start": 3651, - "end": 3656, + "start": 3539, + "end": 3544, "loc": { "start": { - "line": 127, + "line": 122, "column": 35 }, "end": { - "line": 127, + "line": 122, "column": 40 } } @@ -16808,15 +15862,15 @@ "binop": null, "updateContext": null }, - "start": 3656, - "end": 3657, + "start": 3544, + "end": 3545, "loc": { "start": { - "line": 127, + "line": 122, "column": 40 }, "end": { - "line": 127, + "line": 122, "column": 41 } } @@ -16834,15 +15888,15 @@ "binop": null }, "value": "components", - "start": 3657, - "end": 3667, + "start": 3545, + "end": 3555, "loc": { "start": { - "line": 127, + "line": 122, "column": 41 }, "end": { - "line": 127, + "line": 122, "column": 51 } } @@ -16860,15 +15914,15 @@ "binop": null, "updateContext": null }, - "start": 3667, - "end": 3668, + "start": 3555, + "end": 3556, "loc": { "start": { - "line": 127, + "line": 122, "column": 51 }, "end": { - "line": 127, + "line": 122, "column": 52 } } @@ -16886,15 +15940,15 @@ "binop": null }, "value": "component", - "start": 3668, - "end": 3677, + "start": 3556, + "end": 3565, "loc": { "start": { - "line": 127, + "line": 122, "column": 52 }, "end": { - "line": 127, + "line": 122, "column": 61 } } @@ -16912,15 +15966,15 @@ "binop": null, "updateContext": null }, - "start": 3677, - "end": 3678, + "start": 3565, + "end": 3566, "loc": { "start": { - "line": 127, + "line": 122, "column": 61 }, "end": { - "line": 127, + "line": 122, "column": 62 } } @@ -16937,15 +15991,15 @@ "postfix": false, "binop": null }, - "start": 3678, - "end": 3679, + "start": 3566, + "end": 3567, "loc": { "start": { - "line": 127, + "line": 122, "column": 62 }, "end": { - "line": 127, + "line": 122, "column": 63 } } @@ -16965,15 +16019,15 @@ "updateContext": null }, "value": "this", - "start": 3679, - "end": 3683, + "start": 3567, + "end": 3571, "loc": { "start": { - "line": 127, + "line": 122, "column": 63 }, "end": { - "line": 127, + "line": 122, "column": 67 } } @@ -16991,15 +16045,15 @@ "binop": null, "updateContext": null }, - "start": 3683, - "end": 3684, + "start": 3571, + "end": 3572, "loc": { "start": { - "line": 127, + "line": 122, "column": 67 }, "end": { - "line": 127, + "line": 122, "column": 68 } } @@ -17017,15 +16071,15 @@ "binop": null, "updateContext": null }, - "start": 3685, - "end": 3688, + "start": 3573, + "end": 3576, "loc": { "start": { - "line": 127, + "line": 122, "column": 69 }, "end": { - "line": 127, + "line": 122, "column": 72 } } @@ -17043,15 +16097,15 @@ "binop": null }, "value": "args", - "start": 3688, - "end": 3692, + "start": 3576, + "end": 3580, "loc": { "start": { - "line": 127, + "line": 122, "column": 72 }, "end": { - "line": 127, + "line": 122, "column": 76 } } @@ -17068,15 +16122,15 @@ "postfix": false, "binop": null }, - "start": 3692, - "end": 3693, + "start": 3580, + "end": 3581, "loc": { "start": { - "line": 127, + "line": 122, "column": 76 }, "end": { - "line": 127, + "line": 122, "column": 77 } } @@ -17093,15 +16147,15 @@ "postfix": false, "binop": null }, - "start": 3696, - "end": 3697, + "start": 3584, + "end": 3585, "loc": { "start": { - "line": 128, + "line": 123, "column": 2 }, "end": { - "line": 128, + "line": 123, "column": 3 } } @@ -17121,15 +16175,15 @@ "updateContext": null }, "value": "else", - "start": 3698, - "end": 3702, + "start": 3586, + "end": 3590, "loc": { "start": { - "line": 128, + "line": 123, "column": 4 }, "end": { - "line": 128, + "line": 123, "column": 8 } } @@ -17149,15 +16203,15 @@ "updateContext": null }, "value": "if", - "start": 3703, - "end": 3705, + "start": 3591, + "end": 3593, "loc": { "start": { - "line": 128, + "line": 123, "column": 9 }, "end": { - "line": 128, + "line": 123, "column": 11 } } @@ -17174,15 +16228,15 @@ "postfix": false, "binop": null }, - "start": 3706, - "end": 3707, + "start": 3594, + "end": 3595, "loc": { "start": { - "line": 128, + "line": 123, "column": 12 }, "end": { - "line": 128, + "line": 123, "column": 13 } } @@ -17200,15 +16254,15 @@ "binop": null }, "value": "args", - "start": 3707, - "end": 3711, + "start": 3595, + "end": 3599, "loc": { "start": { - "line": 128, + "line": 123, "column": 13 }, "end": { - "line": 128, + "line": 123, "column": 17 } } @@ -17226,15 +16280,15 @@ "binop": null, "updateContext": null }, - "start": 3711, - "end": 3712, + "start": 3599, + "end": 3600, "loc": { "start": { - "line": 128, + "line": 123, "column": 17 }, "end": { - "line": 128, + "line": 123, "column": 18 } } @@ -17252,15 +16306,15 @@ "binop": null }, "value": "length", - "start": 3712, - "end": 3718, + "start": 3600, + "end": 3606, "loc": { "start": { - "line": 128, + "line": 123, "column": 18 }, "end": { - "line": 128, + "line": 123, "column": 24 } } @@ -17279,15 +16333,15 @@ "updateContext": null }, "value": ">", - "start": 3719, - "end": 3720, + "start": 3607, + "end": 3608, "loc": { "start": { - "line": 128, + "line": 123, "column": 25 }, "end": { - "line": 128, + "line": 123, "column": 26 } } @@ -17306,15 +16360,15 @@ "updateContext": null }, "value": 0, - "start": 3721, - "end": 3722, + "start": 3609, + "end": 3610, "loc": { "start": { - "line": 128, + "line": 123, "column": 27 }, "end": { - "line": 128, + "line": 123, "column": 28 } } @@ -17331,15 +16385,15 @@ "postfix": false, "binop": null }, - "start": 3722, - "end": 3723, + "start": 3610, + "end": 3611, "loc": { "start": { - "line": 128, + "line": 123, "column": 28 }, "end": { - "line": 128, + "line": 123, "column": 29 } } @@ -17356,15 +16410,15 @@ "postfix": false, "binop": null }, - "start": 3724, - "end": 3725, + "start": 3612, + "end": 3613, "loc": { "start": { - "line": 128, + "line": 123, "column": 30 }, "end": { - "line": 128, + "line": 123, "column": 31 } } @@ -17372,15 +16426,15 @@ { "type": "CommentLine", "value": " Use first argument as component value", - "start": 3729, - "end": 3769, + "start": 3617, + "end": 3657, "loc": { "start": { - "line": 129, + "line": 124, "column": 3 }, "end": { - "line": 129, + "line": 124, "column": 43 } } @@ -17400,15 +16454,15 @@ "updateContext": null }, "value": "this", - "start": 3773, - "end": 3777, + "start": 3661, + "end": 3665, "loc": { "start": { - "line": 130, + "line": 125, "column": 3 }, "end": { - "line": 130, + "line": 125, "column": 7 } } @@ -17426,15 +16480,15 @@ "binop": null, "updateContext": null }, - "start": 3777, - "end": 3778, + "start": 3665, + "end": 3666, "loc": { "start": { - "line": 130, + "line": 125, "column": 7 }, "end": { - "line": 130, + "line": 125, "column": 8 } } @@ -17452,15 +16506,15 @@ "binop": null }, "value": "data", - "start": 3778, - "end": 3782, + "start": 3666, + "end": 3670, "loc": { "start": { - "line": 130, + "line": 125, "column": 8 }, "end": { - "line": 130, + "line": 125, "column": 12 } } @@ -17478,15 +16532,15 @@ "binop": null, "updateContext": null }, - "start": 3782, - "end": 3783, + "start": 3670, + "end": 3671, "loc": { "start": { - "line": 130, + "line": 125, "column": 12 }, "end": { - "line": 130, + "line": 125, "column": 13 } } @@ -17504,15 +16558,15 @@ "binop": null }, "value": "component", - "start": 3783, - "end": 3792, + "start": 3671, + "end": 3680, "loc": { "start": { - "line": 130, + "line": 125, "column": 13 }, "end": { - "line": 130, + "line": 125, "column": 22 } } @@ -17530,15 +16584,15 @@ "binop": null, "updateContext": null }, - "start": 3792, - "end": 3793, + "start": 3680, + "end": 3681, "loc": { "start": { - "line": 130, + "line": 125, "column": 22 }, "end": { - "line": 130, + "line": 125, "column": 23 } } @@ -17557,15 +16611,15 @@ "updateContext": null }, "value": "=", - "start": 3794, - "end": 3795, + "start": 3682, + "end": 3683, "loc": { "start": { - "line": 130, + "line": 125, "column": 24 }, "end": { - "line": 130, + "line": 125, "column": 25 } } @@ -17583,15 +16637,15 @@ "binop": null }, "value": "args", - "start": 3796, - "end": 3800, + "start": 3684, + "end": 3688, "loc": { "start": { - "line": 130, + "line": 125, "column": 26 }, "end": { - "line": 130, + "line": 125, "column": 30 } } @@ -17609,15 +16663,15 @@ "binop": null, "updateContext": null }, - "start": 3800, - "end": 3801, + "start": 3688, + "end": 3689, "loc": { "start": { - "line": 130, + "line": 125, "column": 30 }, "end": { - "line": 130, + "line": 125, "column": 31 } } @@ -17636,15 +16690,15 @@ "updateContext": null }, "value": 0, - "start": 3801, - "end": 3802, + "start": 3689, + "end": 3690, "loc": { "start": { - "line": 130, + "line": 125, "column": 31 }, "end": { - "line": 130, + "line": 125, "column": 32 } } @@ -17662,15 +16716,15 @@ "binop": null, "updateContext": null }, - "start": 3802, - "end": 3803, + "start": 3690, + "end": 3691, "loc": { "start": { - "line": 130, + "line": 125, "column": 32 }, "end": { - "line": 130, + "line": 125, "column": 33 } } @@ -17687,15 +16741,15 @@ "postfix": false, "binop": null }, - "start": 3806, - "end": 3807, + "start": 3694, + "end": 3695, "loc": { "start": { - "line": 131, + "line": 126, "column": 2 }, "end": { - "line": 131, + "line": 126, "column": 3 } } @@ -17715,15 +16769,15 @@ "updateContext": null }, "value": "else", - "start": 3808, - "end": 3812, + "start": 3696, + "end": 3700, "loc": { "start": { - "line": 131, + "line": 126, "column": 4 }, "end": { - "line": 131, + "line": 126, "column": 8 } } @@ -17740,15 +16794,15 @@ "postfix": false, "binop": null }, - "start": 3813, - "end": 3814, + "start": 3701, + "end": 3702, "loc": { "start": { - "line": 131, + "line": 126, "column": 9 }, "end": { - "line": 131, + "line": 126, "column": 10 } } @@ -17756,15 +16810,15 @@ { "type": "CommentLine", "value": " Make an empty object", - "start": 3818, - "end": 3841, + "start": 3706, + "end": 3729, "loc": { "start": { - "line": 132, + "line": 127, "column": 3 }, "end": { - "line": 132, + "line": 127, "column": 26 } } @@ -17784,15 +16838,15 @@ "updateContext": null }, "value": "this", - "start": 3845, - "end": 3849, + "start": 3733, + "end": 3737, "loc": { "start": { - "line": 133, + "line": 128, "column": 3 }, "end": { - "line": 133, + "line": 128, "column": 7 } } @@ -17810,15 +16864,15 @@ "binop": null, "updateContext": null }, - "start": 3849, - "end": 3850, + "start": 3737, + "end": 3738, "loc": { "start": { - "line": 133, + "line": 128, "column": 7 }, "end": { - "line": 133, + "line": 128, "column": 8 } } @@ -17836,15 +16890,15 @@ "binop": null }, "value": "data", - "start": 3850, - "end": 3854, + "start": 3738, + "end": 3742, "loc": { "start": { - "line": 133, + "line": 128, "column": 8 }, "end": { - "line": 133, + "line": 128, "column": 12 } } @@ -17862,15 +16916,15 @@ "binop": null, "updateContext": null }, - "start": 3854, - "end": 3855, + "start": 3742, + "end": 3743, "loc": { "start": { - "line": 133, + "line": 128, "column": 12 }, "end": { - "line": 133, + "line": 128, "column": 13 } } @@ -17888,15 +16942,15 @@ "binop": null }, "value": "component", - "start": 3855, - "end": 3864, + "start": 3743, + "end": 3752, "loc": { "start": { - "line": 133, + "line": 128, "column": 13 }, "end": { - "line": 133, + "line": 128, "column": 22 } } @@ -17914,15 +16968,15 @@ "binop": null, "updateContext": null }, - "start": 3864, - "end": 3865, + "start": 3752, + "end": 3753, "loc": { "start": { - "line": 133, + "line": 128, "column": 22 }, "end": { - "line": 133, + "line": 128, "column": 23 } } @@ -17941,15 +16995,15 @@ "updateContext": null }, "value": "=", - "start": 3866, - "end": 3867, + "start": 3754, + "end": 3755, "loc": { "start": { - "line": 133, + "line": 128, "column": 24 }, "end": { - "line": 133, + "line": 128, "column": 25 } } @@ -17966,15 +17020,15 @@ "postfix": false, "binop": null }, - "start": 3868, - "end": 3869, + "start": 3756, + "end": 3757, "loc": { "start": { - "line": 133, + "line": 128, "column": 26 }, "end": { - "line": 133, + "line": 128, "column": 27 } } @@ -17991,15 +17045,15 @@ "postfix": false, "binop": null }, - "start": 3869, - "end": 3870, + "start": 3757, + "end": 3758, "loc": { "start": { - "line": 133, + "line": 128, "column": 27 }, "end": { - "line": 133, + "line": 128, "column": 28 } } @@ -18016,15 +17070,15 @@ "postfix": false, "binop": null }, - "start": 3873, - "end": 3874, + "start": 3761, + "end": 3762, "loc": { "start": { - "line": 134, + "line": 129, "column": 2 }, "end": { - "line": 134, + "line": 129, "column": 3 } } @@ -18032,15 +17086,15 @@ { "type": "CommentLine", "value": " Update the index with this new component", - "start": 3878, - "end": 3921, + "start": 3766, + "end": 3809, "loc": { "start": { - "line": 136, + "line": 131, "column": 2 }, "end": { - "line": 136, + "line": 131, "column": 45 } } @@ -18060,15 +17114,15 @@ "updateContext": null }, "value": "if", - "start": 3924, - "end": 3926, + "start": 3812, + "end": 3814, "loc": { "start": { - "line": 137, + "line": 132, "column": 2 }, "end": { - "line": 137, + "line": 132, "column": 4 } } @@ -18085,15 +17139,15 @@ "postfix": false, "binop": null }, - "start": 3927, - "end": 3928, + "start": 3815, + "end": 3816, "loc": { "start": { - "line": 137, + "line": 132, "column": 5 }, "end": { - "line": 137, + "line": 132, "column": 6 } } @@ -18113,15 +17167,15 @@ "updateContext": null }, "value": "this", - "start": 3928, - "end": 3932, + "start": 3816, + "end": 3820, "loc": { "start": { - "line": 137, + "line": 132, "column": 6 }, "end": { - "line": 137, + "line": 132, "column": 10 } } @@ -18139,15 +17193,15 @@ "binop": null, "updateContext": null }, - "start": 3932, - "end": 3933, + "start": 3820, + "end": 3821, "loc": { "start": { - "line": 137, + "line": 132, "column": 10 }, "end": { - "line": 137, + "line": 132, "column": 11 } } @@ -18165,15 +17219,15 @@ "binop": null }, "value": "valid", - "start": 3933, - "end": 3938, + "start": 3821, + "end": 3826, "loc": { "start": { - "line": 137, + "line": 132, "column": 11 }, "end": { - "line": 137, + "line": 132, "column": 16 } } @@ -18190,15 +17244,15 @@ "postfix": false, "binop": null }, - "start": 3938, - "end": 3939, + "start": 3826, + "end": 3827, "loc": { "start": { - "line": 137, + "line": 132, "column": 16 }, "end": { - "line": 137, + "line": 132, "column": 17 } } @@ -18215,15 +17269,15 @@ "postfix": false, "binop": null }, - "start": 3939, - "end": 3940, + "start": 3827, + "end": 3828, "loc": { "start": { - "line": 137, + "line": 132, "column": 17 }, "end": { - "line": 137, + "line": 132, "column": 18 } } @@ -18240,15 +17294,15 @@ "postfix": false, "binop": null }, - "start": 3940, - "end": 3941, + "start": 3828, + "end": 3829, "loc": { "start": { - "line": 137, + "line": 132, "column": 18 }, "end": { - "line": 137, + "line": 132, "column": 19 } } @@ -18265,15 +17319,15 @@ "postfix": false, "binop": null }, - "start": 3942, - "end": 3943, + "start": 3830, + "end": 3831, "loc": { "start": { - "line": 137, + "line": 132, "column": 20 }, "end": { - "line": 137, + "line": 132, "column": 21 } } @@ -18293,15 +17347,15 @@ "updateContext": null }, "value": "this", - "start": 3947, - "end": 3951, + "start": 3835, + "end": 3839, "loc": { "start": { - "line": 138, + "line": 133, "column": 3 }, "end": { - "line": 138, + "line": 133, "column": 7 } } @@ -18319,15 +17373,15 @@ "binop": null, "updateContext": null }, - "start": 3951, - "end": 3952, + "start": 3839, + "end": 3840, "loc": { "start": { - "line": 138, + "line": 133, "column": 7 }, "end": { - "line": 138, + "line": 133, "column": 8 } } @@ -18345,15 +17399,15 @@ "binop": null }, "value": "world", - "start": 3952, - "end": 3957, + "start": 3840, + "end": 3845, "loc": { "start": { - "line": 138, + "line": 133, "column": 8 }, "end": { - "line": 138, + "line": 133, "column": 13 } } @@ -18371,15 +17425,15 @@ "binop": null, "updateContext": null }, - "start": 3957, - "end": 3958, + "start": 3845, + "end": 3846, "loc": { "start": { - "line": 138, + "line": 133, "column": 13 }, "end": { - "line": 138, + "line": 133, "column": 14 } } @@ -18397,15 +17451,15 @@ "binop": null }, "value": "index", - "start": 3958, - "end": 3963, + "start": 3846, + "end": 3851, "loc": { "start": { - "line": 138, + "line": 133, "column": 14 }, "end": { - "line": 138, + "line": 133, "column": 19 } } @@ -18423,15 +17477,15 @@ "binop": null, "updateContext": null }, - "start": 3963, - "end": 3964, + "start": 3851, + "end": 3852, "loc": { "start": { - "line": 138, + "line": 133, "column": 19 }, "end": { - "line": 138, + "line": 133, "column": 20 } } @@ -18449,15 +17503,15 @@ "binop": null }, "value": "add", - "start": 3964, - "end": 3967, + "start": 3852, + "end": 3855, "loc": { "start": { - "line": 138, + "line": 133, "column": 20 }, "end": { - "line": 138, + "line": 133, "column": 23 } } @@ -18474,15 +17528,15 @@ "postfix": false, "binop": null }, - "start": 3967, - "end": 3968, + "start": 3855, + "end": 3856, "loc": { "start": { - "line": 138, + "line": 133, "column": 23 }, "end": { - "line": 138, + "line": 133, "column": 24 } } @@ -18502,15 +17556,15 @@ "updateContext": null }, "value": "this", - "start": 3968, - "end": 3972, + "start": 3856, + "end": 3860, "loc": { "start": { - "line": 138, + "line": 133, "column": 24 }, "end": { - "line": 138, + "line": 133, "column": 28 } } @@ -18528,15 +17582,15 @@ "binop": null, "updateContext": null }, - "start": 3972, - "end": 3973, + "start": 3860, + "end": 3861, "loc": { "start": { - "line": 138, + "line": 133, "column": 28 }, "end": { - "line": 138, + "line": 133, "column": 29 } } @@ -18554,15 +17608,15 @@ "binop": null }, "value": "component", - "start": 3974, - "end": 3983, + "start": 3862, + "end": 3871, "loc": { "start": { - "line": 138, + "line": 133, "column": 30 }, "end": { - "line": 138, + "line": 133, "column": 39 } } @@ -18579,15 +17633,15 @@ "postfix": false, "binop": null }, - "start": 3983, - "end": 3984, + "start": 3871, + "end": 3872, "loc": { "start": { - "line": 138, + "line": 133, "column": 39 }, "end": { - "line": 138, + "line": 133, "column": 40 } } @@ -18604,15 +17658,15 @@ "postfix": false, "binop": null }, - "start": 3987, - "end": 3988, + "start": 3875, + "end": 3876, "loc": { "start": { - "line": 139, + "line": 134, "column": 2 }, "end": { - "line": 139, + "line": 134, "column": 3 } } @@ -18620,15 +17674,15 @@ { "type": "CommentLine", "value": " Call custom onCreate to initialize component, pass the entity (this), and any additional arguments passed into set()", - "start": 3992, - "end": 4111, + "start": 3880, + "end": 3999, "loc": { "start": { - "line": 141, + "line": 136, "column": 2 }, "end": { - "line": 141, + "line": 136, "column": 121 } } @@ -18646,15 +17700,15 @@ "binop": null }, "value": "invoke", - "start": 4114, - "end": 4120, + "start": 4002, + "end": 4008, "loc": { "start": { - "line": 142, + "line": 137, "column": 2 }, "end": { - "line": 142, + "line": 137, "column": 8 } } @@ -18671,15 +17725,15 @@ "postfix": false, "binop": null }, - "start": 4120, - "end": 4121, + "start": 4008, + "end": 4009, "loc": { "start": { - "line": 142, + "line": 137, "column": 8 }, "end": { - "line": 142, + "line": 137, "column": 9 } } @@ -18699,15 +17753,15 @@ "updateContext": null }, "value": "this", - "start": 4121, - "end": 4125, + "start": 4009, + "end": 4013, "loc": { "start": { - "line": 142, + "line": 137, "column": 9 }, "end": { - "line": 142, + "line": 137, "column": 13 } } @@ -18725,15 +17779,15 @@ "binop": null, "updateContext": null }, - "start": 4125, - "end": 4126, + "start": 4013, + "end": 4014, "loc": { "start": { - "line": 142, + "line": 137, "column": 13 }, "end": { - "line": 142, + "line": 137, "column": 14 } } @@ -18751,15 +17805,15 @@ "binop": null }, "value": "data", - "start": 4126, - "end": 4130, + "start": 4014, + "end": 4018, "loc": { "start": { - "line": 142, + "line": 137, "column": 14 }, "end": { - "line": 142, + "line": 137, "column": 18 } } @@ -18777,15 +17831,15 @@ "binop": null, "updateContext": null }, - "start": 4130, - "end": 4131, + "start": 4018, + "end": 4019, "loc": { "start": { - "line": 142, + "line": 137, "column": 18 }, "end": { - "line": 142, + "line": 137, "column": 19 } } @@ -18803,15 +17857,15 @@ "binop": null }, "value": "component", - "start": 4131, - "end": 4140, + "start": 4019, + "end": 4028, "loc": { "start": { - "line": 142, + "line": 137, "column": 19 }, "end": { - "line": 142, + "line": 137, "column": 28 } } @@ -18829,15 +17883,15 @@ "binop": null, "updateContext": null }, - "start": 4140, - "end": 4141, + "start": 4028, + "end": 4029, "loc": { "start": { - "line": 142, + "line": 137, "column": 28 }, "end": { - "line": 142, + "line": 137, "column": 29 } } @@ -18855,15 +17909,15 @@ "binop": null, "updateContext": null }, - "start": 4141, - "end": 4142, + "start": 4029, + "end": 4030, "loc": { "start": { - "line": 142, + "line": 137, "column": 29 }, "end": { - "line": 142, + "line": 137, "column": 30 } } @@ -18882,15 +17936,15 @@ "updateContext": null }, "value": "onCreate", - "start": 4143, - "end": 4153, + "start": 4031, + "end": 4041, "loc": { "start": { - "line": 142, + "line": 137, "column": 31 }, "end": { - "line": 142, + "line": 137, "column": 41 } } @@ -18908,15 +17962,15 @@ "binop": null, "updateContext": null }, - "start": 4153, - "end": 4154, + "start": 4041, + "end": 4042, "loc": { "start": { - "line": 142, + "line": 137, "column": 41 }, "end": { - "line": 142, + "line": 137, "column": 42 } } @@ -18936,15 +17990,15 @@ "updateContext": null }, "value": "this", - "start": 4155, - "end": 4159, + "start": 4043, + "end": 4047, "loc": { "start": { - "line": 142, + "line": 137, "column": 43 }, "end": { - "line": 142, + "line": 137, "column": 47 } } @@ -18962,15 +18016,15 @@ "binop": null, "updateContext": null }, - "start": 4159, - "end": 4160, + "start": 4047, + "end": 4048, "loc": { "start": { - "line": 142, + "line": 137, "column": 47 }, "end": { - "line": 142, + "line": 137, "column": 48 } } @@ -18988,15 +18042,15 @@ "binop": null, "updateContext": null }, - "start": 4161, - "end": 4164, + "start": 4049, + "end": 4052, "loc": { "start": { - "line": 142, + "line": 137, "column": 49 }, "end": { - "line": 142, + "line": 137, "column": 52 } } @@ -19014,15 +18068,15 @@ "binop": null }, "value": "args", - "start": 4164, - "end": 4168, + "start": 4052, + "end": 4056, "loc": { "start": { - "line": 142, + "line": 137, "column": 52 }, "end": { - "line": 142, + "line": 137, "column": 56 } } @@ -19039,15 +18093,15 @@ "postfix": false, "binop": null }, - "start": 4168, - "end": 4169, + "start": 4056, + "end": 4057, "loc": { "start": { - "line": 142, + "line": 137, "column": 56 }, "end": { - "line": 142, + "line": 137, "column": 57 } } @@ -19067,15 +18121,15 @@ "updateContext": null }, "value": "return", - "start": 4173, - "end": 4179, + "start": 4061, + "end": 4067, "loc": { "start": { - "line": 144, + "line": 139, "column": 2 }, "end": { - "line": 144, + "line": 139, "column": 8 } } @@ -19095,15 +18149,15 @@ "updateContext": null }, "value": "this", - "start": 4180, - "end": 4184, + "start": 4068, + "end": 4072, "loc": { "start": { - "line": 144, + "line": 139, "column": 9 }, "end": { - "line": 144, + "line": 139, "column": 13 } } @@ -19120,15 +18174,15 @@ "postfix": false, "binop": null }, - "start": 4186, - "end": 4187, + "start": 4074, + "end": 4075, "loc": { "start": { - "line": 145, + "line": 140, "column": 1 }, "end": { - "line": 145, + "line": 140, "column": 2 } } @@ -19136,15 +18190,15 @@ { "type": "CommentBlock", "value": "*\n\t * Updates component data from an object or other component. Similar to access() with a shallow merge applied after.\n\t *\n\t * @example\n\t * entity.update('position', { x: 1, y: 2 })\n\t *\n\t * @param {string} component - The component name to update\n\t * @param {Object} data - The object or other component to merge into the specified component.\n\t *\n\t * @return {Object} The original entity that update() was called on, so that operations can be chained.\n\t ", - "start": 4190, - "end": 4654, + "start": 4078, + "end": 4542, "loc": { "start": { - "line": 147, + "line": 142, "column": 1 }, "end": { - "line": 157, + "line": 152, "column": 4 } } @@ -19162,15 +18216,15 @@ "binop": null }, "value": "update", - "start": 4656, - "end": 4662, + "start": 4544, + "end": 4550, "loc": { "start": { - "line": 158, + "line": 153, "column": 1 }, "end": { - "line": 158, + "line": 153, "column": 7 } } @@ -19187,15 +18241,15 @@ "postfix": false, "binop": null }, - "start": 4662, - "end": 4663, + "start": 4550, + "end": 4551, "loc": { "start": { - "line": 158, + "line": 153, "column": 7 }, "end": { - "line": 158, + "line": 153, "column": 8 } } @@ -19213,15 +18267,15 @@ "binop": null }, "value": "component", - "start": 4663, - "end": 4672, + "start": 4551, + "end": 4560, "loc": { "start": { - "line": 158, + "line": 153, "column": 8 }, "end": { - "line": 158, + "line": 153, "column": 17 } } @@ -19239,15 +18293,15 @@ "binop": null, "updateContext": null }, - "start": 4672, - "end": 4673, + "start": 4560, + "end": 4561, "loc": { "start": { - "line": 158, + "line": 153, "column": 17 }, "end": { - "line": 158, + "line": 153, "column": 18 } } @@ -19265,15 +18319,15 @@ "binop": null }, "value": "data", - "start": 4674, - "end": 4678, + "start": 4562, + "end": 4566, "loc": { "start": { - "line": 158, + "line": 153, "column": 19 }, "end": { - "line": 158, + "line": 153, "column": 23 } } @@ -19290,15 +18344,15 @@ "postfix": false, "binop": null }, - "start": 4678, - "end": 4679, + "start": 4566, + "end": 4567, "loc": { "start": { - "line": 158, + "line": 153, "column": 23 }, "end": { - "line": 158, + "line": 153, "column": 24 } } @@ -19315,15 +18369,15 @@ "postfix": false, "binop": null }, - "start": 4680, - "end": 4681, + "start": 4568, + "end": 4569, "loc": { "start": { - "line": 158, + "line": 153, "column": 25 }, "end": { - "line": 158, + "line": 153, "column": 26 } } @@ -19343,15 +18397,15 @@ "updateContext": null }, "value": "let", - "start": 4684, - "end": 4687, + "start": 4572, + "end": 4575, "loc": { "start": { - "line": 159, + "line": 154, "column": 2 }, "end": { - "line": 159, + "line": 154, "column": 5 } } @@ -19369,15 +18423,15 @@ "binop": null }, "value": "comp", - "start": 4688, - "end": 4692, + "start": 4576, + "end": 4580, "loc": { "start": { - "line": 159, + "line": 154, "column": 6 }, "end": { - "line": 159, + "line": 154, "column": 10 } } @@ -19396,15 +18450,15 @@ "updateContext": null }, "value": "=", - "start": 4693, - "end": 4694, + "start": 4581, + "end": 4582, "loc": { "start": { - "line": 159, + "line": 154, "column": 11 }, "end": { - "line": 159, + "line": 154, "column": 12 } } @@ -19424,15 +18478,15 @@ "updateContext": null }, "value": "this", - "start": 4695, - "end": 4699, + "start": 4583, + "end": 4587, "loc": { "start": { - "line": 159, + "line": 154, "column": 13 }, "end": { - "line": 159, + "line": 154, "column": 17 } } @@ -19450,15 +18504,15 @@ "binop": null, "updateContext": null }, - "start": 4699, - "end": 4700, + "start": 4587, + "end": 4588, "loc": { "start": { - "line": 159, + "line": 154, "column": 17 }, "end": { - "line": 159, + "line": 154, "column": 18 } } @@ -19476,15 +18530,15 @@ "binop": null }, "value": "access", - "start": 4700, - "end": 4706, + "start": 4588, + "end": 4594, "loc": { "start": { - "line": 159, + "line": 154, "column": 18 }, "end": { - "line": 159, + "line": 154, "column": 24 } } @@ -19501,15 +18555,15 @@ "postfix": false, "binop": null }, - "start": 4706, - "end": 4707, + "start": 4594, + "end": 4595, "loc": { "start": { - "line": 159, + "line": 154, "column": 24 }, "end": { - "line": 159, + "line": 154, "column": 25 } } @@ -19527,15 +18581,15 @@ "binop": null }, "value": "component", - "start": 4707, - "end": 4716, + "start": 4595, + "end": 4604, "loc": { "start": { - "line": 159, + "line": 154, "column": 25 }, "end": { - "line": 159, + "line": 154, "column": 34 } } @@ -19552,15 +18606,15 @@ "postfix": false, "binop": null }, - "start": 4716, - "end": 4717, + "start": 4604, + "end": 4605, "loc": { "start": { - "line": 159, + "line": 154, "column": 34 }, "end": { - "line": 159, + "line": 154, "column": 35 } } @@ -19568,15 +18622,15 @@ { "type": "CommentLine", "value": " Shallow set keys of the component", - "start": 4721, - "end": 4757, + "start": 4609, + "end": 4645, "loc": { "start": { - "line": 161, + "line": 156, "column": 2 }, "end": { - "line": 161, + "line": 156, "column": 38 } } @@ -19596,15 +18650,15 @@ "updateContext": null }, "value": "for", - "start": 4760, - "end": 4763, + "start": 4648, + "end": 4651, "loc": { "start": { - "line": 162, + "line": 157, "column": 2 }, "end": { - "line": 162, + "line": 157, "column": 5 } } @@ -19621,15 +18675,15 @@ "postfix": false, "binop": null }, - "start": 4764, - "end": 4765, + "start": 4652, + "end": 4653, "loc": { "start": { - "line": 162, + "line": 157, "column": 6 }, "end": { - "line": 162, + "line": 157, "column": 7 } } @@ -19649,15 +18703,15 @@ "updateContext": null }, "value": "let", - "start": 4765, - "end": 4768, + "start": 4653, + "end": 4656, "loc": { "start": { - "line": 162, + "line": 157, "column": 7 }, "end": { - "line": 162, + "line": 157, "column": 10 } } @@ -19675,15 +18729,15 @@ "binop": null }, "value": "key", - "start": 4769, - "end": 4772, + "start": 4657, + "end": 4660, "loc": { "start": { - "line": 162, + "line": 157, "column": 11 }, "end": { - "line": 162, + "line": 157, "column": 14 } } @@ -19703,15 +18757,15 @@ "updateContext": null }, "value": "in", - "start": 4773, - "end": 4775, + "start": 4661, + "end": 4663, "loc": { "start": { - "line": 162, + "line": 157, "column": 15 }, "end": { - "line": 162, + "line": 157, "column": 17 } } @@ -19729,15 +18783,15 @@ "binop": null }, "value": "data", - "start": 4776, - "end": 4780, + "start": 4664, + "end": 4668, "loc": { "start": { - "line": 162, + "line": 157, "column": 18 }, "end": { - "line": 162, + "line": 157, "column": 22 } } @@ -19754,15 +18808,15 @@ "postfix": false, "binop": null }, - "start": 4780, - "end": 4781, + "start": 4668, + "end": 4669, "loc": { "start": { - "line": 162, + "line": 157, "column": 22 }, "end": { - "line": 162, + "line": 157, "column": 23 } } @@ -19779,15 +18833,15 @@ "postfix": false, "binop": null }, - "start": 4782, - "end": 4783, + "start": 4670, + "end": 4671, "loc": { "start": { - "line": 162, + "line": 157, "column": 24 }, "end": { - "line": 162, + "line": 157, "column": 25 } } @@ -19805,15 +18859,15 @@ "binop": null }, "value": "comp", - "start": 4787, - "end": 4791, + "start": 4675, + "end": 4679, "loc": { "start": { - "line": 163, + "line": 158, "column": 3 }, "end": { - "line": 163, + "line": 158, "column": 7 } } @@ -19831,15 +18885,15 @@ "binop": null, "updateContext": null }, - "start": 4791, - "end": 4792, + "start": 4679, + "end": 4680, "loc": { "start": { - "line": 163, + "line": 158, "column": 7 }, "end": { - "line": 163, + "line": 158, "column": 8 } } @@ -19857,15 +18911,15 @@ "binop": null }, "value": "key", - "start": 4792, - "end": 4795, + "start": 4680, + "end": 4683, "loc": { "start": { - "line": 163, + "line": 158, "column": 8 }, "end": { - "line": 163, + "line": 158, "column": 11 } } @@ -19883,15 +18937,15 @@ "binop": null, "updateContext": null }, - "start": 4795, - "end": 4796, + "start": 4683, + "end": 4684, "loc": { "start": { - "line": 163, + "line": 158, "column": 11 }, "end": { - "line": 163, + "line": 158, "column": 12 } } @@ -19910,15 +18964,15 @@ "updateContext": null }, "value": "=", - "start": 4797, - "end": 4798, + "start": 4685, + "end": 4686, "loc": { "start": { - "line": 163, + "line": 158, "column": 13 }, "end": { - "line": 163, + "line": 158, "column": 14 } } @@ -19936,15 +18990,15 @@ "binop": null }, "value": "data", - "start": 4799, - "end": 4803, + "start": 4687, + "end": 4691, "loc": { "start": { - "line": 163, + "line": 158, "column": 15 }, "end": { - "line": 163, + "line": 158, "column": 19 } } @@ -19962,15 +19016,15 @@ "binop": null, "updateContext": null }, - "start": 4803, - "end": 4804, + "start": 4691, + "end": 4692, "loc": { "start": { - "line": 163, + "line": 158, "column": 19 }, "end": { - "line": 163, + "line": 158, "column": 20 } } @@ -19988,15 +19042,15 @@ "binop": null }, "value": "key", - "start": 4804, - "end": 4807, + "start": 4692, + "end": 4695, "loc": { "start": { - "line": 163, + "line": 158, "column": 20 }, "end": { - "line": 163, + "line": 158, "column": 23 } } @@ -20014,15 +19068,15 @@ "binop": null, "updateContext": null }, - "start": 4807, - "end": 4808, + "start": 4695, + "end": 4696, "loc": { "start": { - "line": 163, + "line": 158, "column": 23 }, "end": { - "line": 163, + "line": 158, "column": 24 } } @@ -20039,15 +19093,15 @@ "postfix": false, "binop": null }, - "start": 4811, - "end": 4812, + "start": 4699, + "end": 4700, "loc": { "start": { - "line": 164, + "line": 159, "column": 2 }, "end": { - "line": 164, + "line": 159, "column": 3 } } @@ -20067,15 +19121,15 @@ "updateContext": null }, "value": "return", - "start": 4816, - "end": 4822, + "start": 4704, + "end": 4710, "loc": { "start": { - "line": 166, + "line": 161, "column": 2 }, "end": { - "line": 166, + "line": 161, "column": 8 } } @@ -20095,15 +19149,15 @@ "updateContext": null }, "value": "this", - "start": 4823, - "end": 4827, + "start": 4711, + "end": 4715, "loc": { "start": { - "line": 166, + "line": 161, "column": 9 }, "end": { - "line": 166, + "line": 161, "column": 13 } } @@ -20120,15 +19174,15 @@ "postfix": false, "binop": null }, - "start": 4829, - "end": 4830, + "start": 4717, + "end": 4718, "loc": { "start": { - "line": 167, + "line": 162, "column": 1 }, "end": { - "line": 167, + "line": 162, "column": 2 } } @@ -20136,15 +19190,15 @@ { "type": "CommentBlock", "value": "*\n\t * Removes a component from the entity - has no effect when it doesn't exist.\n\t * Can specify an onRemove() method in your component which gets called before it is removed.\n\t * If nothing is specified, then nothing will be removed. Use removeAll() to remove all components.\n\t *\n\t * @example\n\t * entity.remove('position')\n\t *\n\t * @param {...string} [components] - The component names to remove from the entity.\n\t *\n\t * @return {Object} The original entity that remove() was called on, so that operations can be chained.\n\t ", - "start": 4833, - "end": 5361, + "start": 4721, + "end": 5249, "loc": { "start": { - "line": 169, + "line": 164, "column": 1 }, "end": { - "line": 180, + "line": 175, "column": 4 } } @@ -20162,15 +19216,15 @@ "binop": null }, "value": "remove", - "start": 5363, - "end": 5369, + "start": 5251, + "end": 5257, "loc": { "start": { - "line": 181, + "line": 176, "column": 1 }, "end": { - "line": 181, + "line": 176, "column": 7 } } @@ -20187,15 +19241,15 @@ "postfix": false, "binop": null }, - "start": 5369, - "end": 5370, + "start": 5257, + "end": 5258, "loc": { "start": { - "line": 181, + "line": 176, "column": 7 }, "end": { - "line": 181, + "line": 176, "column": 8 } } @@ -20213,15 +19267,15 @@ "binop": null, "updateContext": null }, - "start": 5370, - "end": 5373, + "start": 5258, + "end": 5261, "loc": { "start": { - "line": 181, + "line": 176, "column": 8 }, "end": { - "line": 181, + "line": 176, "column": 11 } } @@ -20239,15 +19293,15 @@ "binop": null }, "value": "components", - "start": 5373, - "end": 5383, + "start": 5261, + "end": 5271, "loc": { "start": { - "line": 181, + "line": 176, "column": 11 }, "end": { - "line": 181, + "line": 176, "column": 21 } } @@ -20264,15 +19318,15 @@ "postfix": false, "binop": null }, - "start": 5383, - "end": 5384, + "start": 5271, + "end": 5272, "loc": { "start": { - "line": 181, + "line": 176, "column": 21 }, "end": { - "line": 181, + "line": 176, "column": 22 } } @@ -20289,15 +19343,15 @@ "postfix": false, "binop": null }, - "start": 5385, - "end": 5386, + "start": 5273, + "end": 5274, "loc": { "start": { - "line": 181, + "line": 176, "column": 23 }, "end": { - "line": 181, + "line": 176, "column": 24 } } @@ -20317,15 +19371,15 @@ "updateContext": null }, "value": "for", - "start": 5389, - "end": 5392, + "start": 5277, + "end": 5280, "loc": { "start": { - "line": 182, + "line": 177, "column": 2 }, "end": { - "line": 182, + "line": 177, "column": 5 } } @@ -20342,15 +19396,15 @@ "postfix": false, "binop": null }, - "start": 5393, - "end": 5394, + "start": 5281, + "end": 5282, "loc": { "start": { - "line": 182, + "line": 177, "column": 6 }, "end": { - "line": 182, + "line": 177, "column": 7 } } @@ -20370,15 +19424,15 @@ "updateContext": null }, "value": "let", - "start": 5394, - "end": 5397, + "start": 5282, + "end": 5285, "loc": { "start": { - "line": 182, + "line": 177, "column": 7 }, "end": { - "line": 182, + "line": 177, "column": 10 } } @@ -20396,15 +19450,15 @@ "binop": null }, "value": "component", - "start": 5398, - "end": 5407, + "start": 5286, + "end": 5295, "loc": { "start": { - "line": 182, + "line": 177, "column": 11 }, "end": { - "line": 182, + "line": 177, "column": 20 } } @@ -20422,15 +19476,15 @@ "binop": null }, "value": "of", - "start": 5408, - "end": 5410, + "start": 5296, + "end": 5298, "loc": { "start": { - "line": 182, + "line": 177, "column": 21 }, "end": { - "line": 182, + "line": 177, "column": 23 } } @@ -20448,15 +19502,15 @@ "binop": null }, "value": "components", - "start": 5411, - "end": 5421, + "start": 5299, + "end": 5309, "loc": { "start": { - "line": 182, + "line": 177, "column": 24 }, "end": { - "line": 182, + "line": 177, "column": 34 } } @@ -20473,15 +19527,15 @@ "postfix": false, "binop": null }, - "start": 5421, - "end": 5422, + "start": 5309, + "end": 5310, "loc": { "start": { - "line": 182, + "line": 177, "column": 34 }, "end": { - "line": 182, + "line": 177, "column": 35 } } @@ -20498,15 +19552,15 @@ "postfix": false, "binop": null }, - "start": 5423, - "end": 5424, + "start": 5311, + "end": 5312, "loc": { "start": { - "line": 182, + "line": 177, "column": 36 }, "end": { - "line": 182, + "line": 177, "column": 37 } } @@ -20526,15 +19580,15 @@ "updateContext": null }, "value": "if", - "start": 5428, - "end": 5430, + "start": 5316, + "end": 5318, "loc": { "start": { - "line": 183, + "line": 178, "column": 3 }, "end": { - "line": 183, + "line": 178, "column": 5 } } @@ -20551,15 +19605,15 @@ "postfix": false, "binop": null }, - "start": 5431, - "end": 5432, + "start": 5319, + "end": 5320, "loc": { "start": { - "line": 183, + "line": 178, "column": 6 }, "end": { - "line": 183, + "line": 178, "column": 7 } } @@ -20577,15 +19631,15 @@ "binop": null }, "value": "component", - "start": 5432, - "end": 5441, + "start": 5320, + "end": 5329, "loc": { "start": { - "line": 183, + "line": 178, "column": 7 }, "end": { - "line": 183, + "line": 178, "column": 16 } } @@ -20605,15 +19659,15 @@ "updateContext": null }, "value": "in", - "start": 5442, - "end": 5444, + "start": 5330, + "end": 5332, "loc": { "start": { - "line": 183, + "line": 178, "column": 17 }, "end": { - "line": 183, + "line": 178, "column": 19 } } @@ -20633,15 +19687,15 @@ "updateContext": null }, "value": "this", - "start": 5445, - "end": 5449, + "start": 5333, + "end": 5337, "loc": { "start": { - "line": 183, + "line": 178, "column": 20 }, "end": { - "line": 183, + "line": 178, "column": 24 } } @@ -20659,15 +19713,15 @@ "binop": null, "updateContext": null }, - "start": 5449, - "end": 5450, + "start": 5337, + "end": 5338, "loc": { "start": { - "line": 183, + "line": 178, "column": 24 }, "end": { - "line": 183, + "line": 178, "column": 25 } } @@ -20685,15 +19739,15 @@ "binop": null }, "value": "data", - "start": 5450, - "end": 5454, + "start": 5338, + "end": 5342, "loc": { "start": { - "line": 183, + "line": 178, "column": 25 }, "end": { - "line": 183, + "line": 178, "column": 29 } } @@ -20710,15 +19764,15 @@ "postfix": false, "binop": null }, - "start": 5454, - "end": 5455, + "start": 5342, + "end": 5343, "loc": { "start": { - "line": 183, + "line": 178, "column": 29 }, "end": { - "line": 183, + "line": 178, "column": 30 } } @@ -20735,15 +19789,15 @@ "postfix": false, "binop": null }, - "start": 5456, - "end": 5457, + "start": 5344, + "end": 5345, "loc": { "start": { - "line": 183, + "line": 178, "column": 31 }, "end": { - "line": 183, + "line": 178, "column": 32 } } @@ -20751,15 +19805,15 @@ { "type": "CommentLine", "value": " Call custom onRemove", - "start": 5463, - "end": 5486, + "start": 5351, + "end": 5374, "loc": { "start": { - "line": 185, + "line": 180, "column": 4 }, "end": { - "line": 185, + "line": 180, "column": 27 } } @@ -20777,15 +19831,15 @@ "binop": null }, "value": "invoke", - "start": 5491, - "end": 5497, + "start": 5379, + "end": 5385, "loc": { "start": { - "line": 186, + "line": 181, "column": 4 }, "end": { - "line": 186, + "line": 181, "column": 10 } } @@ -20802,15 +19856,15 @@ "postfix": false, "binop": null }, - "start": 5497, - "end": 5498, + "start": 5385, + "end": 5386, "loc": { "start": { - "line": 186, + "line": 181, "column": 10 }, "end": { - "line": 186, + "line": 181, "column": 11 } } @@ -20830,15 +19884,15 @@ "updateContext": null }, "value": "this", - "start": 5498, - "end": 5502, + "start": 5386, + "end": 5390, "loc": { "start": { - "line": 186, + "line": 181, "column": 11 }, "end": { - "line": 186, + "line": 181, "column": 15 } } @@ -20856,15 +19910,15 @@ "binop": null, "updateContext": null }, - "start": 5502, - "end": 5503, + "start": 5390, + "end": 5391, "loc": { "start": { - "line": 186, + "line": 181, "column": 15 }, "end": { - "line": 186, + "line": 181, "column": 16 } } @@ -20882,15 +19936,15 @@ "binop": null }, "value": "data", - "start": 5503, - "end": 5507, + "start": 5391, + "end": 5395, "loc": { "start": { - "line": 186, + "line": 181, "column": 16 }, "end": { - "line": 186, + "line": 181, "column": 20 } } @@ -20908,15 +19962,15 @@ "binop": null, "updateContext": null }, - "start": 5507, - "end": 5508, + "start": 5395, + "end": 5396, "loc": { "start": { - "line": 186, + "line": 181, "column": 20 }, "end": { - "line": 186, + "line": 181, "column": 21 } } @@ -20934,15 +19988,15 @@ "binop": null }, "value": "component", - "start": 5508, - "end": 5517, + "start": 5396, + "end": 5405, "loc": { "start": { - "line": 186, + "line": 181, "column": 21 }, "end": { - "line": 186, + "line": 181, "column": 30 } } @@ -20960,15 +20014,15 @@ "binop": null, "updateContext": null }, - "start": 5517, - "end": 5518, + "start": 5405, + "end": 5406, "loc": { "start": { - "line": 186, + "line": 181, "column": 30 }, "end": { - "line": 186, + "line": 181, "column": 31 } } @@ -20986,15 +20040,15 @@ "binop": null, "updateContext": null }, - "start": 5518, - "end": 5519, + "start": 5406, + "end": 5407, "loc": { "start": { - "line": 186, + "line": 181, "column": 31 }, "end": { - "line": 186, + "line": 181, "column": 32 } } @@ -21013,15 +20067,15 @@ "updateContext": null }, "value": "onRemove", - "start": 5520, - "end": 5530, + "start": 5408, + "end": 5418, "loc": { "start": { - "line": 186, + "line": 181, "column": 33 }, "end": { - "line": 186, + "line": 181, "column": 43 } } @@ -21038,15 +20092,15 @@ "postfix": false, "binop": null }, - "start": 5530, - "end": 5531, + "start": 5418, + "end": 5419, "loc": { "start": { - "line": 186, + "line": 181, "column": 43 }, "end": { - "line": 186, + "line": 181, "column": 44 } } @@ -21054,15 +20108,15 @@ { "type": "CommentLine", "value": " Remove from index", - "start": 5537, - "end": 5557, + "start": 5425, + "end": 5445, "loc": { "start": { - "line": 188, + "line": 183, "column": 4 }, "end": { - "line": 188, + "line": 183, "column": 24 } } @@ -21082,15 +20136,15 @@ "updateContext": null }, "value": "if", - "start": 5562, - "end": 5564, + "start": 5450, + "end": 5452, "loc": { "start": { - "line": 189, + "line": 184, "column": 4 }, "end": { - "line": 189, + "line": 184, "column": 6 } } @@ -21107,15 +20161,15 @@ "postfix": false, "binop": null }, - "start": 5565, - "end": 5566, + "start": 5453, + "end": 5454, "loc": { "start": { - "line": 189, + "line": 184, "column": 7 }, "end": { - "line": 189, + "line": 184, "column": 8 } } @@ -21135,15 +20189,15 @@ "updateContext": null }, "value": "this", - "start": 5566, - "end": 5570, + "start": 5454, + "end": 5458, "loc": { "start": { - "line": 189, + "line": 184, "column": 8 }, "end": { - "line": 189, + "line": 184, "column": 12 } } @@ -21161,15 +20215,15 @@ "binop": null, "updateContext": null }, - "start": 5570, - "end": 5571, + "start": 5458, + "end": 5459, "loc": { "start": { - "line": 189, + "line": 184, "column": 12 }, "end": { - "line": 189, + "line": 184, "column": 13 } } @@ -21187,15 +20241,15 @@ "binop": null }, "value": "valid", - "start": 5571, - "end": 5576, + "start": 5459, + "end": 5464, "loc": { "start": { - "line": 189, + "line": 184, "column": 13 }, "end": { - "line": 189, + "line": 184, "column": 18 } } @@ -21212,15 +20266,15 @@ "postfix": false, "binop": null }, - "start": 5576, - "end": 5577, + "start": 5464, + "end": 5465, "loc": { "start": { - "line": 189, + "line": 184, "column": 18 }, "end": { - "line": 189, + "line": 184, "column": 19 } } @@ -21237,15 +20291,15 @@ "postfix": false, "binop": null }, - "start": 5577, - "end": 5578, + "start": 5465, + "end": 5466, "loc": { "start": { - "line": 189, + "line": 184, "column": 19 }, "end": { - "line": 189, + "line": 184, "column": 20 } } @@ -21262,15 +20316,15 @@ "postfix": false, "binop": null }, - "start": 5578, - "end": 5579, + "start": 5466, + "end": 5467, "loc": { "start": { - "line": 189, + "line": 184, "column": 20 }, "end": { - "line": 189, + "line": 184, "column": 21 } } @@ -21287,15 +20341,15 @@ "postfix": false, "binop": null }, - "start": 5580, - "end": 5581, + "start": 5468, + "end": 5469, "loc": { "start": { - "line": 189, + "line": 184, "column": 22 }, "end": { - "line": 189, + "line": 184, "column": 23 } } @@ -21315,15 +20369,15 @@ "updateContext": null }, "value": "this", - "start": 5587, - "end": 5591, + "start": 5475, + "end": 5479, "loc": { "start": { - "line": 190, + "line": 185, "column": 5 }, "end": { - "line": 190, + "line": 185, "column": 9 } } @@ -21341,15 +20395,15 @@ "binop": null, "updateContext": null }, - "start": 5591, - "end": 5592, + "start": 5479, + "end": 5480, "loc": { "start": { - "line": 190, + "line": 185, "column": 9 }, "end": { - "line": 190, + "line": 185, "column": 10 } } @@ -21367,15 +20421,15 @@ "binop": null }, "value": "world", - "start": 5592, - "end": 5597, + "start": 5480, + "end": 5485, "loc": { "start": { - "line": 190, + "line": 185, "column": 10 }, "end": { - "line": 190, + "line": 185, "column": 15 } } @@ -21393,15 +20447,15 @@ "binop": null, "updateContext": null }, - "start": 5597, - "end": 5598, + "start": 5485, + "end": 5486, "loc": { "start": { - "line": 190, + "line": 185, "column": 15 }, "end": { - "line": 190, + "line": 185, "column": 16 } } @@ -21419,15 +20473,15 @@ "binop": null }, "value": "index", - "start": 5598, - "end": 5603, + "start": 5486, + "end": 5491, "loc": { "start": { - "line": 190, + "line": 185, "column": 16 }, "end": { - "line": 190, + "line": 185, "column": 21 } } @@ -21445,15 +20499,15 @@ "binop": null, "updateContext": null }, - "start": 5603, - "end": 5604, + "start": 5491, + "end": 5492, "loc": { "start": { - "line": 190, + "line": 185, "column": 21 }, "end": { - "line": 190, + "line": 185, "column": 22 } } @@ -21471,15 +20525,15 @@ "binop": null }, "value": "remove", - "start": 5604, - "end": 5610, + "start": 5492, + "end": 5498, "loc": { "start": { - "line": 190, + "line": 185, "column": 22 }, "end": { - "line": 190, + "line": 185, "column": 28 } } @@ -21496,15 +20550,15 @@ "postfix": false, "binop": null }, - "start": 5610, - "end": 5611, + "start": 5498, + "end": 5499, "loc": { "start": { - "line": 190, + "line": 185, "column": 28 }, "end": { - "line": 190, + "line": 185, "column": 29 } } @@ -21524,15 +20578,15 @@ "updateContext": null }, "value": "this", - "start": 5611, - "end": 5615, + "start": 5499, + "end": 5503, "loc": { "start": { - "line": 190, + "line": 185, "column": 29 }, "end": { - "line": 190, + "line": 185, "column": 33 } } @@ -21550,15 +20604,15 @@ "binop": null, "updateContext": null }, - "start": 5615, - "end": 5616, + "start": 5503, + "end": 5504, "loc": { "start": { - "line": 190, + "line": 185, "column": 33 }, "end": { - "line": 190, + "line": 185, "column": 34 } } @@ -21576,15 +20630,15 @@ "binop": null }, "value": "component", - "start": 5617, - "end": 5626, + "start": 5505, + "end": 5514, "loc": { "start": { - "line": 190, + "line": 185, "column": 35 }, "end": { - "line": 190, + "line": 185, "column": 44 } } @@ -21601,15 +20655,15 @@ "postfix": false, "binop": null }, - "start": 5626, - "end": 5627, + "start": 5514, + "end": 5515, "loc": { "start": { - "line": 190, + "line": 185, "column": 44 }, "end": { - "line": 190, + "line": 185, "column": 45 } } @@ -21626,15 +20680,15 @@ "postfix": false, "binop": null }, - "start": 5632, - "end": 5633, + "start": 5520, + "end": 5521, "loc": { "start": { - "line": 191, + "line": 186, "column": 4 }, "end": { - "line": 191, + "line": 186, "column": 5 } } @@ -21642,15 +20696,15 @@ { "type": "CommentLine", "value": " Remove from entity", - "start": 5639, - "end": 5660, + "start": 5527, + "end": 5548, "loc": { "start": { - "line": 193, + "line": 188, "column": 4 }, "end": { - "line": 193, + "line": 188, "column": 25 } } @@ -21670,15 +20724,15 @@ "updateContext": null }, "value": "delete", - "start": 5665, - "end": 5671, + "start": 5553, + "end": 5559, "loc": { "start": { - "line": 194, + "line": 189, "column": 4 }, "end": { - "line": 194, + "line": 189, "column": 10 } } @@ -21698,15 +20752,15 @@ "updateContext": null }, "value": "this", - "start": 5672, - "end": 5676, + "start": 5560, + "end": 5564, "loc": { "start": { - "line": 194, + "line": 189, "column": 11 }, "end": { - "line": 194, + "line": 189, "column": 15 } } @@ -21724,15 +20778,15 @@ "binop": null, "updateContext": null }, - "start": 5676, - "end": 5677, + "start": 5564, + "end": 5565, "loc": { "start": { - "line": 194, + "line": 189, "column": 15 }, "end": { - "line": 194, + "line": 189, "column": 16 } } @@ -21750,15 +20804,15 @@ "binop": null }, "value": "data", - "start": 5677, - "end": 5681, + "start": 5565, + "end": 5569, "loc": { "start": { - "line": 194, + "line": 189, "column": 16 }, "end": { - "line": 194, + "line": 189, "column": 20 } } @@ -21776,15 +20830,15 @@ "binop": null, "updateContext": null }, - "start": 5681, - "end": 5682, + "start": 5569, + "end": 5570, "loc": { "start": { - "line": 194, + "line": 189, "column": 20 }, "end": { - "line": 194, + "line": 189, "column": 21 } } @@ -21802,15 +20856,15 @@ "binop": null }, "value": "component", - "start": 5682, - "end": 5691, + "start": 5570, + "end": 5579, "loc": { "start": { - "line": 194, + "line": 189, "column": 21 }, "end": { - "line": 194, + "line": 189, "column": 30 } } @@ -21828,15 +20882,15 @@ "binop": null, "updateContext": null }, - "start": 5691, - "end": 5692, + "start": 5579, + "end": 5580, "loc": { "start": { - "line": 194, + "line": 189, "column": 30 }, "end": { - "line": 194, + "line": 189, "column": 31 } } @@ -21853,15 +20907,15 @@ "postfix": false, "binop": null }, - "start": 5696, - "end": 5697, + "start": 5584, + "end": 5585, "loc": { "start": { - "line": 195, + "line": 190, "column": 3 }, "end": { - "line": 195, + "line": 190, "column": 4 } } @@ -21878,15 +20932,15 @@ "postfix": false, "binop": null }, - "start": 5700, - "end": 5701, + "start": 5588, + "end": 5589, "loc": { "start": { - "line": 196, + "line": 191, "column": 2 }, "end": { - "line": 196, + "line": 191, "column": 3 } } @@ -21906,15 +20960,15 @@ "updateContext": null }, "value": "return", - "start": 5704, - "end": 5710, + "start": 5592, + "end": 5598, "loc": { "start": { - "line": 197, + "line": 192, "column": 2 }, "end": { - "line": 197, + "line": 192, "column": 8 } } @@ -21934,15 +20988,15 @@ "updateContext": null }, "value": "this", - "start": 5711, - "end": 5715, + "start": 5599, + "end": 5603, "loc": { "start": { - "line": 197, + "line": 192, "column": 9 }, "end": { - "line": 197, + "line": 192, "column": 13 } } @@ -21959,15 +21013,15 @@ "postfix": false, "binop": null }, - "start": 5717, - "end": 5718, + "start": 5605, + "end": 5606, "loc": { "start": { - "line": 198, + "line": 193, "column": 1 }, "end": { - "line": 198, + "line": 193, "column": 2 } } @@ -21975,15 +21029,15 @@ { "type": "CommentLine", "value": " Remove all components", - "start": 5721, - "end": 5745, + "start": 5609, + "end": 5633, "loc": { "start": { - "line": 200, + "line": 195, "column": 1 }, "end": { - "line": 200, + "line": 195, "column": 25 } } @@ -21991,15 +21045,15 @@ { "type": "CommentBlock", "value": "*\n\t * Removes all components from the entity.\n\t *\n\t * @example\n\t * entity.removeAll()\n\t *\n\t * @return {Object} The original entity that removeAll() was called on, so that operations can be chained.\n\t ", - "start": 5748, - "end": 5952, + "start": 5636, + "end": 5840, "loc": { "start": { - "line": 202, + "line": 197, "column": 1 }, "end": { - "line": 209, + "line": 204, "column": 4 } } @@ -22017,15 +21071,15 @@ "binop": null }, "value": "removeAll", - "start": 5954, - "end": 5963, + "start": 5842, + "end": 5851, "loc": { "start": { - "line": 210, + "line": 205, "column": 1 }, "end": { - "line": 210, + "line": 205, "column": 10 } } @@ -22042,15 +21096,15 @@ "postfix": false, "binop": null }, - "start": 5963, - "end": 5964, + "start": 5851, + "end": 5852, "loc": { "start": { - "line": 210, + "line": 205, "column": 10 }, "end": { - "line": 210, + "line": 205, "column": 11 } } @@ -22067,15 +21121,15 @@ "postfix": false, "binop": null }, - "start": 5964, - "end": 5965, + "start": 5852, + "end": 5853, "loc": { "start": { - "line": 210, + "line": 205, "column": 11 }, "end": { - "line": 210, + "line": 205, "column": 12 } } @@ -22092,15 +21146,15 @@ "postfix": false, "binop": null }, - "start": 5966, - "end": 5967, + "start": 5854, + "end": 5855, "loc": { "start": { - "line": 210, + "line": 205, "column": 13 }, "end": { - "line": 210, + "line": 205, "column": 14 } } @@ -22120,15 +21174,15 @@ "updateContext": null }, "value": "this", - "start": 5970, - "end": 5974, + "start": 5858, + "end": 5862, "loc": { "start": { - "line": 211, + "line": 206, "column": 2 }, "end": { - "line": 211, + "line": 206, "column": 6 } } @@ -22146,15 +21200,15 @@ "binop": null, "updateContext": null }, - "start": 5974, - "end": 5975, + "start": 5862, + "end": 5863, "loc": { "start": { - "line": 211, + "line": 206, "column": 6 }, "end": { - "line": 211, + "line": 206, "column": 7 } } @@ -22172,15 +21226,15 @@ "binop": null }, "value": "remove", - "start": 5975, - "end": 5981, + "start": 5863, + "end": 5869, "loc": { "start": { - "line": 211, + "line": 206, "column": 7 }, "end": { - "line": 211, + "line": 206, "column": 13 } } @@ -22197,15 +21251,15 @@ "postfix": false, "binop": null }, - "start": 5981, - "end": 5982, + "start": 5869, + "end": 5870, "loc": { "start": { - "line": 211, + "line": 206, "column": 13 }, "end": { - "line": 211, + "line": 206, "column": 14 } } @@ -22223,15 +21277,15 @@ "binop": null, "updateContext": null }, - "start": 5982, - "end": 5985, + "start": 5870, + "end": 5873, "loc": { "start": { - "line": 211, + "line": 206, "column": 14 }, "end": { - "line": 211, + "line": 206, "column": 17 } } @@ -22251,15 +21305,15 @@ "updateContext": null }, "value": "this", - "start": 5985, - "end": 5989, + "start": 5873, + "end": 5877, "loc": { "start": { - "line": 211, + "line": 206, "column": 17 }, "end": { - "line": 211, + "line": 206, "column": 21 } } @@ -22277,15 +21331,15 @@ "binop": null, "updateContext": null }, - "start": 5989, - "end": 5990, + "start": 5877, + "end": 5878, "loc": { "start": { - "line": 211, + "line": 206, "column": 21 }, "end": { - "line": 211, + "line": 206, "column": 22 } } @@ -22303,15 +21357,15 @@ "binop": null }, "value": "components", - "start": 5990, - "end": 6000, + "start": 5878, + "end": 5888, "loc": { "start": { - "line": 211, + "line": 206, "column": 22 }, "end": { - "line": 211, + "line": 206, "column": 32 } } @@ -22328,15 +21382,15 @@ "postfix": false, "binop": null }, - "start": 6000, - "end": 6001, + "start": 5888, + "end": 5889, "loc": { "start": { - "line": 211, + "line": 206, "column": 32 }, "end": { - "line": 211, + "line": 206, "column": 33 } } @@ -22356,15 +21410,15 @@ "updateContext": null }, "value": "if", - "start": 6005, - "end": 6007, + "start": 5893, + "end": 5895, "loc": { "start": { - "line": 213, + "line": 208, "column": 2 }, "end": { - "line": 213, + "line": 208, "column": 4 } } @@ -22381,15 +21435,15 @@ "postfix": false, "binop": null }, - "start": 6008, - "end": 6009, + "start": 5896, + "end": 5897, "loc": { "start": { - "line": 213, + "line": 208, "column": 5 }, "end": { - "line": 213, + "line": 208, "column": 6 } } @@ -22409,15 +21463,15 @@ "updateContext": null }, "value": "this", - "start": 6009, - "end": 6013, + "start": 5897, + "end": 5901, "loc": { "start": { - "line": 213, + "line": 208, "column": 6 }, "end": { - "line": 213, + "line": 208, "column": 10 } } @@ -22435,15 +21489,15 @@ "binop": null, "updateContext": null }, - "start": 6013, - "end": 6014, + "start": 5901, + "end": 5902, "loc": { "start": { - "line": 213, + "line": 208, "column": 10 }, "end": { - "line": 213, + "line": 208, "column": 11 } } @@ -22461,15 +21515,15 @@ "binop": null }, "value": "components", - "start": 6014, - "end": 6024, + "start": 5902, + "end": 5912, "loc": { "start": { - "line": 213, + "line": 208, "column": 11 }, "end": { - "line": 213, + "line": 208, "column": 21 } } @@ -22487,15 +21541,15 @@ "binop": null, "updateContext": null }, - "start": 6024, - "end": 6025, + "start": 5912, + "end": 5913, "loc": { "start": { - "line": 213, + "line": 208, "column": 21 }, "end": { - "line": 213, + "line": 208, "column": 22 } } @@ -22513,15 +21567,15 @@ "binop": null }, "value": "length", - "start": 6025, - "end": 6031, + "start": 5913, + "end": 5919, "loc": { "start": { - "line": 213, + "line": 208, "column": 22 }, "end": { - "line": 213, + "line": 208, "column": 28 } } @@ -22540,15 +21594,15 @@ "updateContext": null }, "value": ">", - "start": 6032, - "end": 6033, + "start": 5920, + "end": 5921, "loc": { "start": { - "line": 213, + "line": 208, "column": 29 }, "end": { - "line": 213, + "line": 208, "column": 30 } } @@ -22567,15 +21621,15 @@ "updateContext": null }, "value": 0, - "start": 6034, - "end": 6035, + "start": 5922, + "end": 5923, "loc": { "start": { - "line": 213, + "line": 208, "column": 31 }, "end": { - "line": 213, + "line": 208, "column": 32 } } @@ -22592,15 +21646,15 @@ "postfix": false, "binop": null }, - "start": 6035, - "end": 6036, + "start": 5923, + "end": 5924, "loc": { "start": { - "line": 213, + "line": 208, "column": 32 }, "end": { - "line": 213, + "line": 208, "column": 33 } } @@ -22617,15 +21671,15 @@ "postfix": false, "binop": null }, - "start": 6037, - "end": 6038, + "start": 5925, + "end": 5926, "loc": { "start": { - "line": 213, + "line": 208, "column": 34 }, "end": { - "line": 213, + "line": 208, "column": 35 } } @@ -22645,15 +21699,15 @@ "updateContext": null }, "value": "throw", - "start": 6042, - "end": 6047, + "start": 5930, + "end": 5935, "loc": { "start": { - "line": 214, + "line": 209, "column": 3 }, "end": { - "line": 214, + "line": 209, "column": 8 } } @@ -22673,15 +21727,15 @@ "updateContext": null }, "value": "new", - "start": 6048, - "end": 6051, + "start": 5936, + "end": 5939, "loc": { "start": { - "line": 214, + "line": 209, "column": 9 }, "end": { - "line": 214, + "line": 209, "column": 12 } } @@ -22699,15 +21753,15 @@ "binop": null }, "value": "Error", - "start": 6052, - "end": 6057, + "start": 5940, + "end": 5945, "loc": { "start": { - "line": 214, + "line": 209, "column": 13 }, "end": { - "line": 214, + "line": 209, "column": 18 } } @@ -22724,15 +21778,15 @@ "postfix": false, "binop": null }, - "start": 6057, - "end": 6058, + "start": 5945, + "end": 5946, "loc": { "start": { - "line": 214, + "line": 209, "column": 18 }, "end": { - "line": 214, + "line": 209, "column": 19 } } @@ -22751,15 +21805,15 @@ "updateContext": null }, "value": "Failed to remove all components. Components must have been added during the removeAll().", - "start": 6058, - "end": 6148, + "start": 5946, + "end": 6036, "loc": { "start": { - "line": 214, + "line": 209, "column": 19 }, "end": { - "line": 214, + "line": 209, "column": 109 } } @@ -22776,15 +21830,15 @@ "postfix": false, "binop": null }, - "start": 6148, - "end": 6149, + "start": 6036, + "end": 6037, "loc": { "start": { - "line": 214, + "line": 209, "column": 109 }, "end": { - "line": 214, + "line": 209, "column": 110 } } @@ -22801,214 +21855,44 @@ "postfix": false, "binop": null }, - "start": 6152, - "end": 6153, - "loc": { - "start": { - "line": 215, - "column": 2 - }, - "end": { - "line": 215, - "column": 3 - } - } - }, - { - "type": { - "label": "return", - "keyword": "return", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "return", - "start": 6157, - "end": 6163, - "loc": { - "start": { - "line": 217, - "column": 2 - }, - "end": { - "line": 217, - "column": 8 - } - } - }, - { - "type": { - "label": "this", - "keyword": "this", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "this", - "start": 6164, - "end": 6168, - "loc": { - "start": { - "line": 217, - "column": 9 - }, - "end": { - "line": 217, - "column": 13 - } - } - }, - { - "type": { - "label": "}", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 6170, - "end": 6171, + "start": 6040, + "end": 6041, "loc": { "start": { - "line": 218, - "column": 1 - }, - "end": { - "line": 218, + "line": 210, "column": 2 - } - } - }, - { - "type": "CommentBlock", - "value": "*\n\t * Remove this entity and all of its components from the world. After an entity is destroyed, the object should be discarded,\n\t * and it is recommended to avoid re-using it.\n\t *\n\t * @example\n\t * entity.destroy()\n\t ", - "start": 6174, - "end": 6395, - "loc": { - "start": { - "line": 220, - "column": 1 - }, - "end": { - "line": 226, - "column": 4 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "destroy", - "start": 6397, - "end": 6404, - "loc": { - "start": { - "line": 227, - "column": 1 - }, - "end": { - "line": 227, - "column": 8 - } - } - }, - { - "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 6404, - "end": 6405, - "loc": { - "start": { - "line": 227, - "column": 8 - }, - "end": { - "line": 227, - "column": 9 - } - } - }, - { - "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 6405, - "end": 6406, - "loc": { - "start": { - "line": 227, - "column": 9 }, "end": { - "line": 227, - "column": 10 + "line": 210, + "column": 3 } } }, { "type": { - "label": "{", + "label": "return", + "keyword": "return", "beforeExpr": true, - "startsExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 6407, - "end": 6408, + "value": "return", + "start": 6045, + "end": 6051, "loc": { "start": { - "line": 227, - "column": 11 + "line": 212, + "column": 2 }, "end": { - "line": 227, - "column": 12 + "line": 212, + "column": 8 } } }, @@ -23027,22 +21911,22 @@ "updateContext": null }, "value": "this", - "start": 6411, - "end": 6415, + "start": 6052, + "end": 6056, "loc": { "start": { - "line": 228, - "column": 2 + "line": 212, + "column": 9 }, "end": { - "line": 228, - "column": 6 + "line": 212, + "column": 13 } } }, { "type": { - "label": ".", + "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -23050,52 +21934,41 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 6415, - "end": 6416, + "start": 6058, + "end": 6059, "loc": { "start": { - "line": 228, - "column": 6 + "line": 213, + "column": 1 }, "end": { - "line": 228, - "column": 7 + "line": 213, + "column": 2 } } }, { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "removeAll", - "start": 6416, - "end": 6425, + "type": "CommentBlock", + "value": "*\n\t * Remove this entity and all of its components from the world. After an entity is destroyed, the object should be discarded,\n\t * and it is recommended to avoid re-using it.\n\t *\n\t * @example\n\t * entity.destroy()\n\t ", + "start": 6062, + "end": 6283, "loc": { "start": { - "line": 228, - "column": 7 + "line": 215, + "column": 1 }, "end": { - "line": 228, - "column": 16 + "line": 221, + "column": 4 } } }, { "type": { - "label": "(", - "beforeExpr": true, + "label": "name", + "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -23104,24 +21977,25 @@ "postfix": false, "binop": null }, - "start": 6425, - "end": 6426, + "value": "destroy", + "start": 6285, + "end": 6292, "loc": { "start": { - "line": 228, - "column": 16 + "line": 222, + "column": 1 }, "end": { - "line": 228, - "column": 17 + "line": 222, + "column": 8 } } }, { "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, + "label": "(", + "beforeExpr": true, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -23129,23 +22003,22 @@ "postfix": false, "binop": null }, - "start": 6426, - "end": 6427, + "start": 6292, + "end": 6293, "loc": { "start": { - "line": 228, - "column": 17 + "line": 222, + "column": 8 }, "end": { - "line": 228, - "column": 18 + "line": 222, + "column": 9 } } }, { "type": { - "label": "if", - "keyword": "if", + "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -23153,26 +22026,24 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "value": "if", - "start": 6431, - "end": 6433, + "start": 6293, + "end": 6294, "loc": { "start": { - "line": 230, - "column": 2 + "line": 222, + "column": 9 }, "end": { - "line": 230, - "column": 4 + "line": 222, + "column": 10 } } }, { "type": { - "label": "(", + "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, @@ -23182,16 +22053,16 @@ "postfix": false, "binop": null }, - "start": 6434, - "end": 6435, + "start": 6295, + "end": 6296, "loc": { "start": { - "line": 230, - "column": 5 + "line": 222, + "column": 11 }, "end": { - "line": 230, - "column": 6 + "line": 222, + "column": 12 } } }, @@ -23210,16 +22081,16 @@ "updateContext": null }, "value": "this", - "start": 6435, - "end": 6439, + "start": 6299, + "end": 6303, "loc": { "start": { - "line": 230, - "column": 6 + "line": 223, + "column": 2 }, "end": { - "line": 230, - "column": 10 + "line": 223, + "column": 6 } } }, @@ -23236,16 +22107,16 @@ "binop": null, "updateContext": null }, - "start": 6439, - "end": 6440, + "start": 6303, + "end": 6304, "loc": { "start": { - "line": 230, - "column": 10 + "line": 223, + "column": 6 }, "end": { - "line": 230, - "column": 11 + "line": 223, + "column": 7 } } }, @@ -23261,16 +22132,16 @@ "postfix": false, "binop": null }, - "value": "valid", - "start": 6440, - "end": 6445, + "value": "removeAll", + "start": 6304, + "end": 6313, "loc": { "start": { - "line": 230, - "column": 11 + "line": 223, + "column": 7 }, "end": { - "line": 230, + "line": 223, "column": 16 } } @@ -23287,15 +22158,15 @@ "postfix": false, "binop": null }, - "start": 6445, - "end": 6446, + "start": 6313, + "end": 6314, "loc": { "start": { - "line": 230, + "line": 223, "column": 16 }, "end": { - "line": 230, + "line": 223, "column": 17 } } @@ -23312,22 +22183,23 @@ "postfix": false, "binop": null }, - "start": 6446, - "end": 6447, + "start": 6314, + "end": 6315, "loc": { "start": { - "line": 230, + "line": 223, "column": 17 }, "end": { - "line": 230, + "line": 223, "column": 18 } } }, { "type": { - "label": ")", + "label": "if", + "keyword": "if", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -23335,24 +22207,26 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 6447, - "end": 6448, + "value": "if", + "start": 6319, + "end": 6321, "loc": { "start": { - "line": 230, - "column": 18 + "line": 225, + "column": 2 }, "end": { - "line": 230, - "column": 19 + "line": 225, + "column": 4 } } }, { "type": { - "label": "{", + "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, @@ -23362,32 +22236,16 @@ "postfix": false, "binop": null }, - "start": 6449, - "end": 6450, - "loc": { - "start": { - "line": 230, - "column": 20 - }, - "end": { - "line": 230, - "column": 21 - } - } - }, - { - "type": "CommentLine", - "value": " Remove entity from the index, to update match all index", - "start": 6454, - "end": 6512, + "start": 6322, + "end": 6323, "loc": { "start": { - "line": 231, - "column": 3 + "line": 225, + "column": 5 }, "end": { - "line": 231, - "column": 61 + "line": 225, + "column": 6 } } }, @@ -23406,68 +22264,16 @@ "updateContext": null }, "value": "this", - "start": 6516, - "end": 6520, - "loc": { - "start": { - "line": 232, - "column": 3 - }, - "end": { - "line": 232, - "column": 7 - } - } - }, - { - "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 6520, - "end": 6521, - "loc": { - "start": { - "line": 232, - "column": 7 - }, - "end": { - "line": 232, - "column": 8 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "world", - "start": 6521, - "end": 6526, + "start": 6323, + "end": 6327, "loc": { "start": { - "line": 232, - "column": 8 + "line": 225, + "column": 6 }, "end": { - "line": 232, - "column": 13 + "line": 225, + "column": 10 } } }, @@ -23484,16 +22290,16 @@ "binop": null, "updateContext": null }, - "start": 6526, - "end": 6527, + "start": 6327, + "end": 6328, "loc": { "start": { - "line": 232, - "column": 13 + "line": 225, + "column": 10 }, "end": { - "line": 232, - "column": 14 + "line": 225, + "column": 11 } } }, @@ -23509,50 +22315,24 @@ "postfix": false, "binop": null }, - "value": "index", - "start": 6527, - "end": 6532, - "loc": { - "start": { - "line": 232, - "column": 14 - }, - "end": { - "line": 232, - "column": 19 - } - } - }, - { - "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 6532, - "end": 6533, + "value": "valid", + "start": 6328, + "end": 6333, "loc": { "start": { - "line": 232, - "column": 19 + "line": 225, + "column": 11 }, "end": { - "line": 232, - "column": 20 + "line": 225, + "column": 16 } } }, { "type": { - "label": "name", - "beforeExpr": false, + "label": "(", + "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -23561,25 +22341,24 @@ "postfix": false, "binop": null }, - "value": "removeEntity", - "start": 6533, - "end": 6545, + "start": 6333, + "end": 6334, "loc": { "start": { - "line": 232, - "column": 20 + "line": 225, + "column": 16 }, "end": { - "line": 232, - "column": 32 + "line": 225, + "column": 17 } } }, { "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, + "label": ")", + "beforeExpr": false, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -23587,52 +22366,49 @@ "postfix": false, "binop": null }, - "start": 6545, - "end": 6546, + "start": 6334, + "end": 6335, "loc": { "start": { - "line": 232, - "column": 32 + "line": 225, + "column": 17 }, "end": { - "line": 232, - "column": 33 + "line": 225, + "column": 18 } } }, { "type": { - "label": "this", - "keyword": "this", + "label": ")", "beforeExpr": false, - "startsExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "value": "this", - "start": 6546, - "end": 6550, + "start": 6335, + "end": 6336, "loc": { "start": { - "line": 232, - "column": 33 + "line": 225, + "column": 18 }, "end": { - "line": 232, - "column": 37 + "line": 225, + "column": 19 } } }, { "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, + "label": "{", + "beforeExpr": true, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -23640,31 +22416,31 @@ "postfix": false, "binop": null }, - "start": 6550, - "end": 6551, + "start": 6337, + "end": 6338, "loc": { "start": { - "line": 232, - "column": 37 + "line": 225, + "column": 20 }, "end": { - "line": 232, - "column": 38 + "line": 225, + "column": 21 } } }, { "type": "CommentLine", "value": " Remove from world", - "start": 6556, - "end": 6576, + "start": 6342, + "end": 6362, "loc": { "start": { - "line": 234, + "line": 226, "column": 3 }, "end": { - "line": 234, + "line": 226, "column": 23 } } @@ -23684,15 +22460,15 @@ "updateContext": null }, "value": "this", - "start": 6580, - "end": 6584, + "start": 6366, + "end": 6370, "loc": { "start": { - "line": 235, + "line": 227, "column": 3 }, "end": { - "line": 235, + "line": 227, "column": 7 } } @@ -23710,15 +22486,15 @@ "binop": null, "updateContext": null }, - "start": 6584, - "end": 6585, + "start": 6370, + "end": 6371, "loc": { "start": { - "line": 235, + "line": 227, "column": 7 }, "end": { - "line": 235, + "line": 227, "column": 8 } } @@ -23736,15 +22512,15 @@ "binop": null }, "value": "world", - "start": 6585, - "end": 6590, + "start": 6371, + "end": 6376, "loc": { "start": { - "line": 235, + "line": 227, "column": 8 }, "end": { - "line": 235, + "line": 227, "column": 13 } } @@ -23762,15 +22538,15 @@ "binop": null, "updateContext": null }, - "start": 6590, - "end": 6591, + "start": 6376, + "end": 6377, "loc": { "start": { - "line": 235, + "line": 227, "column": 13 }, "end": { - "line": 235, + "line": 227, "column": 14 } } @@ -23788,15 +22564,15 @@ "binop": null }, "value": "entities", - "start": 6591, - "end": 6599, + "start": 6377, + "end": 6385, "loc": { "start": { - "line": 235, + "line": 227, "column": 14 }, "end": { - "line": 235, + "line": 227, "column": 22 } } @@ -23814,15 +22590,15 @@ "binop": null, "updateContext": null }, - "start": 6599, - "end": 6600, + "start": 6385, + "end": 6386, "loc": { "start": { - "line": 235, + "line": 227, "column": 22 }, "end": { - "line": 235, + "line": 227, "column": 23 } } @@ -23842,15 +22618,15 @@ "updateContext": null }, "value": "delete", - "start": 6600, - "end": 6606, + "start": 6386, + "end": 6392, "loc": { "start": { - "line": 235, + "line": 227, "column": 23 }, "end": { - "line": 235, + "line": 227, "column": 29 } } @@ -23867,15 +22643,15 @@ "postfix": false, "binop": null }, - "start": 6606, - "end": 6607, + "start": 6392, + "end": 6393, "loc": { "start": { - "line": 235, + "line": 227, "column": 29 }, "end": { - "line": 235, + "line": 227, "column": 30 } } @@ -23895,15 +22671,15 @@ "updateContext": null }, "value": "this", - "start": 6607, - "end": 6611, + "start": 6393, + "end": 6397, "loc": { "start": { - "line": 235, + "line": 227, "column": 30 }, "end": { - "line": 235, + "line": 227, "column": 34 } } @@ -23921,15 +22697,15 @@ "binop": null, "updateContext": null }, - "start": 6611, - "end": 6612, + "start": 6397, + "end": 6398, "loc": { "start": { - "line": 235, + "line": 227, "column": 34 }, "end": { - "line": 235, + "line": 227, "column": 35 } } @@ -23947,15 +22723,15 @@ "binop": null }, "value": "_id", - "start": 6612, - "end": 6615, + "start": 6398, + "end": 6401, "loc": { "start": { - "line": 235, + "line": 227, "column": 35 }, "end": { - "line": 235, + "line": 227, "column": 38 } } @@ -23972,15 +22748,15 @@ "postfix": false, "binop": null }, - "start": 6615, - "end": 6616, + "start": 6401, + "end": 6402, "loc": { "start": { - "line": 235, + "line": 227, "column": 38 }, "end": { - "line": 235, + "line": 227, "column": 39 } } @@ -24000,15 +22776,15 @@ "updateContext": null }, "value": "this", - "start": 6620, - "end": 6624, + "start": 6406, + "end": 6410, "loc": { "start": { - "line": 236, + "line": 228, "column": 3 }, "end": { - "line": 236, + "line": 228, "column": 7 } } @@ -24026,15 +22802,15 @@ "binop": null, "updateContext": null }, - "start": 6624, - "end": 6625, + "start": 6410, + "end": 6411, "loc": { "start": { - "line": 236, + "line": 228, "column": 7 }, "end": { - "line": 236, + "line": 228, "column": 8 } } @@ -24052,15 +22828,15 @@ "binop": null }, "value": "_id", - "start": 6625, - "end": 6628, + "start": 6411, + "end": 6414, "loc": { "start": { - "line": 236, + "line": 228, "column": 8 }, "end": { - "line": 236, + "line": 228, "column": 11 } } @@ -24079,15 +22855,15 @@ "updateContext": null }, "value": "=", - "start": 6629, - "end": 6630, + "start": 6415, + "end": 6416, "loc": { "start": { - "line": 236, + "line": 228, "column": 12 }, "end": { - "line": 236, + "line": 228, "column": 13 } } @@ -24105,15 +22881,15 @@ "binop": null }, "value": "undefined", - "start": 6631, - "end": 6640, + "start": 6417, + "end": 6426, "loc": { "start": { - "line": 236, + "line": 228, "column": 14 }, "end": { - "line": 236, + "line": 228, "column": 23 } } @@ -24130,15 +22906,15 @@ "postfix": false, "binop": null }, - "start": 6643, - "end": 6644, + "start": 6429, + "end": 6430, "loc": { "start": { - "line": 237, + "line": 229, "column": 2 }, "end": { - "line": 237, + "line": 229, "column": 3 } } @@ -24155,15 +22931,15 @@ "postfix": false, "binop": null }, - "start": 6646, - "end": 6647, + "start": 6432, + "end": 6433, "loc": { "start": { - "line": 238, + "line": 230, "column": 1 }, "end": { - "line": 238, + "line": 230, "column": 2 } } @@ -24171,15 +22947,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns an array of component names this entity currently has.\n\t *\n\t * @return {Array} Array of component names.\n\t ", - "start": 6650, - "end": 6783, + "start": 6436, + "end": 6569, "loc": { "start": { - "line": 240, + "line": 232, "column": 1 }, "end": { - "line": 244, + "line": 236, "column": 4 } } @@ -24197,15 +22973,15 @@ "binop": null }, "value": "get", - "start": 6785, - "end": 6788, + "start": 6571, + "end": 6574, "loc": { "start": { - "line": 245, + "line": 237, "column": 1 }, "end": { - "line": 245, + "line": 237, "column": 4 } } @@ -24223,15 +22999,15 @@ "binop": null }, "value": "components", - "start": 6789, - "end": 6799, + "start": 6575, + "end": 6585, "loc": { "start": { - "line": 245, + "line": 237, "column": 5 }, "end": { - "line": 245, + "line": 237, "column": 15 } } @@ -24248,15 +23024,15 @@ "postfix": false, "binop": null }, - "start": 6799, - "end": 6800, + "start": 6585, + "end": 6586, "loc": { "start": { - "line": 245, + "line": 237, "column": 15 }, "end": { - "line": 245, + "line": 237, "column": 16 } } @@ -24273,15 +23049,15 @@ "postfix": false, "binop": null }, - "start": 6800, - "end": 6801, + "start": 6586, + "end": 6587, "loc": { "start": { - "line": 245, + "line": 237, "column": 16 }, "end": { - "line": 245, + "line": 237, "column": 17 } } @@ -24298,15 +23074,15 @@ "postfix": false, "binop": null }, - "start": 6802, - "end": 6803, + "start": 6588, + "end": 6589, "loc": { "start": { - "line": 245, + "line": 237, "column": 18 }, "end": { - "line": 245, + "line": 237, "column": 19 } } @@ -24326,15 +23102,15 @@ "updateContext": null }, "value": "return", - "start": 6806, - "end": 6812, + "start": 6592, + "end": 6598, "loc": { "start": { - "line": 246, + "line": 238, "column": 2 }, "end": { - "line": 246, + "line": 238, "column": 8 } } @@ -24352,15 +23128,15 @@ "binop": null }, "value": "Object", - "start": 6813, - "end": 6819, + "start": 6599, + "end": 6605, "loc": { "start": { - "line": 246, + "line": 238, "column": 9 }, "end": { - "line": 246, + "line": 238, "column": 15 } } @@ -24378,15 +23154,15 @@ "binop": null, "updateContext": null }, - "start": 6819, - "end": 6820, + "start": 6605, + "end": 6606, "loc": { "start": { - "line": 246, + "line": 238, "column": 15 }, "end": { - "line": 246, + "line": 238, "column": 16 } } @@ -24404,15 +23180,15 @@ "binop": null }, "value": "keys", - "start": 6820, - "end": 6824, + "start": 6606, + "end": 6610, "loc": { "start": { - "line": 246, + "line": 238, "column": 16 }, "end": { - "line": 246, + "line": 238, "column": 20 } } @@ -24429,15 +23205,15 @@ "postfix": false, "binop": null }, - "start": 6824, - "end": 6825, + "start": 6610, + "end": 6611, "loc": { "start": { - "line": 246, + "line": 238, "column": 20 }, "end": { - "line": 246, + "line": 238, "column": 21 } } @@ -24457,15 +23233,15 @@ "updateContext": null }, "value": "this", - "start": 6825, - "end": 6829, + "start": 6611, + "end": 6615, "loc": { "start": { - "line": 246, + "line": 238, "column": 21 }, "end": { - "line": 246, + "line": 238, "column": 25 } } @@ -24483,15 +23259,15 @@ "binop": null, "updateContext": null }, - "start": 6829, - "end": 6830, + "start": 6615, + "end": 6616, "loc": { "start": { - "line": 246, + "line": 238, "column": 25 }, "end": { - "line": 246, + "line": 238, "column": 26 } } @@ -24509,15 +23285,15 @@ "binop": null }, "value": "data", - "start": 6830, - "end": 6834, + "start": 6616, + "end": 6620, "loc": { "start": { - "line": 246, + "line": 238, "column": 26 }, "end": { - "line": 246, + "line": 238, "column": 30 } } @@ -24534,15 +23310,15 @@ "postfix": false, "binop": null }, - "start": 6834, - "end": 6835, + "start": 6620, + "end": 6621, "loc": { "start": { - "line": 246, + "line": 238, "column": 30 }, "end": { - "line": 246, + "line": 238, "column": 31 } } @@ -24559,15 +23335,15 @@ "postfix": false, "binop": null }, - "start": 6837, - "end": 6838, + "start": 6623, + "end": 6624, "loc": { "start": { - "line": 247, + "line": 239, "column": 1 }, "end": { - "line": 247, + "line": 239, "column": 2 } } @@ -24575,15 +23351,15 @@ { "type": "CommentBlock", "value": "* @ignore ", - "start": 6841, - "end": 6855, + "start": 6627, + "end": 6641, "loc": { "start": { - "line": 249, + "line": 241, "column": 1 }, "end": { - "line": 249, + "line": 241, "column": 15 } } @@ -24601,15 +23377,15 @@ "binop": null }, "value": "set", - "start": 6857, - "end": 6860, + "start": 6643, + "end": 6646, "loc": { "start": { - "line": 250, + "line": 242, "column": 1 }, "end": { - "line": 250, + "line": 242, "column": 4 } } @@ -24627,15 +23403,15 @@ "binop": null }, "value": "components", - "start": 6861, - "end": 6871, + "start": 6647, + "end": 6657, "loc": { "start": { - "line": 250, + "line": 242, "column": 5 }, "end": { - "line": 250, + "line": 242, "column": 15 } } @@ -24652,15 +23428,15 @@ "postfix": false, "binop": null }, - "start": 6871, - "end": 6872, + "start": 6657, + "end": 6658, "loc": { "start": { - "line": 250, + "line": 242, "column": 15 }, "end": { - "line": 250, + "line": 242, "column": 16 } } @@ -24678,15 +23454,15 @@ "binop": null }, "value": "c", - "start": 6872, - "end": 6873, + "start": 6658, + "end": 6659, "loc": { "start": { - "line": 250, + "line": 242, "column": 16 }, "end": { - "line": 250, + "line": 242, "column": 17 } } @@ -24703,15 +23479,15 @@ "postfix": false, "binop": null }, - "start": 6873, - "end": 6874, + "start": 6659, + "end": 6660, "loc": { "start": { - "line": 250, + "line": 242, "column": 17 }, "end": { - "line": 250, + "line": 242, "column": 18 } } @@ -24728,15 +23504,15 @@ "postfix": false, "binop": null }, - "start": 6875, - "end": 6876, + "start": 6661, + "end": 6662, "loc": { "start": { - "line": 250, + "line": 242, "column": 19 }, "end": { - "line": 250, + "line": 242, "column": 20 } } @@ -24756,15 +23532,15 @@ "updateContext": null }, "value": "throw", - "start": 6879, - "end": 6884, + "start": 6665, + "end": 6670, "loc": { "start": { - "line": 251, + "line": 243, "column": 2 }, "end": { - "line": 251, + "line": 243, "column": 7 } } @@ -24784,15 +23560,15 @@ "updateContext": null }, "value": "new", - "start": 6885, - "end": 6888, + "start": 6671, + "end": 6674, "loc": { "start": { - "line": 251, + "line": 243, "column": 8 }, "end": { - "line": 251, + "line": 243, "column": 11 } } @@ -24810,15 +23586,15 @@ "binop": null }, "value": "Error", - "start": 6889, - "end": 6894, + "start": 6675, + "end": 6680, "loc": { "start": { - "line": 251, + "line": 243, "column": 12 }, "end": { - "line": 251, + "line": 243, "column": 17 } } @@ -24835,15 +23611,15 @@ "postfix": false, "binop": null }, - "start": 6894, - "end": 6895, + "start": 6680, + "end": 6681, "loc": { "start": { - "line": 251, + "line": 243, "column": 17 }, "end": { - "line": 251, + "line": 243, "column": 18 } } @@ -24862,15 +23638,15 @@ "updateContext": null }, "value": "Cannot set components in this way. See entity.set().", - "start": 6895, - "end": 6949, + "start": 6681, + "end": 6735, "loc": { "start": { - "line": 251, + "line": 243, "column": 18 }, "end": { - "line": 251, + "line": 243, "column": 72 } } @@ -24887,15 +23663,15 @@ "postfix": false, "binop": null }, - "start": 6949, - "end": 6950, + "start": 6735, + "end": 6736, "loc": { "start": { - "line": 251, + "line": 243, "column": 72 }, "end": { - "line": 251, + "line": 243, "column": 73 } } @@ -24912,15 +23688,15 @@ "postfix": false, "binop": null }, - "start": 6952, - "end": 6953, + "start": 6738, + "end": 6739, "loc": { "start": { - "line": 252, + "line": 244, "column": 1 }, "end": { - "line": 252, + "line": 244, "column": 2 } } @@ -24928,15 +23704,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns true if this is a valid, existing, and usable entity, which is attached to a world.\n\t *\n\t * @example\n\t * if (entity.valid()) {...}\n\t *\n\t * @return {boolean} true or false\n\t ", - "start": 6956, - "end": 7147, + "start": 6742, + "end": 6933, "loc": { "start": { - "line": 254, + "line": 246, "column": 1 }, "end": { - "line": 261, + "line": 253, "column": 4 } } @@ -24954,15 +23730,15 @@ "binop": null }, "value": "valid", - "start": 7149, - "end": 7154, + "start": 6935, + "end": 6940, "loc": { "start": { - "line": 262, + "line": 254, "column": 1 }, "end": { - "line": 262, + "line": 254, "column": 6 } } @@ -24979,15 +23755,15 @@ "postfix": false, "binop": null }, - "start": 7154, - "end": 7155, + "start": 6940, + "end": 6941, "loc": { "start": { - "line": 262, + "line": 254, "column": 6 }, "end": { - "line": 262, + "line": 254, "column": 7 } } @@ -25004,15 +23780,15 @@ "postfix": false, "binop": null }, - "start": 7155, - "end": 7156, + "start": 6941, + "end": 6942, "loc": { "start": { - "line": 262, + "line": 254, "column": 7 }, "end": { - "line": 262, + "line": 254, "column": 8 } } @@ -25029,15 +23805,15 @@ "postfix": false, "binop": null }, - "start": 7157, - "end": 7158, + "start": 6943, + "end": 6944, "loc": { "start": { - "line": 262, + "line": 254, "column": 9 }, "end": { - "line": 262, + "line": 254, "column": 10 } } @@ -25045,15 +23821,15 @@ { "type": "CommentLine", "value": " Note: No need to actually look in the world for the ID, if entities are only ever copied by reference.", - "start": 7161, - "end": 7266, + "start": 6947, + "end": 7052, "loc": { "start": { - "line": 263, + "line": 255, "column": 2 }, "end": { - "line": 263, + "line": 255, "column": 107 } } @@ -25061,15 +23837,15 @@ { "type": "CommentLine", "value": " If entities are ever deep/shallow copied, this function will need to check this to be more robust.", - "start": 7269, - "end": 7370, + "start": 7055, + "end": 7156, "loc": { "start": { - "line": 264, + "line": 256, "column": 2 }, "end": { - "line": 264, + "line": 256, "column": 103 } } @@ -25089,15 +23865,15 @@ "updateContext": null }, "value": "return", - "start": 7373, - "end": 7379, + "start": 7159, + "end": 7165, "loc": { "start": { - "line": 265, + "line": 257, "column": 2 }, "end": { - "line": 265, + "line": 257, "column": 8 } } @@ -25117,15 +23893,15 @@ "updateContext": null }, "value": "this", - "start": 7380, - "end": 7384, + "start": 7166, + "end": 7170, "loc": { "start": { - "line": 265, + "line": 257, "column": 9 }, "end": { - "line": 265, + "line": 257, "column": 13 } } @@ -25143,15 +23919,15 @@ "binop": null, "updateContext": null }, - "start": 7384, - "end": 7385, + "start": 7170, + "end": 7171, "loc": { "start": { - "line": 265, + "line": 257, "column": 13 }, "end": { - "line": 265, + "line": 257, "column": 14 } } @@ -25169,15 +23945,15 @@ "binop": null }, "value": "world", - "start": 7385, - "end": 7390, + "start": 7171, + "end": 7176, "loc": { "start": { - "line": 265, + "line": 257, "column": 14 }, "end": { - "line": 265, + "line": 257, "column": 19 } } @@ -25196,15 +23972,15 @@ "updateContext": null }, "value": "&&", - "start": 7391, - "end": 7393, + "start": 7177, + "end": 7179, "loc": { "start": { - "line": 265, + "line": 257, "column": 20 }, "end": { - "line": 265, + "line": 257, "column": 22 } } @@ -25224,15 +24000,15 @@ "updateContext": null }, "value": "this", - "start": 7394, - "end": 7398, + "start": 7180, + "end": 7184, "loc": { "start": { - "line": 265, + "line": 257, "column": 23 }, "end": { - "line": 265, + "line": 257, "column": 27 } } @@ -25250,15 +24026,15 @@ "binop": null, "updateContext": null }, - "start": 7398, - "end": 7399, + "start": 7184, + "end": 7185, "loc": { "start": { - "line": 265, + "line": 257, "column": 27 }, "end": { - "line": 265, + "line": 257, "column": 28 } } @@ -25276,15 +24052,15 @@ "binop": null }, "value": "_id", - "start": 7399, - "end": 7402, + "start": 7185, + "end": 7188, "loc": { "start": { - "line": 265, + "line": 257, "column": 28 }, "end": { - "line": 265, + "line": 257, "column": 31 } } @@ -25303,15 +24079,15 @@ "updateContext": null }, "value": "!==", - "start": 7403, - "end": 7406, + "start": 7189, + "end": 7192, "loc": { "start": { - "line": 265, + "line": 257, "column": 32 }, "end": { - "line": 265, + "line": 257, "column": 35 } } @@ -25329,15 +24105,15 @@ "binop": null }, "value": "undefined", - "start": 7407, - "end": 7416, + "start": 7193, + "end": 7202, "loc": { "start": { - "line": 265, + "line": 257, "column": 36 }, "end": { - "line": 265, + "line": 257, "column": 45 } } @@ -25354,15 +24130,15 @@ "postfix": false, "binop": null }, - "start": 7418, - "end": 7419, + "start": 7204, + "end": 7205, "loc": { "start": { - "line": 266, + "line": 258, "column": 1 }, "end": { - "line": 266, + "line": 258, "column": 2 } } @@ -25370,15 +24146,15 @@ { "type": "CommentBlock", "value": "*\n\t * Returns unique entity ID as a string.\n\t *\n\t * @example\n\t * let entityId = entity.toString()\n\t *\n\t * @return {string} String representation of the entity ID.\n\t ", - "start": 7422, - "end": 7591, + "start": 7208, + "end": 7377, "loc": { "start": { - "line": 268, + "line": 260, "column": 1 }, "end": { - "line": 275, + "line": 267, "column": 4 } } @@ -25396,15 +24172,15 @@ "binop": null }, "value": "toString", - "start": 7593, - "end": 7601, + "start": 7379, + "end": 7387, "loc": { "start": { - "line": 276, + "line": 268, "column": 1 }, "end": { - "line": 276, + "line": 268, "column": 9 } } @@ -25421,15 +24197,15 @@ "postfix": false, "binop": null }, - "start": 7601, - "end": 7602, + "start": 7387, + "end": 7388, "loc": { "start": { - "line": 276, + "line": 268, "column": 9 }, "end": { - "line": 276, + "line": 268, "column": 10 } } @@ -25446,15 +24222,15 @@ "postfix": false, "binop": null }, - "start": 7602, - "end": 7603, + "start": 7388, + "end": 7389, "loc": { "start": { - "line": 276, + "line": 268, "column": 10 }, "end": { - "line": 276, + "line": 268, "column": 11 } } @@ -25471,15 +24247,15 @@ "postfix": false, "binop": null }, - "start": 7604, - "end": 7605, + "start": 7390, + "end": 7391, "loc": { "start": { - "line": 276, + "line": 268, "column": 12 }, "end": { - "line": 276, + "line": 268, "column": 13 } } @@ -25499,15 +24275,15 @@ "updateContext": null }, "value": "return", - "start": 7608, - "end": 7614, + "start": 7394, + "end": 7400, "loc": { "start": { - "line": 277, + "line": 269, "column": 2 }, "end": { - "line": 277, + "line": 269, "column": 8 } } @@ -25525,15 +24301,15 @@ "binop": null }, "value": "String", - "start": 7615, - "end": 7621, + "start": 7401, + "end": 7407, "loc": { "start": { - "line": 277, + "line": 269, "column": 9 }, "end": { - "line": 277, + "line": 269, "column": 15 } } @@ -25550,15 +24326,15 @@ "postfix": false, "binop": null }, - "start": 7621, - "end": 7622, + "start": 7407, + "end": 7408, "loc": { "start": { - "line": 277, + "line": 269, "column": 15 }, "end": { - "line": 277, + "line": 269, "column": 16 } } @@ -25578,15 +24354,15 @@ "updateContext": null }, "value": "this", - "start": 7622, - "end": 7626, + "start": 7408, + "end": 7412, "loc": { "start": { - "line": 277, + "line": 269, "column": 16 }, "end": { - "line": 277, + "line": 269, "column": 20 } } @@ -25604,15 +24380,15 @@ "binop": null, "updateContext": null }, - "start": 7626, - "end": 7627, + "start": 7412, + "end": 7413, "loc": { "start": { - "line": 277, + "line": 269, "column": 20 }, "end": { - "line": 277, + "line": 269, "column": 21 } } @@ -25630,15 +24406,15 @@ "binop": null }, "value": "_id", - "start": 7627, - "end": 7630, + "start": 7413, + "end": 7416, "loc": { "start": { - "line": 277, + "line": 269, "column": 21 }, "end": { - "line": 277, + "line": 269, "column": 24 } } @@ -25655,15 +24431,15 @@ "postfix": false, "binop": null }, - "start": 7630, - "end": 7631, + "start": 7416, + "end": 7417, "loc": { "start": { - "line": 277, + "line": 269, "column": 24 }, "end": { - "line": 277, + "line": 269, "column": 25 } } @@ -25680,15 +24456,15 @@ "postfix": false, "binop": null }, - "start": 7633, - "end": 7634, + "start": 7419, + "end": 7420, "loc": { "start": { - "line": 278, + "line": 270, "column": 1 }, "end": { - "line": 278, + "line": 270, "column": 2 } } @@ -25696,15 +24472,15 @@ { "type": "CommentBlock", "value": "*\n\t * Serializes entire entity and components to JSON.\n\t * Note: Defining toJSON methods in your components will override the built-in behavior.\n\t *\n\t * @example\n\t * let serializedEntity = entity.toJSON()\n\t *\n\t * @return {string} JSON encoded string\n\t ", - "start": 7637, - "end": 7893, + "start": 7423, + "end": 7679, "loc": { "start": { - "line": 280, + "line": 272, "column": 1 }, "end": { - "line": 288, + "line": 280, "column": 4 } } @@ -25722,15 +24498,15 @@ "binop": null }, "value": "toJSON", - "start": 7895, - "end": 7901, + "start": 7681, + "end": 7687, "loc": { "start": { - "line": 289, + "line": 281, "column": 1 }, "end": { - "line": 289, + "line": 281, "column": 7 } } @@ -25747,15 +24523,15 @@ "postfix": false, "binop": null }, - "start": 7901, - "end": 7902, + "start": 7687, + "end": 7688, "loc": { "start": { - "line": 289, + "line": 281, "column": 7 }, "end": { - "line": 289, + "line": 281, "column": 8 } } @@ -25772,15 +24548,15 @@ "postfix": false, "binop": null }, - "start": 7902, - "end": 7903, + "start": 7688, + "end": 7689, "loc": { "start": { - "line": 289, + "line": 281, "column": 8 }, "end": { - "line": 289, + "line": 281, "column": 9 } } @@ -25797,15 +24573,15 @@ "postfix": false, "binop": null }, - "start": 7904, - "end": 7905, + "start": 7690, + "end": 7691, "loc": { "start": { - "line": 289, + "line": 281, "column": 10 }, "end": { - "line": 289, + "line": 281, "column": 11 } } @@ -25825,15 +24601,15 @@ "updateContext": null }, "value": "return", - "start": 7908, - "end": 7914, + "start": 7694, + "end": 7700, "loc": { "start": { - "line": 290, + "line": 282, "column": 2 }, "end": { - "line": 290, + "line": 282, "column": 8 } } @@ -25851,15 +24627,15 @@ "binop": null }, "value": "JSON", - "start": 7915, - "end": 7919, + "start": 7701, + "end": 7705, "loc": { "start": { - "line": 290, + "line": 282, "column": 9 }, "end": { - "line": 290, + "line": 282, "column": 13 } } @@ -25877,15 +24653,15 @@ "binop": null, "updateContext": null }, - "start": 7919, - "end": 7920, + "start": 7705, + "end": 7706, "loc": { "start": { - "line": 290, + "line": 282, "column": 13 }, "end": { - "line": 290, + "line": 282, "column": 14 } } @@ -25903,15 +24679,15 @@ "binop": null }, "value": "stringify", - "start": 7920, - "end": 7929, + "start": 7706, + "end": 7715, "loc": { "start": { - "line": 290, + "line": 282, "column": 14 }, "end": { - "line": 290, + "line": 282, "column": 23 } } @@ -25928,15 +24704,15 @@ "postfix": false, "binop": null }, - "start": 7929, - "end": 7930, + "start": 7715, + "end": 7716, "loc": { "start": { - "line": 290, + "line": 282, "column": 23 }, "end": { - "line": 290, + "line": 282, "column": 24 } } @@ -25956,15 +24732,15 @@ "updateContext": null }, "value": "this", - "start": 7930, - "end": 7934, + "start": 7716, + "end": 7720, "loc": { "start": { - "line": 290, + "line": 282, "column": 24 }, "end": { - "line": 290, + "line": 282, "column": 28 } } @@ -25982,15 +24758,15 @@ "binop": null, "updateContext": null }, - "start": 7934, - "end": 7935, + "start": 7720, + "end": 7721, "loc": { "start": { - "line": 290, + "line": 282, "column": 28 }, "end": { - "line": 290, + "line": 282, "column": 29 } } @@ -26008,15 +24784,15 @@ "binop": null }, "value": "data", - "start": 7935, - "end": 7939, + "start": 7721, + "end": 7725, "loc": { "start": { - "line": 290, + "line": 282, "column": 29 }, "end": { - "line": 290, + "line": 282, "column": 33 } } @@ -26033,15 +24809,15 @@ "postfix": false, "binop": null }, - "start": 7939, - "end": 7940, + "start": 7725, + "end": 7726, "loc": { "start": { - "line": 290, + "line": 282, "column": 33 }, "end": { - "line": 290, + "line": 282, "column": 34 } } @@ -26058,15 +24834,15 @@ "postfix": false, "binop": null }, - "start": 7942, - "end": 7943, + "start": 7728, + "end": 7729, "loc": { "start": { - "line": 291, + "line": 283, "column": 1 }, "end": { - "line": 291, + "line": 283, "column": 2 } } @@ -26074,15 +24850,15 @@ { "type": "CommentBlock", "value": "*\n\t * Deserializes data from JSON, creating new components and overwriting existing components.\n\t * Note: Defining fromJSON methods in your components will override the built-in behavior.\n\t *\n\t * @example\n\t * entity.fromJSON(serializedEntity)\n\t *\n\t * @param {string} data - A JSON string containing component data to parse, and store in this entity.\n\t *\n\t * @return {Object} The original entity that fromJSON() was called on, so that operations can be chained.\n\t ", - "start": 7946, - "end": 8413, + "start": 7732, + "end": 8199, "loc": { "start": { - "line": 293, + "line": 285, "column": 1 }, "end": { - "line": 303, + "line": 295, "column": 4 } } @@ -26100,15 +24876,15 @@ "binop": null }, "value": "fromJSON", - "start": 8415, - "end": 8423, + "start": 8201, + "end": 8209, "loc": { "start": { - "line": 304, + "line": 296, "column": 1 }, "end": { - "line": 304, + "line": 296, "column": 9 } } @@ -26125,15 +24901,15 @@ "postfix": false, "binop": null }, - "start": 8423, - "end": 8424, + "start": 8209, + "end": 8210, "loc": { "start": { - "line": 304, + "line": 296, "column": 9 }, "end": { - "line": 304, + "line": 296, "column": 10 } } @@ -26151,15 +24927,15 @@ "binop": null }, "value": "data", - "start": 8424, - "end": 8428, + "start": 8210, + "end": 8214, "loc": { "start": { - "line": 304, + "line": 296, "column": 10 }, "end": { - "line": 304, + "line": 296, "column": 14 } } @@ -26176,15 +24952,15 @@ "postfix": false, "binop": null }, - "start": 8428, - "end": 8429, + "start": 8214, + "end": 8215, "loc": { "start": { - "line": 304, + "line": 296, "column": 14 }, "end": { - "line": 304, + "line": 296, "column": 15 } } @@ -26201,15 +24977,15 @@ "postfix": false, "binop": null }, - "start": 8430, - "end": 8431, + "start": 8216, + "end": 8217, "loc": { "start": { - "line": 304, + "line": 296, "column": 16 }, "end": { - "line": 304, + "line": 296, "column": 17 } } @@ -26229,15 +25005,15 @@ "updateContext": null }, "value": "let", - "start": 8434, - "end": 8437, + "start": 8220, + "end": 8223, "loc": { "start": { - "line": 305, + "line": 297, "column": 2 }, "end": { - "line": 305, + "line": 297, "column": 5 } } @@ -26255,15 +25031,15 @@ "binop": null }, "value": "parsed", - "start": 8438, - "end": 8444, + "start": 8224, + "end": 8230, "loc": { "start": { - "line": 305, + "line": 297, "column": 6 }, "end": { - "line": 305, + "line": 297, "column": 12 } } @@ -26282,15 +25058,15 @@ "updateContext": null }, "value": "=", - "start": 8445, - "end": 8446, + "start": 8231, + "end": 8232, "loc": { "start": { - "line": 305, + "line": 297, "column": 13 }, "end": { - "line": 305, + "line": 297, "column": 14 } } @@ -26308,15 +25084,15 @@ "binop": null }, "value": "JSON", - "start": 8447, - "end": 8451, + "start": 8233, + "end": 8237, "loc": { "start": { - "line": 305, + "line": 297, "column": 15 }, "end": { - "line": 305, + "line": 297, "column": 19 } } @@ -26334,15 +25110,15 @@ "binop": null, "updateContext": null }, - "start": 8451, - "end": 8452, + "start": 8237, + "end": 8238, "loc": { "start": { - "line": 305, + "line": 297, "column": 19 }, "end": { - "line": 305, + "line": 297, "column": 20 } } @@ -26360,15 +25136,15 @@ "binop": null }, "value": "parse", - "start": 8452, - "end": 8457, + "start": 8238, + "end": 8243, "loc": { "start": { - "line": 305, + "line": 297, "column": 20 }, "end": { - "line": 305, + "line": 297, "column": 25 } } @@ -26385,15 +25161,15 @@ "postfix": false, "binop": null }, - "start": 8457, - "end": 8458, + "start": 8243, + "end": 8244, "loc": { "start": { - "line": 305, + "line": 297, "column": 25 }, "end": { - "line": 305, + "line": 297, "column": 26 } } @@ -26411,15 +25187,15 @@ "binop": null }, "value": "data", - "start": 8458, - "end": 8462, + "start": 8244, + "end": 8248, "loc": { "start": { - "line": 305, + "line": 297, "column": 26 }, "end": { - "line": 305, + "line": 297, "column": 30 } } @@ -26436,15 +25212,15 @@ "postfix": false, "binop": null }, - "start": 8462, - "end": 8463, + "start": 8248, + "end": 8249, "loc": { "start": { - "line": 305, + "line": 297, "column": 30 }, "end": { - "line": 305, + "line": 297, "column": 31 } } @@ -26464,15 +25240,15 @@ "updateContext": null }, "value": "for", - "start": 8466, - "end": 8469, + "start": 8252, + "end": 8255, "loc": { "start": { - "line": 306, + "line": 298, "column": 2 }, "end": { - "line": 306, + "line": 298, "column": 5 } } @@ -26489,15 +25265,15 @@ "postfix": false, "binop": null }, - "start": 8470, - "end": 8471, + "start": 8256, + "end": 8257, "loc": { "start": { - "line": 306, + "line": 298, "column": 6 }, "end": { - "line": 306, + "line": 298, "column": 7 } } @@ -26517,15 +25293,15 @@ "updateContext": null }, "value": "let", - "start": 8471, - "end": 8474, + "start": 8257, + "end": 8260, "loc": { "start": { - "line": 306, + "line": 298, "column": 7 }, "end": { - "line": 306, + "line": 298, "column": 10 } } @@ -26543,15 +25319,15 @@ "binop": null }, "value": "name", - "start": 8475, - "end": 8479, + "start": 8261, + "end": 8265, "loc": { "start": { - "line": 306, + "line": 298, "column": 11 }, "end": { - "line": 306, + "line": 298, "column": 15 } } @@ -26571,15 +25347,15 @@ "updateContext": null }, "value": "in", - "start": 8480, - "end": 8482, + "start": 8266, + "end": 8268, "loc": { "start": { - "line": 306, + "line": 298, "column": 16 }, "end": { - "line": 306, + "line": 298, "column": 18 } } @@ -26597,15 +25373,15 @@ "binop": null }, "value": "parsed", - "start": 8483, - "end": 8489, + "start": 8269, + "end": 8275, "loc": { "start": { - "line": 306, + "line": 298, "column": 19 }, "end": { - "line": 306, + "line": 298, "column": 25 } } @@ -26622,15 +25398,15 @@ "postfix": false, "binop": null }, - "start": 8489, - "end": 8490, + "start": 8275, + "end": 8276, "loc": { "start": { - "line": 306, + "line": 298, "column": 25 }, "end": { - "line": 306, + "line": 298, "column": 26 } } @@ -26647,15 +25423,15 @@ "postfix": false, "binop": null }, - "start": 8491, - "end": 8492, + "start": 8277, + "end": 8278, "loc": { "start": { - "line": 306, + "line": 298, "column": 27 }, "end": { - "line": 306, + "line": 298, "column": 28 } } @@ -26675,15 +25451,15 @@ "updateContext": null }, "value": "let", - "start": 8496, - "end": 8499, + "start": 8282, + "end": 8285, "loc": { "start": { - "line": 307, + "line": 299, "column": 3 }, "end": { - "line": 307, + "line": 299, "column": 6 } } @@ -26701,15 +25477,15 @@ "binop": null }, "value": "comp", - "start": 8500, - "end": 8504, + "start": 8286, + "end": 8290, "loc": { "start": { - "line": 307, + "line": 299, "column": 7 }, "end": { - "line": 307, + "line": 299, "column": 11 } } @@ -26728,15 +25504,15 @@ "updateContext": null }, "value": "=", - "start": 8505, - "end": 8506, + "start": 8291, + "end": 8292, "loc": { "start": { - "line": 307, + "line": 299, "column": 12 }, "end": { - "line": 307, + "line": 299, "column": 13 } } @@ -26756,15 +25532,15 @@ "updateContext": null }, "value": "this", - "start": 8507, - "end": 8511, + "start": 8293, + "end": 8297, "loc": { "start": { - "line": 307, + "line": 299, "column": 14 }, "end": { - "line": 307, + "line": 299, "column": 18 } } @@ -26782,15 +25558,15 @@ "binop": null, "updateContext": null }, - "start": 8511, - "end": 8512, + "start": 8297, + "end": 8298, "loc": { "start": { - "line": 307, + "line": 299, "column": 18 }, "end": { - "line": 307, + "line": 299, "column": 19 } } @@ -26808,15 +25584,15 @@ "binop": null }, "value": "access", - "start": 8512, - "end": 8518, + "start": 8298, + "end": 8304, "loc": { "start": { - "line": 307, + "line": 299, "column": 19 }, "end": { - "line": 307, + "line": 299, "column": 25 } } @@ -26833,15 +25609,15 @@ "postfix": false, "binop": null }, - "start": 8518, - "end": 8519, + "start": 8304, + "end": 8305, "loc": { "start": { - "line": 307, + "line": 299, "column": 25 }, "end": { - "line": 307, + "line": 299, "column": 26 } } @@ -26859,15 +25635,15 @@ "binop": null }, "value": "name", - "start": 8519, - "end": 8523, + "start": 8305, + "end": 8309, "loc": { "start": { - "line": 307, + "line": 299, "column": 26 }, "end": { - "line": 307, + "line": 299, "column": 30 } } @@ -26884,15 +25660,15 @@ "postfix": false, "binop": null }, - "start": 8523, - "end": 8524, + "start": 8309, + "end": 8310, "loc": { "start": { - "line": 307, + "line": 299, "column": 30 }, "end": { - "line": 307, + "line": 299, "column": 31 } } @@ -26900,15 +25676,15 @@ { "type": "CommentLine", "value": " Either call custom method or copy all properties", - "start": 8529, - "end": 8580, + "start": 8315, + "end": 8366, "loc": { "start": { - "line": 309, + "line": 301, "column": 3 }, "end": { - "line": 309, + "line": 301, "column": 54 } } @@ -26928,15 +25704,15 @@ "updateContext": null }, "value": "if", - "start": 8584, - "end": 8586, + "start": 8370, + "end": 8372, "loc": { "start": { - "line": 310, + "line": 302, "column": 3 }, "end": { - "line": 310, + "line": 302, "column": 5 } } @@ -26953,15 +25729,15 @@ "postfix": false, "binop": null }, - "start": 8587, - "end": 8588, + "start": 8373, + "end": 8374, "loc": { "start": { - "line": 310, + "line": 302, "column": 6 }, "end": { - "line": 310, + "line": 302, "column": 7 } } @@ -26981,15 +25757,15 @@ "updateContext": null }, "value": "typeof", - "start": 8588, - "end": 8594, + "start": 8374, + "end": 8380, "loc": { "start": { - "line": 310, + "line": 302, "column": 7 }, "end": { - "line": 310, + "line": 302, "column": 13 } } @@ -27007,15 +25783,15 @@ "binop": null }, "value": "comp", - "start": 8595, - "end": 8599, + "start": 8381, + "end": 8385, "loc": { "start": { - "line": 310, + "line": 302, "column": 14 }, "end": { - "line": 310, + "line": 302, "column": 18 } } @@ -27033,15 +25809,15 @@ "binop": null, "updateContext": null }, - "start": 8599, - "end": 8600, + "start": 8385, + "end": 8386, "loc": { "start": { - "line": 310, + "line": 302, "column": 18 }, "end": { - "line": 310, + "line": 302, "column": 19 } } @@ -27059,15 +25835,15 @@ "binop": null }, "value": "fromJSON", - "start": 8600, - "end": 8608, + "start": 8386, + "end": 8394, "loc": { "start": { - "line": 310, + "line": 302, "column": 19 }, "end": { - "line": 310, + "line": 302, "column": 27 } } @@ -27086,15 +25862,15 @@ "updateContext": null }, "value": "===", - "start": 8609, - "end": 8612, + "start": 8395, + "end": 8398, "loc": { "start": { - "line": 310, + "line": 302, "column": 28 }, "end": { - "line": 310, + "line": 302, "column": 31 } } @@ -27113,15 +25889,15 @@ "updateContext": null }, "value": "function", - "start": 8613, - "end": 8623, + "start": 8399, + "end": 8409, "loc": { "start": { - "line": 310, + "line": 302, "column": 32 }, "end": { - "line": 310, + "line": 302, "column": 42 } } @@ -27138,15 +25914,15 @@ "postfix": false, "binop": null }, - "start": 8623, - "end": 8624, + "start": 8409, + "end": 8410, "loc": { "start": { - "line": 310, + "line": 302, "column": 42 }, "end": { - "line": 310, + "line": 302, "column": 43 } } @@ -27163,15 +25939,15 @@ "postfix": false, "binop": null }, - "start": 8625, - "end": 8626, + "start": 8411, + "end": 8412, "loc": { "start": { - "line": 310, + "line": 302, "column": 44 }, "end": { - "line": 310, + "line": 302, "column": 45 } } @@ -27189,15 +25965,15 @@ "binop": null }, "value": "comp", - "start": 8631, - "end": 8635, + "start": 8417, + "end": 8421, "loc": { "start": { - "line": 311, + "line": 303, "column": 4 }, "end": { - "line": 311, + "line": 303, "column": 8 } } @@ -27215,15 +25991,15 @@ "binop": null, "updateContext": null }, - "start": 8635, - "end": 8636, + "start": 8421, + "end": 8422, "loc": { "start": { - "line": 311, + "line": 303, "column": 8 }, "end": { - "line": 311, + "line": 303, "column": 9 } } @@ -27241,15 +26017,15 @@ "binop": null }, "value": "fromJSON", - "start": 8636, - "end": 8644, + "start": 8422, + "end": 8430, "loc": { "start": { - "line": 311, + "line": 303, "column": 9 }, "end": { - "line": 311, + "line": 303, "column": 17 } } @@ -27266,15 +26042,15 @@ "postfix": false, "binop": null }, - "start": 8644, - "end": 8645, + "start": 8430, + "end": 8431, "loc": { "start": { - "line": 311, + "line": 303, "column": 17 }, "end": { - "line": 311, + "line": 303, "column": 18 } } @@ -27292,15 +26068,15 @@ "binop": null }, "value": "parsed", - "start": 8645, - "end": 8651, + "start": 8431, + "end": 8437, "loc": { "start": { - "line": 311, + "line": 303, "column": 18 }, "end": { - "line": 311, + "line": 303, "column": 24 } } @@ -27318,15 +26094,15 @@ "binop": null, "updateContext": null }, - "start": 8651, - "end": 8652, + "start": 8437, + "end": 8438, "loc": { "start": { - "line": 311, + "line": 303, "column": 24 }, "end": { - "line": 311, + "line": 303, "column": 25 } } @@ -27344,15 +26120,15 @@ "binop": null }, "value": "name", - "start": 8652, - "end": 8656, + "start": 8438, + "end": 8442, "loc": { "start": { - "line": 311, + "line": 303, "column": 25 }, "end": { - "line": 311, + "line": 303, "column": 29 } } @@ -27370,15 +26146,15 @@ "binop": null, "updateContext": null }, - "start": 8656, - "end": 8657, + "start": 8442, + "end": 8443, "loc": { "start": { - "line": 311, + "line": 303, "column": 29 }, "end": { - "line": 311, + "line": 303, "column": 30 } } @@ -27395,15 +26171,15 @@ "postfix": false, "binop": null }, - "start": 8657, - "end": 8658, + "start": 8443, + "end": 8444, "loc": { "start": { - "line": 311, + "line": 303, "column": 30 }, "end": { - "line": 311, + "line": 303, "column": 31 } } @@ -27420,15 +26196,15 @@ "postfix": false, "binop": null }, - "start": 8662, - "end": 8663, + "start": 8448, + "end": 8449, "loc": { "start": { - "line": 312, + "line": 304, "column": 3 }, "end": { - "line": 312, + "line": 304, "column": 4 } } @@ -27448,15 +26224,15 @@ "updateContext": null }, "value": "else", - "start": 8664, - "end": 8668, + "start": 8450, + "end": 8454, "loc": { "start": { - "line": 312, + "line": 304, "column": 5 }, "end": { - "line": 312, + "line": 304, "column": 9 } } @@ -27473,15 +26249,15 @@ "postfix": false, "binop": null }, - "start": 8669, - "end": 8670, + "start": 8455, + "end": 8456, "loc": { "start": { - "line": 312, + "line": 304, "column": 10 }, "end": { - "line": 312, + "line": 304, "column": 11 } } @@ -27501,15 +26277,15 @@ "updateContext": null }, "value": "this", - "start": 8675, - "end": 8679, + "start": 8461, + "end": 8465, "loc": { "start": { - "line": 313, + "line": 305, "column": 4 }, "end": { - "line": 313, + "line": 305, "column": 8 } } @@ -27527,15 +26303,15 @@ "binop": null, "updateContext": null }, - "start": 8679, - "end": 8680, + "start": 8465, + "end": 8466, "loc": { "start": { - "line": 313, + "line": 305, "column": 8 }, "end": { - "line": 313, + "line": 305, "column": 9 } } @@ -27553,15 +26329,15 @@ "binop": null }, "value": "update", - "start": 8680, - "end": 8686, + "start": 8466, + "end": 8472, "loc": { "start": { - "line": 313, + "line": 305, "column": 9 }, "end": { - "line": 313, + "line": 305, "column": 15 } } @@ -27578,15 +26354,15 @@ "postfix": false, "binop": null }, - "start": 8686, - "end": 8687, + "start": 8472, + "end": 8473, "loc": { "start": { - "line": 313, + "line": 305, "column": 15 }, "end": { - "line": 313, + "line": 305, "column": 16 } } @@ -27604,15 +26380,15 @@ "binop": null }, "value": "name", - "start": 8687, - "end": 8691, + "start": 8473, + "end": 8477, "loc": { "start": { - "line": 313, + "line": 305, "column": 16 }, "end": { - "line": 313, + "line": 305, "column": 20 } } @@ -27630,15 +26406,15 @@ "binop": null, "updateContext": null }, - "start": 8691, - "end": 8692, + "start": 8477, + "end": 8478, "loc": { "start": { - "line": 313, + "line": 305, "column": 20 }, "end": { - "line": 313, + "line": 305, "column": 21 } } @@ -27656,15 +26432,15 @@ "binop": null }, "value": "parsed", - "start": 8693, - "end": 8699, + "start": 8479, + "end": 8485, "loc": { "start": { - "line": 313, + "line": 305, "column": 22 }, "end": { - "line": 313, + "line": 305, "column": 28 } } @@ -27682,15 +26458,15 @@ "binop": null, "updateContext": null }, - "start": 8699, - "end": 8700, + "start": 8485, + "end": 8486, "loc": { "start": { - "line": 313, + "line": 305, "column": 28 }, "end": { - "line": 313, + "line": 305, "column": 29 } } @@ -27708,15 +26484,15 @@ "binop": null }, "value": "name", - "start": 8700, - "end": 8704, + "start": 8486, + "end": 8490, "loc": { "start": { - "line": 313, + "line": 305, "column": 29 }, "end": { - "line": 313, + "line": 305, "column": 33 } } @@ -27734,15 +26510,15 @@ "binop": null, "updateContext": null }, - "start": 8704, - "end": 8705, + "start": 8490, + "end": 8491, "loc": { "start": { - "line": 313, + "line": 305, "column": 33 }, "end": { - "line": 313, + "line": 305, "column": 34 } } @@ -27759,15 +26535,15 @@ "postfix": false, "binop": null }, - "start": 8705, - "end": 8706, + "start": 8491, + "end": 8492, "loc": { "start": { - "line": 313, + "line": 305, "column": 34 }, "end": { - "line": 313, + "line": 305, "column": 35 } } @@ -27784,15 +26560,15 @@ "postfix": false, "binop": null }, - "start": 8710, - "end": 8711, + "start": 8496, + "end": 8497, "loc": { "start": { - "line": 314, + "line": 306, "column": 3 }, "end": { - "line": 314, + "line": 306, "column": 4 } } @@ -27809,15 +26585,15 @@ "postfix": false, "binop": null }, - "start": 8714, - "end": 8715, + "start": 8500, + "end": 8501, "loc": { "start": { - "line": 315, + "line": 307, "column": 2 }, "end": { - "line": 315, + "line": 307, "column": 3 } } @@ -27837,15 +26613,15 @@ "updateContext": null }, "value": "return", - "start": 8718, - "end": 8724, + "start": 8504, + "end": 8510, "loc": { "start": { - "line": 316, + "line": 308, "column": 2 }, "end": { - "line": 316, + "line": 308, "column": 8 } } @@ -27865,15 +26641,15 @@ "updateContext": null }, "value": "this", - "start": 8725, - "end": 8729, + "start": 8511, + "end": 8515, "loc": { "start": { - "line": 316, + "line": 308, "column": 9 }, "end": { - "line": 316, + "line": 308, "column": 13 } } @@ -27890,15 +26666,15 @@ "postfix": false, "binop": null }, - "start": 8731, - "end": 8732, + "start": 8517, + "end": 8518, "loc": { "start": { - "line": 317, + "line": 309, "column": 1 }, "end": { - "line": 317, + "line": 309, "column": 2 } } @@ -27906,15 +26682,15 @@ { "type": "CommentBlock", "value": "*\n\t * Attaches a currently detached entity back to a world.\n\t * Note: Do not use detached entities, get() may be safe, but avoid calling other methods\n\t * Note: The ID will be reassigned, so do not rely on this\n\t *\n\t * @example\n\t * entity.attach(world)\n\t *\n\t * @param {World} world - The world to attach this entity to\n\t ", - "start": 8735, - "end": 9060, + "start": 8521, + "end": 8846, "loc": { "start": { - "line": 319, + "line": 311, "column": 1 }, "end": { - "line": 328, + "line": 320, "column": 4 } } @@ -27932,15 +26708,15 @@ "binop": null }, "value": "attach", - "start": 9062, - "end": 9068, + "start": 8848, + "end": 8854, "loc": { "start": { - "line": 329, + "line": 321, "column": 1 }, "end": { - "line": 329, + "line": 321, "column": 7 } } @@ -27957,15 +26733,15 @@ "postfix": false, "binop": null }, - "start": 9068, - "end": 9069, + "start": 8854, + "end": 8855, "loc": { "start": { - "line": 329, + "line": 321, "column": 7 }, "end": { - "line": 329, + "line": 321, "column": 8 } } @@ -27983,15 +26759,15 @@ "binop": null }, "value": "world", - "start": 9069, - "end": 9074, + "start": 8855, + "end": 8860, "loc": { "start": { - "line": 329, + "line": 321, "column": 8 }, "end": { - "line": 329, + "line": 321, "column": 13 } } @@ -28008,15 +26784,15 @@ "postfix": false, "binop": null }, - "start": 9074, - "end": 9075, + "start": 8860, + "end": 8861, "loc": { "start": { - "line": 329, + "line": 321, "column": 13 }, "end": { - "line": 329, + "line": 321, "column": 14 } } @@ -28033,15 +26809,15 @@ "postfix": false, "binop": null }, - "start": 9076, - "end": 9077, + "start": 8862, + "end": 8863, "loc": { "start": { - "line": 329, + "line": 321, "column": 15 }, "end": { - "line": 329, + "line": 321, "column": 16 } } @@ -28061,15 +26837,15 @@ "updateContext": null }, "value": "if", - "start": 9080, - "end": 9082, + "start": 8866, + "end": 8868, "loc": { "start": { - "line": 330, + "line": 322, "column": 2 }, "end": { - "line": 330, + "line": 322, "column": 4 } } @@ -28086,15 +26862,15 @@ "postfix": false, "binop": null }, - "start": 9083, - "end": 9084, + "start": 8869, + "end": 8870, "loc": { "start": { - "line": 330, + "line": 322, "column": 5 }, "end": { - "line": 330, + "line": 322, "column": 6 } } @@ -28112,15 +26888,15 @@ "binop": null }, "value": "world", - "start": 9084, - "end": 9089, + "start": 8870, + "end": 8875, "loc": { "start": { - "line": 330, + "line": 322, "column": 6 }, "end": { - "line": 330, + "line": 322, "column": 11 } } @@ -28139,15 +26915,15 @@ "updateContext": null }, "value": "&&", - "start": 9090, - "end": 9092, + "start": 8876, + "end": 8878, "loc": { "start": { - "line": 330, + "line": 322, "column": 12 }, "end": { - "line": 330, + "line": 322, "column": 14 } } @@ -28166,15 +26942,15 @@ "updateContext": null }, "value": "!", - "start": 9093, - "end": 9094, + "start": 8879, + "end": 8880, "loc": { "start": { - "line": 330, + "line": 322, "column": 15 }, "end": { - "line": 330, + "line": 322, "column": 16 } } @@ -28194,15 +26970,15 @@ "updateContext": null }, "value": "this", - "start": 9094, - "end": 9098, + "start": 8880, + "end": 8884, "loc": { "start": { - "line": 330, + "line": 322, "column": 16 }, "end": { - "line": 330, + "line": 322, "column": 20 } } @@ -28220,15 +26996,15 @@ "binop": null, "updateContext": null }, - "start": 9098, - "end": 9099, + "start": 8884, + "end": 8885, "loc": { "start": { - "line": 330, + "line": 322, "column": 20 }, "end": { - "line": 330, + "line": 322, "column": 21 } } @@ -28246,15 +27022,15 @@ "binop": null }, "value": "valid", - "start": 9099, - "end": 9104, + "start": 8885, + "end": 8890, "loc": { "start": { - "line": 330, + "line": 322, "column": 21 }, "end": { - "line": 330, + "line": 322, "column": 26 } } @@ -28271,15 +27047,15 @@ "postfix": false, "binop": null }, - "start": 9104, - "end": 9105, + "start": 8890, + "end": 8891, "loc": { "start": { - "line": 330, + "line": 322, "column": 26 }, "end": { - "line": 330, + "line": 322, "column": 27 } } @@ -28296,15 +27072,15 @@ "postfix": false, "binop": null }, - "start": 9105, - "end": 9106, + "start": 8891, + "end": 8892, "loc": { "start": { - "line": 330, + "line": 322, "column": 27 }, "end": { - "line": 330, + "line": 322, "column": 28 } } @@ -28321,15 +27097,15 @@ "postfix": false, "binop": null }, - "start": 9106, - "end": 9107, + "start": 8892, + "end": 8893, "loc": { "start": { - "line": 330, + "line": 322, "column": 28 }, "end": { - "line": 330, + "line": 322, "column": 29 } } @@ -28346,15 +27122,15 @@ "postfix": false, "binop": null }, - "start": 9108, - "end": 9109, + "start": 8894, + "end": 8895, "loc": { "start": { - "line": 330, + "line": 322, "column": 30 }, "end": { - "line": 330, + "line": 322, "column": 31 } } @@ -28362,15 +27138,15 @@ { "type": "CommentLine", "value": " Assign new id, and reattach to world", - "start": 9113, - "end": 9152, + "start": 8899, + "end": 8938, "loc": { "start": { - "line": 331, + "line": 323, "column": 3 }, "end": { - "line": 331, + "line": 323, "column": 42 } } @@ -28390,15 +27166,15 @@ "updateContext": null }, "value": "this", - "start": 9156, - "end": 9160, + "start": 8942, + "end": 8946, "loc": { "start": { - "line": 332, + "line": 324, "column": 3 }, "end": { - "line": 332, + "line": 324, "column": 7 } } @@ -28416,15 +27192,15 @@ "binop": null, "updateContext": null }, - "start": 9160, - "end": 9161, + "start": 8946, + "end": 8947, "loc": { "start": { - "line": 332, + "line": 324, "column": 7 }, "end": { - "line": 332, + "line": 324, "column": 8 } } @@ -28442,15 +27218,15 @@ "binop": null }, "value": "world", - "start": 9161, - "end": 9166, + "start": 8947, + "end": 8952, "loc": { "start": { - "line": 332, + "line": 324, "column": 8 }, "end": { - "line": 332, + "line": 324, "column": 13 } } @@ -28469,15 +27245,15 @@ "updateContext": null }, "value": "=", - "start": 9167, - "end": 9168, + "start": 8953, + "end": 8954, "loc": { "start": { - "line": 332, + "line": 324, "column": 14 }, "end": { - "line": 332, + "line": 324, "column": 15 } } @@ -28495,15 +27271,15 @@ "binop": null }, "value": "world", - "start": 9169, - "end": 9174, + "start": 8955, + "end": 8960, "loc": { "start": { - "line": 332, + "line": 324, "column": 16 }, "end": { - "line": 332, + "line": 324, "column": 21 } } @@ -28523,15 +27299,15 @@ "updateContext": null }, "value": "this", - "start": 9178, - "end": 9182, + "start": 8964, + "end": 8968, "loc": { "start": { - "line": 333, + "line": 325, "column": 3 }, "end": { - "line": 333, + "line": 325, "column": 7 } } @@ -28549,15 +27325,15 @@ "binop": null, "updateContext": null }, - "start": 9182, - "end": 9183, + "start": 8968, + "end": 8969, "loc": { "start": { - "line": 333, + "line": 325, "column": 7 }, "end": { - "line": 333, + "line": 325, "column": 8 } } @@ -28575,15 +27351,15 @@ "binop": null }, "value": "_id", - "start": 9183, - "end": 9186, + "start": 8969, + "end": 8972, "loc": { "start": { - "line": 333, + "line": 325, "column": 8 }, "end": { - "line": 333, + "line": 325, "column": 11 } } @@ -28602,15 +27378,15 @@ "updateContext": null }, "value": "=", - "start": 9187, - "end": 9188, + "start": 8973, + "end": 8974, "loc": { "start": { - "line": 333, + "line": 325, "column": 12 }, "end": { - "line": 333, + "line": 325, "column": 13 } } @@ -28630,15 +27406,15 @@ "updateContext": null }, "value": "this", - "start": 9189, - "end": 9193, + "start": 8975, + "end": 8979, "loc": { "start": { - "line": 333, + "line": 325, "column": 14 }, "end": { - "line": 333, + "line": 325, "column": 18 } } @@ -28656,15 +27432,15 @@ "binop": null, "updateContext": null }, - "start": 9193, - "end": 9194, + "start": 8979, + "end": 8980, "loc": { "start": { - "line": 333, + "line": 325, "column": 18 }, "end": { - "line": 333, + "line": 325, "column": 19 } } @@ -28682,15 +27458,15 @@ "binop": null }, "value": "world", - "start": 9194, - "end": 9199, + "start": 8980, + "end": 8985, "loc": { "start": { - "line": 333, + "line": 325, "column": 19 }, "end": { - "line": 333, + "line": 325, "column": 24 } } @@ -28708,15 +27484,15 @@ "binop": null, "updateContext": null }, - "start": 9199, - "end": 9200, + "start": 8985, + "end": 8986, "loc": { "start": { - "line": 333, + "line": 325, "column": 24 }, "end": { - "line": 333, + "line": 325, "column": 25 } } @@ -28734,15 +27510,15 @@ "binop": null }, "value": "idCounter", - "start": 9200, - "end": 9209, + "start": 8986, + "end": 8995, "loc": { "start": { - "line": 333, + "line": 325, "column": 25 }, "end": { - "line": 333, + "line": 325, "column": 34 } } @@ -28760,15 +27536,15 @@ "binop": null }, "value": "++", - "start": 9209, - "end": 9211, + "start": 8995, + "end": 8997, "loc": { "start": { - "line": 333, + "line": 325, "column": 34 }, "end": { - "line": 333, + "line": 325, "column": 36 } } @@ -28788,15 +27564,15 @@ "updateContext": null }, "value": "this", - "start": 9215, - "end": 9219, + "start": 9001, + "end": 9005, "loc": { "start": { - "line": 334, + "line": 326, "column": 3 }, "end": { - "line": 334, + "line": 326, "column": 7 } } @@ -28814,15 +27590,15 @@ "binop": null, "updateContext": null }, - "start": 9219, - "end": 9220, + "start": 9005, + "end": 9006, "loc": { "start": { - "line": 334, + "line": 326, "column": 7 }, "end": { - "line": 334, + "line": 326, "column": 8 } } @@ -28840,15 +27616,15 @@ "binop": null }, "value": "world", - "start": 9220, - "end": 9225, + "start": 9006, + "end": 9011, "loc": { "start": { - "line": 334, + "line": 326, "column": 8 }, "end": { - "line": 334, + "line": 326, "column": 13 } } @@ -28866,15 +27642,15 @@ "binop": null, "updateContext": null }, - "start": 9225, - "end": 9226, + "start": 9011, + "end": 9012, "loc": { "start": { - "line": 334, + "line": 326, "column": 13 }, "end": { - "line": 334, + "line": 326, "column": 14 } } @@ -28892,15 +27668,15 @@ "binop": null }, "value": "entities", - "start": 9226, - "end": 9234, + "start": 9012, + "end": 9020, "loc": { "start": { - "line": 334, + "line": 326, "column": 14 }, "end": { - "line": 334, + "line": 326, "column": 22 } } @@ -28918,15 +27694,15 @@ "binop": null, "updateContext": null }, - "start": 9234, - "end": 9235, + "start": 9020, + "end": 9021, "loc": { "start": { - "line": 334, + "line": 326, "column": 22 }, "end": { - "line": 334, + "line": 326, "column": 23 } } @@ -28944,15 +27720,15 @@ "binop": null }, "value": "set", - "start": 9235, - "end": 9238, + "start": 9021, + "end": 9024, "loc": { "start": { - "line": 334, + "line": 326, "column": 23 }, "end": { - "line": 334, + "line": 326, "column": 26 } } @@ -28969,15 +27745,15 @@ "postfix": false, "binop": null }, - "start": 9238, - "end": 9239, + "start": 9024, + "end": 9025, "loc": { "start": { - "line": 334, + "line": 326, "column": 26 }, "end": { - "line": 334, + "line": 326, "column": 27 } } @@ -28997,15 +27773,15 @@ "updateContext": null }, "value": "this", - "start": 9239, - "end": 9243, + "start": 9025, + "end": 9029, "loc": { "start": { - "line": 334, + "line": 326, "column": 27 }, "end": { - "line": 334, + "line": 326, "column": 31 } } @@ -29023,15 +27799,15 @@ "binop": null, "updateContext": null }, - "start": 9243, - "end": 9244, + "start": 9029, + "end": 9030, "loc": { "start": { - "line": 334, + "line": 326, "column": 31 }, "end": { - "line": 334, + "line": 326, "column": 32 } } @@ -29049,15 +27825,15 @@ "binop": null }, "value": "_id", - "start": 9244, - "end": 9247, + "start": 9030, + "end": 9033, "loc": { "start": { - "line": 334, + "line": 326, "column": 32 }, "end": { - "line": 334, + "line": 326, "column": 35 } } @@ -29075,15 +27851,15 @@ "binop": null, "updateContext": null }, - "start": 9247, - "end": 9248, + "start": 9033, + "end": 9034, "loc": { "start": { - "line": 334, + "line": 326, "column": 35 }, "end": { - "line": 334, + "line": 326, "column": 36 } } @@ -29103,15 +27879,15 @@ "updateContext": null }, "value": "this", - "start": 9249, - "end": 9253, + "start": 9035, + "end": 9039, "loc": { "start": { - "line": 334, + "line": 326, "column": 37 }, "end": { - "line": 334, + "line": 326, "column": 41 } } @@ -29128,15 +27904,15 @@ "postfix": false, "binop": null }, - "start": 9253, - "end": 9254, + "start": 9039, + "end": 9040, "loc": { "start": { - "line": 334, + "line": 326, "column": 41 }, "end": { - "line": 334, + "line": 326, "column": 42 } } @@ -29156,15 +27932,15 @@ "updateContext": null }, "value": "this", - "start": 9258, - "end": 9262, + "start": 9044, + "end": 9048, "loc": { "start": { - "line": 335, + "line": 327, "column": 3 }, "end": { - "line": 335, + "line": 327, "column": 7 } } @@ -29182,15 +27958,15 @@ "binop": null, "updateContext": null }, - "start": 9262, - "end": 9263, + "start": 9048, + "end": 9049, "loc": { "start": { - "line": 335, + "line": 327, "column": 7 }, "end": { - "line": 335, + "line": 327, "column": 8 } } @@ -29208,15 +27984,15 @@ "binop": null }, "value": "world", - "start": 9263, - "end": 9268, + "start": 9049, + "end": 9054, "loc": { "start": { - "line": 335, + "line": 327, "column": 8 }, "end": { - "line": 335, + "line": 327, "column": 13 } } @@ -29234,15 +28010,15 @@ "binop": null, "updateContext": null }, - "start": 9268, - "end": 9269, + "start": 9054, + "end": 9055, "loc": { "start": { - "line": 335, + "line": 327, "column": 13 }, "end": { - "line": 335, + "line": 327, "column": 14 } } @@ -29260,15 +28036,15 @@ "binop": null }, "value": "index", - "start": 9269, - "end": 9274, + "start": 9055, + "end": 9060, "loc": { "start": { - "line": 335, + "line": 327, "column": 14 }, "end": { - "line": 335, + "line": 327, "column": 19 } } @@ -29286,15 +28062,15 @@ "binop": null, "updateContext": null }, - "start": 9274, - "end": 9275, + "start": 9060, + "end": 9061, "loc": { "start": { - "line": 335, + "line": 327, "column": 19 }, "end": { - "line": 335, + "line": 327, "column": 20 } } @@ -29311,17 +28087,17 @@ "postfix": false, "binop": null }, - "value": "addEntity", - "start": 9275, - "end": 9284, + "value": "add", + "start": 9061, + "end": 9064, "loc": { "start": { - "line": 335, + "line": 327, "column": 20 }, "end": { - "line": 335, - "column": 29 + "line": 327, + "column": 23 } } }, @@ -29335,25 +28111,158 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null + }, + "start": 9064, + "end": 9065, + "loc": { + "start": { + "line": 327, + "column": 23 + }, + "end": { + "line": 327, + "column": 24 + } + } + }, + { + "type": { + "label": "this", + "keyword": "this", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "value": "this", + "start": 9065, + "end": 9069, + "loc": { + "start": { + "line": 327, + "column": 24 + }, + "end": { + "line": 327, + "column": 28 + } + } + }, + { + "type": { + "label": ",", + "beforeExpr": true, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "start": 9069, + "end": 9070, + "loc": { + "start": { + "line": 327, + "column": 28 + }, + "end": { + "line": 327, + "column": 29 + } + } + }, + { + "type": { + "label": "...", + "beforeExpr": true, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "start": 9071, + "end": 9074, + "loc": { + "start": { + "line": 327, + "column": 30 + }, + "end": { + "line": 327, + "column": 33 + } + } + }, + { + "type": { + "label": "this", + "keyword": "this", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "value": "this", + "start": 9074, + "end": 9078, + "loc": { + "start": { + "line": 327, + "column": 33 + }, + "end": { + "line": 327, + "column": 37 + } + } + }, + { + "type": { + "label": ".", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null }, - "start": 9284, - "end": 9285, + "start": 9078, + "end": 9079, "loc": { "start": { - "line": 335, - "column": 29 + "line": 327, + "column": 37 }, "end": { - "line": 335, - "column": 30 + "line": 327, + "column": 38 } } }, { "type": { - "label": "this", - "keyword": "this", + "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, @@ -29361,20 +28270,19 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "value": "this", - "start": 9285, - "end": 9289, + "value": "components", + "start": 9079, + "end": 9089, "loc": { "start": { - "line": 335, - "column": 30 + "line": 327, + "column": 38 }, "end": { - "line": 335, - "column": 34 + "line": 327, + "column": 48 } } }, @@ -29390,16 +28298,16 @@ "postfix": false, "binop": null }, - "start": 9289, - "end": 9290, + "start": 9089, + "end": 9090, "loc": { "start": { - "line": 335, - "column": 34 + "line": 327, + "column": 48 }, "end": { - "line": 335, - "column": 35 + "line": 327, + "column": 49 } } }, @@ -29415,15 +28323,15 @@ "postfix": false, "binop": null }, - "start": 9293, - "end": 9294, + "start": 9093, + "end": 9094, "loc": { "start": { - "line": 336, + "line": 328, "column": 2 }, "end": { - "line": 336, + "line": 328, "column": 3 } } @@ -29440,15 +28348,15 @@ "postfix": false, "binop": null }, - "start": 9296, - "end": 9297, + "start": 9096, + "end": 9097, "loc": { "start": { - "line": 337, + "line": 329, "column": 1 }, "end": { - "line": 337, + "line": 329, "column": 2 } } @@ -29456,15 +28364,15 @@ { "type": "CommentBlock", "value": "*\n\t * Removes this entity from the current world, without removing any components or data.\n\t * It can be re-attached to another world (or the same world), using the attach() method.\n\t * Note: Do not use detached entities, get() may be safe, but avoid calling other methods\n\t * Note: The ID will be reassigned, so do not rely on this\n\t *\n\t * @example\n\t * entity.detach()\n\t ", - "start": 9300, - "end": 9676, + "start": 9100, + "end": 9476, "loc": { "start": { - "line": 339, + "line": 331, "column": 1 }, "end": { - "line": 347, + "line": 339, "column": 4 } } @@ -29482,15 +28390,15 @@ "binop": null }, "value": "detach", - "start": 9678, - "end": 9684, + "start": 9478, + "end": 9484, "loc": { "start": { - "line": 348, + "line": 340, "column": 1 }, "end": { - "line": 348, + "line": 340, "column": 7 } } @@ -29507,15 +28415,15 @@ "postfix": false, "binop": null }, - "start": 9684, - "end": 9685, + "start": 9484, + "end": 9485, "loc": { "start": { - "line": 348, + "line": 340, "column": 7 }, "end": { - "line": 348, + "line": 340, "column": 8 } } @@ -29532,15 +28440,15 @@ "postfix": false, "binop": null }, - "start": 9685, - "end": 9686, + "start": 9485, + "end": 9486, "loc": { "start": { - "line": 348, + "line": 340, "column": 8 }, "end": { - "line": 348, + "line": 340, "column": 9 } } @@ -29557,15 +28465,15 @@ "postfix": false, "binop": null }, - "start": 9687, - "end": 9688, + "start": 9487, + "end": 9488, "loc": { "start": { - "line": 348, + "line": 340, "column": 10 }, "end": { - "line": 348, + "line": 340, "column": 11 } } @@ -29585,15 +28493,15 @@ "updateContext": null }, "value": "if", - "start": 9691, - "end": 9693, + "start": 9491, + "end": 9493, "loc": { "start": { - "line": 349, + "line": 341, "column": 2 }, "end": { - "line": 349, + "line": 341, "column": 4 } } @@ -29610,15 +28518,15 @@ "postfix": false, "binop": null }, - "start": 9694, - "end": 9695, + "start": 9494, + "end": 9495, "loc": { "start": { - "line": 349, + "line": 341, "column": 5 }, "end": { - "line": 349, + "line": 341, "column": 6 } } @@ -29638,15 +28546,15 @@ "updateContext": null }, "value": "this", - "start": 9695, - "end": 9699, + "start": 9495, + "end": 9499, "loc": { "start": { - "line": 349, + "line": 341, "column": 6 }, "end": { - "line": 349, + "line": 341, "column": 10 } } @@ -29664,15 +28572,15 @@ "binop": null, "updateContext": null }, - "start": 9699, - "end": 9700, + "start": 9499, + "end": 9500, "loc": { "start": { - "line": 349, + "line": 341, "column": 10 }, "end": { - "line": 349, + "line": 341, "column": 11 } } @@ -29690,15 +28598,15 @@ "binop": null }, "value": "valid", - "start": 9700, - "end": 9705, + "start": 9500, + "end": 9505, "loc": { "start": { - "line": 349, + "line": 341, "column": 11 }, "end": { - "line": 349, + "line": 341, "column": 16 } } @@ -29715,15 +28623,15 @@ "postfix": false, "binop": null }, - "start": 9705, - "end": 9706, + "start": 9505, + "end": 9506, "loc": { "start": { - "line": 349, + "line": 341, "column": 16 }, "end": { - "line": 349, + "line": 341, "column": 17 } } @@ -29740,15 +28648,15 @@ "postfix": false, "binop": null }, - "start": 9706, - "end": 9707, + "start": 9506, + "end": 9507, "loc": { "start": { - "line": 349, + "line": 341, "column": 17 }, "end": { - "line": 349, + "line": 341, "column": 18 } } @@ -29765,15 +28673,15 @@ "postfix": false, "binop": null }, - "start": 9707, - "end": 9708, + "start": 9507, + "end": 9508, "loc": { "start": { - "line": 349, + "line": 341, "column": 18 }, "end": { - "line": 349, + "line": 341, "column": 19 } } @@ -29790,15 +28698,15 @@ "postfix": false, "binop": null }, - "start": 9709, - "end": 9710, + "start": 9509, + "end": 9510, "loc": { "start": { - "line": 349, + "line": 341, "column": 20 }, "end": { - "line": 349, + "line": 341, "column": 21 } } @@ -29806,15 +28714,15 @@ { "type": "CommentLine", "value": " Remove from current world", - "start": 9714, - "end": 9742, + "start": 9514, + "end": 9542, "loc": { "start": { - "line": 350, + "line": 342, "column": 3 }, "end": { - "line": 350, + "line": 342, "column": 31 } } @@ -29834,15 +28742,15 @@ "updateContext": null }, "value": "this", - "start": 9746, - "end": 9750, + "start": 9546, + "end": 9550, "loc": { "start": { - "line": 351, + "line": 343, "column": 3 }, "end": { - "line": 351, + "line": 343, "column": 7 } } @@ -29860,15 +28768,15 @@ "binop": null, "updateContext": null }, - "start": 9750, - "end": 9751, + "start": 9550, + "end": 9551, "loc": { "start": { - "line": 351, + "line": 343, "column": 7 }, "end": { - "line": 351, + "line": 343, "column": 8 } } @@ -29886,15 +28794,15 @@ "binop": null }, "value": "world", - "start": 9751, - "end": 9756, + "start": 9551, + "end": 9556, "loc": { "start": { - "line": 351, + "line": 343, "column": 8 }, "end": { - "line": 351, + "line": 343, "column": 13 } } @@ -29912,15 +28820,15 @@ "binop": null, "updateContext": null }, - "start": 9756, - "end": 9757, + "start": 9556, + "end": 9557, "loc": { "start": { - "line": 351, + "line": 343, "column": 13 }, "end": { - "line": 351, + "line": 343, "column": 14 } } @@ -29938,15 +28846,15 @@ "binop": null }, "value": "index", - "start": 9757, - "end": 9762, + "start": 9557, + "end": 9562, "loc": { "start": { - "line": 351, + "line": 343, "column": 14 }, "end": { - "line": 351, + "line": 343, "column": 19 } } @@ -29964,15 +28872,15 @@ "binop": null, "updateContext": null }, - "start": 9762, - "end": 9763, + "start": 9562, + "end": 9563, "loc": { "start": { - "line": 351, + "line": 343, "column": 19 }, "end": { - "line": 351, + "line": 343, "column": 20 } } @@ -29989,17 +28897,17 @@ "postfix": false, "binop": null }, - "value": "removeEntity", - "start": 9763, - "end": 9775, + "value": "remove", + "start": 9563, + "end": 9569, "loc": { "start": { - "line": 351, + "line": 343, "column": 20 }, "end": { - "line": 351, - "column": 32 + "line": 343, + "column": 26 } } }, @@ -30015,16 +28923,16 @@ "postfix": false, "binop": null }, - "start": 9775, - "end": 9776, + "start": 9569, + "end": 9570, "loc": { "start": { - "line": 351, - "column": 32 + "line": 343, + "column": 26 }, "end": { - "line": 351, - "column": 33 + "line": 343, + "column": 27 } } }, @@ -30043,16 +28951,148 @@ "updateContext": null }, "value": "this", - "start": 9776, - "end": 9780, + "start": 9570, + "end": 9574, "loc": { "start": { - "line": 351, + "line": 343, + "column": 27 + }, + "end": { + "line": 343, + "column": 31 + } + } + }, + { + "type": { + "label": ",", + "beforeExpr": true, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "start": 9574, + "end": 9575, + "loc": { + "start": { + "line": 343, + "column": 31 + }, + "end": { + "line": 343, + "column": 32 + } + } + }, + { + "type": { + "label": "...", + "beforeExpr": true, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "start": 9576, + "end": 9579, + "loc": { + "start": { + "line": 343, "column": 33 }, "end": { - "line": 351, - "column": 37 + "line": 343, + "column": 36 + } + } + }, + { + "type": { + "label": "this", + "keyword": "this", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "value": "this", + "start": 9579, + "end": 9583, + "loc": { + "start": { + "line": 343, + "column": 36 + }, + "end": { + "line": 343, + "column": 40 + } + } + }, + { + "type": { + "label": ".", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "start": 9583, + "end": 9584, + "loc": { + "start": { + "line": 343, + "column": 40 + }, + "end": { + "line": 343, + "column": 41 + } + } + }, + { + "type": { + "label": "name", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "value": "components", + "start": 9584, + "end": 9594, + "loc": { + "start": { + "line": 343, + "column": 41 + }, + "end": { + "line": 343, + "column": 51 } } }, @@ -30068,16 +29108,16 @@ "postfix": false, "binop": null }, - "start": 9780, - "end": 9781, + "start": 9594, + "end": 9595, "loc": { "start": { - "line": 351, - "column": 37 + "line": 343, + "column": 51 }, "end": { - "line": 351, - "column": 38 + "line": 343, + "column": 52 } } }, @@ -30096,15 +29136,15 @@ "updateContext": null }, "value": "this", - "start": 9785, - "end": 9789, + "start": 9599, + "end": 9603, "loc": { "start": { - "line": 352, + "line": 344, "column": 3 }, "end": { - "line": 352, + "line": 344, "column": 7 } } @@ -30122,15 +29162,15 @@ "binop": null, "updateContext": null }, - "start": 9789, - "end": 9790, + "start": 9603, + "end": 9604, "loc": { "start": { - "line": 352, + "line": 344, "column": 7 }, "end": { - "line": 352, + "line": 344, "column": 8 } } @@ -30148,15 +29188,15 @@ "binop": null }, "value": "world", - "start": 9790, - "end": 9795, + "start": 9604, + "end": 9609, "loc": { "start": { - "line": 352, + "line": 344, "column": 8 }, "end": { - "line": 352, + "line": 344, "column": 13 } } @@ -30174,15 +29214,15 @@ "binop": null, "updateContext": null }, - "start": 9795, - "end": 9796, + "start": 9609, + "end": 9610, "loc": { "start": { - "line": 352, + "line": 344, "column": 13 }, "end": { - "line": 352, + "line": 344, "column": 14 } } @@ -30200,15 +29240,15 @@ "binop": null }, "value": "entities", - "start": 9796, - "end": 9804, + "start": 9610, + "end": 9618, "loc": { "start": { - "line": 352, + "line": 344, "column": 14 }, "end": { - "line": 352, + "line": 344, "column": 22 } } @@ -30226,15 +29266,15 @@ "binop": null, "updateContext": null }, - "start": 9804, - "end": 9805, + "start": 9618, + "end": 9619, "loc": { "start": { - "line": 352, + "line": 344, "column": 22 }, "end": { - "line": 352, + "line": 344, "column": 23 } } @@ -30254,15 +29294,15 @@ "updateContext": null }, "value": "delete", - "start": 9805, - "end": 9811, + "start": 9619, + "end": 9625, "loc": { "start": { - "line": 352, + "line": 344, "column": 23 }, "end": { - "line": 352, + "line": 344, "column": 29 } } @@ -30279,15 +29319,15 @@ "postfix": false, "binop": null }, - "start": 9811, - "end": 9812, + "start": 9625, + "end": 9626, "loc": { "start": { - "line": 352, + "line": 344, "column": 29 }, "end": { - "line": 352, + "line": 344, "column": 30 } } @@ -30307,15 +29347,15 @@ "updateContext": null }, "value": "this", - "start": 9812, - "end": 9816, + "start": 9626, + "end": 9630, "loc": { "start": { - "line": 352, + "line": 344, "column": 30 }, "end": { - "line": 352, + "line": 344, "column": 34 } } @@ -30333,15 +29373,15 @@ "binop": null, "updateContext": null }, - "start": 9816, - "end": 9817, + "start": 9630, + "end": 9631, "loc": { "start": { - "line": 352, + "line": 344, "column": 34 }, "end": { - "line": 352, + "line": 344, "column": 35 } } @@ -30359,15 +29399,15 @@ "binop": null }, "value": "_id", - "start": 9817, - "end": 9820, + "start": 9631, + "end": 9634, "loc": { "start": { - "line": 352, + "line": 344, "column": 35 }, "end": { - "line": 352, + "line": 344, "column": 38 } } @@ -30384,15 +29424,15 @@ "postfix": false, "binop": null }, - "start": 9820, - "end": 9821, + "start": 9634, + "end": 9635, "loc": { "start": { - "line": 352, + "line": 344, "column": 38 }, "end": { - "line": 352, + "line": 344, "column": 39 } } @@ -30412,15 +29452,15 @@ "updateContext": null }, "value": "this", - "start": 9825, - "end": 9829, + "start": 9639, + "end": 9643, "loc": { "start": { - "line": 353, + "line": 345, "column": 3 }, "end": { - "line": 353, + "line": 345, "column": 7 } } @@ -30438,15 +29478,15 @@ "binop": null, "updateContext": null }, - "start": 9829, - "end": 9830, + "start": 9643, + "end": 9644, "loc": { "start": { - "line": 353, + "line": 345, "column": 7 }, "end": { - "line": 353, + "line": 345, "column": 8 } } @@ -30464,15 +29504,15 @@ "binop": null }, "value": "_id", - "start": 9830, - "end": 9833, + "start": 9644, + "end": 9647, "loc": { "start": { - "line": 353, + "line": 345, "column": 8 }, "end": { - "line": 353, + "line": 345, "column": 11 } } @@ -30491,15 +29531,15 @@ "updateContext": null }, "value": "=", - "start": 9834, - "end": 9835, + "start": 9648, + "end": 9649, "loc": { "start": { - "line": 353, + "line": 345, "column": 12 }, "end": { - "line": 353, + "line": 345, "column": 13 } } @@ -30517,15 +29557,15 @@ "binop": null }, "value": "undefined", - "start": 9836, - "end": 9845, + "start": 9650, + "end": 9659, "loc": { "start": { - "line": 353, + "line": 345, "column": 14 }, "end": { - "line": 353, + "line": 345, "column": 23 } } @@ -30545,15 +29585,15 @@ "updateContext": null }, "value": "this", - "start": 9849, - "end": 9853, + "start": 9663, + "end": 9667, "loc": { "start": { - "line": 354, + "line": 346, "column": 3 }, "end": { - "line": 354, + "line": 346, "column": 7 } } @@ -30571,15 +29611,15 @@ "binop": null, "updateContext": null }, - "start": 9853, - "end": 9854, + "start": 9667, + "end": 9668, "loc": { "start": { - "line": 354, + "line": 346, "column": 7 }, "end": { - "line": 354, + "line": 346, "column": 8 } } @@ -30597,15 +29637,15 @@ "binop": null }, "value": "world", - "start": 9854, - "end": 9859, + "start": 9668, + "end": 9673, "loc": { "start": { - "line": 354, + "line": 346, "column": 8 }, "end": { - "line": 354, + "line": 346, "column": 13 } } @@ -30624,15 +29664,15 @@ "updateContext": null }, "value": "=", - "start": 9860, - "end": 9861, + "start": 9674, + "end": 9675, "loc": { "start": { - "line": 354, + "line": 346, "column": 14 }, "end": { - "line": 354, + "line": 346, "column": 15 } } @@ -30650,15 +29690,15 @@ "binop": null }, "value": "undefined", - "start": 9862, - "end": 9871, + "start": 9676, + "end": 9685, "loc": { "start": { - "line": 354, + "line": 346, "column": 16 }, "end": { - "line": 354, + "line": 346, "column": 25 } } @@ -30675,15 +29715,15 @@ "postfix": false, "binop": null }, - "start": 9874, - "end": 9875, + "start": 9688, + "end": 9689, "loc": { "start": { - "line": 355, + "line": 347, "column": 2 }, "end": { - "line": 355, + "line": 347, "column": 3 } } @@ -30700,15 +29740,15 @@ "postfix": false, "binop": null }, - "start": 9877, - "end": 9878, + "start": 9691, + "end": 9692, "loc": { "start": { - "line": 356, + "line": 348, "column": 1 }, "end": { - "line": 356, + "line": 348, "column": 2 } } @@ -30725,15 +29765,15 @@ "postfix": false, "binop": null }, - "start": 9879, - "end": 9880, + "start": 9693, + "end": 9694, "loc": { "start": { - "line": 357, + "line": 349, "column": 0 }, "end": { - "line": 357, + "line": 349, "column": 1 } } @@ -30751,15 +29791,15 @@ "binop": null }, "value": "exports", - "start": 9882, - "end": 9889, + "start": 9696, + "end": 9703, "loc": { "start": { - "line": 359, + "line": 351, "column": 0 }, "end": { - "line": 359, + "line": 351, "column": 7 } } @@ -30777,15 +29817,15 @@ "binop": null, "updateContext": null }, - "start": 9889, - "end": 9890, + "start": 9703, + "end": 9704, "loc": { "start": { - "line": 359, + "line": 351, "column": 7 }, "end": { - "line": 359, + "line": 351, "column": 8 } } @@ -30803,15 +29843,15 @@ "binop": null }, "value": "Entity", - "start": 9890, - "end": 9896, + "start": 9704, + "end": 9710, "loc": { "start": { - "line": 359, + "line": 351, "column": 8 }, "end": { - "line": 359, + "line": 351, "column": 14 } } @@ -30830,15 +29870,15 @@ "updateContext": null }, "value": "=", - "start": 9897, - "end": 9898, + "start": 9711, + "end": 9712, "loc": { "start": { - "line": 359, + "line": 351, "column": 15 }, "end": { - "line": 359, + "line": 351, "column": 16 } } @@ -30856,15 +29896,15 @@ "binop": null }, "value": "Entity", - "start": 9899, - "end": 9905, + "start": 9713, + "end": 9719, "loc": { "start": { - "line": 359, + "line": 351, "column": 17 }, "end": { - "line": 359, + "line": 351, "column": 23 } } @@ -30882,15 +29922,15 @@ "binop": null, "updateContext": null }, - "start": 9906, - "end": 9906, + "start": 9720, + "end": 9720, "loc": { "start": { - "line": 360, + "line": 352, "column": 0 }, "end": { - "line": 360, + "line": 352, "column": 0 } } diff --git a/docs/ast/source/memoized_query_index.js.json b/docs/ast/source/memoized_query_index.js.json index c9d91e0..4c498dc 100644 --- a/docs/ast/source/memoized_query_index.js.json +++ b/docs/ast/source/memoized_query_index.js.json @@ -1,28 +1,28 @@ { "type": "File", "start": 0, - "end": 2606, + "end": 2383, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 101, + "line": 91, "column": 0 } }, "program": { "type": "Program", "start": 0, - "end": 2606, + "end": 2383, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 101, + "line": 91, "column": 0 } }, @@ -31,14 +31,14 @@ { "type": "ClassDeclaration", "start": 259, - "end": 2556, + "end": 2333, "loc": { "start": { "line": 7, "column": 0 }, "end": { - "line": 98, + "line": 88, "column": 1 } }, @@ -64,14 +64,14 @@ "body": { "type": "ClassBody", "start": 284, - "end": 2556, + "end": 2333, "loc": { "start": { "line": 7, "column": 25 }, "end": { - "line": 98, + "line": 88, "column": 1 } }, @@ -3058,9 +3058,9 @@ "trailingComments": [ { "type": "CommentLine", - "value": " Must use all component names", + "value": " Must use all component names from entity", "start": 1638, - "end": 1669, + "end": 1681, "loc": { "start": { "line": 63, @@ -3068,7 +3068,7 @@ }, "end": { "line": 63, - "column": 32 + "column": 44 } } } @@ -3076,8 +3076,8 @@ }, { "type": "ClassMethod", - "start": 1671, - "end": 1941, + "start": 1683, + "end": 1953, "loc": { "start": { "line": 64, @@ -3092,8 +3092,8 @@ "computed": false, "key": { "type": "Identifier", - "start": 1671, - "end": 1674, + "start": 1683, + "end": 1686, "loc": { "start": { "line": 64, @@ -3116,8 +3116,8 @@ "params": [ { "type": "Identifier", - "start": 1675, - "end": 1681, + "start": 1687, + "end": 1693, "loc": { "start": { "line": 64, @@ -3134,8 +3134,8 @@ ], "body": { "type": "BlockStatement", - "start": 1683, - "end": 1941, + "start": 1695, + "end": 1953, "loc": { "start": { "line": 64, @@ -3149,8 +3149,8 @@ "body": [ { "type": "ForInStatement", - "start": 1687, - "end": 1938, + "start": 1699, + "end": 1950, "loc": { "start": { "line": 65, @@ -3163,8 +3163,8 @@ }, "left": { "type": "VariableDeclaration", - "start": 1692, - "end": 1700, + "start": 1704, + "end": 1712, "loc": { "start": { "line": 65, @@ -3178,8 +3178,8 @@ "declarations": [ { "type": "VariableDeclarator", - "start": 1696, - "end": 1700, + "start": 1708, + "end": 1712, "loc": { "start": { "line": 65, @@ -3192,8 +3192,8 @@ }, "id": { "type": "Identifier", - "start": 1696, - "end": 1700, + "start": 1708, + "end": 1712, "loc": { "start": { "line": 65, @@ -3214,8 +3214,8 @@ }, "right": { "type": "MemberExpression", - "start": 1704, - "end": 1714, + "start": 1716, + "end": 1726, "loc": { "start": { "line": 65, @@ -3228,8 +3228,8 @@ }, "object": { "type": "ThisExpression", - "start": 1704, - "end": 1708, + "start": 1716, + "end": 1720, "loc": { "start": { "line": 65, @@ -3243,8 +3243,8 @@ }, "property": { "type": "Identifier", - "start": 1709, - "end": 1714, + "start": 1721, + "end": 1726, "loc": { "start": { "line": 65, @@ -3262,8 +3262,8 @@ }, "body": { "type": "BlockStatement", - "start": 1716, - "end": 1938, + "start": 1728, + "end": 1950, "loc": { "start": { "line": 65, @@ -3277,8 +3277,8 @@ "body": [ { "type": "VariableDeclaration", - "start": 1721, - "end": 1751, + "start": 1733, + "end": 1763, "loc": { "start": { "line": 66, @@ -3292,8 +3292,8 @@ "declarations": [ { "type": "VariableDeclarator", - "start": 1727, - "end": 1751, + "start": 1739, + "end": 1763, "loc": { "start": { "line": 66, @@ -3306,8 +3306,8 @@ }, "id": { "type": "Identifier", - "start": 1727, - "end": 1732, + "start": 1739, + "end": 1744, "loc": { "start": { "line": 66, @@ -3323,8 +3323,8 @@ }, "init": { "type": "MemberExpression", - "start": 1735, - "end": 1751, + "start": 1747, + "end": 1763, "loc": { "start": { "line": 66, @@ -3337,8 +3337,8 @@ }, "object": { "type": "MemberExpression", - "start": 1735, - "end": 1745, + "start": 1747, + "end": 1757, "loc": { "start": { "line": 66, @@ -3351,8 +3351,8 @@ }, "object": { "type": "ThisExpression", - "start": 1735, - "end": 1739, + "start": 1747, + "end": 1751, "loc": { "start": { "line": 66, @@ -3366,8 +3366,8 @@ }, "property": { "type": "Identifier", - "start": 1740, - "end": 1745, + "start": 1752, + "end": 1757, "loc": { "start": { "line": 66, @@ -3385,8 +3385,8 @@ }, "property": { "type": "Identifier", - "start": 1746, - "end": 1750, + "start": 1758, + "end": 1762, "loc": { "start": { "line": 66, @@ -3411,8 +3411,8 @@ { "type": "CommentLine", "value": " Check if the entity has all of the components of the index group", - "start": 1756, - "end": 1823, + "start": 1768, + "end": 1835, "loc": { "start": { "line": 68, @@ -3428,8 +3428,8 @@ }, { "type": "IfStatement", - "start": 1827, - "end": 1934, + "start": 1839, + "end": 1946, "loc": { "start": { "line": 69, @@ -3442,8 +3442,8 @@ }, "test": { "type": "CallExpression", - "start": 1831, - "end": 1862, + "start": 1843, + "end": 1874, "loc": { "start": { "line": 69, @@ -3456,8 +3456,8 @@ }, "callee": { "type": "MemberExpression", - "start": 1831, - "end": 1841, + "start": 1843, + "end": 1853, "loc": { "start": { "line": 69, @@ -3470,8 +3470,8 @@ }, "object": { "type": "Identifier", - "start": 1831, - "end": 1837, + "start": 1843, + "end": 1849, "loc": { "start": { "line": 69, @@ -3488,8 +3488,8 @@ }, "property": { "type": "Identifier", - "start": 1838, - "end": 1841, + "start": 1850, + "end": 1853, "loc": { "start": { "line": 69, @@ -3509,8 +3509,8 @@ "arguments": [ { "type": "SpreadElement", - "start": 1842, - "end": 1861, + "start": 1854, + "end": 1873, "loc": { "start": { "line": 69, @@ -3523,8 +3523,8 @@ }, "argument": { "type": "MemberExpression", - "start": 1845, - "end": 1861, + "start": 1857, + "end": 1873, "loc": { "start": { "line": 69, @@ -3537,8 +3537,8 @@ }, "object": { "type": "Identifier", - "start": 1845, - "end": 1850, + "start": 1857, + "end": 1862, "loc": { "start": { "line": 69, @@ -3554,8 +3554,8 @@ }, "property": { "type": "Identifier", - "start": 1851, - "end": 1861, + "start": 1863, + "end": 1873, "loc": { "start": { "line": 69, @@ -3577,8 +3577,8 @@ }, "consequent": { "type": "BlockStatement", - "start": 1864, - "end": 1934, + "start": 1876, + "end": 1946, "loc": { "start": { "line": 69, @@ -3592,8 +3592,8 @@ "body": [ { "type": "ExpressionStatement", - "start": 1892, - "end": 1929, + "start": 1904, + "end": 1941, "loc": { "start": { "line": 71, @@ -3606,8 +3606,8 @@ }, "expression": { "type": "CallExpression", - "start": 1892, - "end": 1929, + "start": 1904, + "end": 1941, "loc": { "start": { "line": 71, @@ -3620,8 +3620,8 @@ }, "callee": { "type": "MemberExpression", - "start": 1892, - "end": 1910, + "start": 1904, + "end": 1922, "loc": { "start": { "line": 71, @@ -3634,8 +3634,8 @@ }, "object": { "type": "MemberExpression", - "start": 1892, - "end": 1906, + "start": 1904, + "end": 1918, "loc": { "start": { "line": 71, @@ -3648,8 +3648,8 @@ }, "object": { "type": "Identifier", - "start": 1892, - "end": 1897, + "start": 1904, + "end": 1909, "loc": { "start": { "line": 71, @@ -3666,8 +3666,8 @@ }, "property": { "type": "Identifier", - "start": 1898, - "end": 1906, + "start": 1910, + "end": 1918, "loc": { "start": { "line": 71, @@ -3686,8 +3686,8 @@ }, "property": { "type": "Identifier", - "start": 1907, - "end": 1910, + "start": 1919, + "end": 1922, "loc": { "start": { "line": 71, @@ -3707,8 +3707,8 @@ "arguments": [ { "type": "MemberExpression", - "start": 1911, - "end": 1920, + "start": 1923, + "end": 1932, "loc": { "start": { "line": 71, @@ -3721,8 +3721,8 @@ }, "object": { "type": "Identifier", - "start": 1911, - "end": 1917, + "start": 1923, + "end": 1929, "loc": { "start": { "line": 71, @@ -3738,8 +3738,8 @@ }, "property": { "type": "Identifier", - "start": 1918, - "end": 1920, + "start": 1930, + "end": 1932, "loc": { "start": { "line": 71, @@ -3757,8 +3757,8 @@ }, { "type": "Identifier", - "start": 1922, - "end": 1928, + "start": 1934, + "end": 1940, "loc": { "start": { "line": 71, @@ -3779,8 +3779,8 @@ { "type": "CommentLine", "value": " Add the entity", - "start": 1870, - "end": 1887, + "start": 1882, + "end": 1899, "loc": { "start": { "line": 70, @@ -3802,8 +3802,8 @@ { "type": "CommentLine", "value": " Check if the entity has all of the components of the index group", - "start": 1756, - "end": 1823, + "start": 1768, + "end": 1835, "loc": { "start": { "line": 68, @@ -3828,9 +3828,9 @@ "leadingComments": [ { "type": "CommentLine", - "value": " Must use all component names", + "value": " Must use all component names from entity", "start": 1638, - "end": 1669, + "end": 1681, "loc": { "start": { "line": 63, @@ -3838,7 +3838,7 @@ }, "end": { "line": 63, - "column": 32 + "column": 44 } } } @@ -3846,9 +3846,9 @@ "trailingComments": [ { "type": "CommentLine", - "value": " Add an entity and all of its components to the index", - "start": 1944, - "end": 1999, + "value": " Remove certain components from the index for an entity", + "start": 1956, + "end": 2013, "loc": { "start": { "line": 76, @@ -3856,7 +3856,7 @@ }, "end": { "line": 76, - "column": 56 + "column": 58 } } } @@ -3864,15 +3864,15 @@ }, { "type": "ClassMethod", - "start": 2001, - "end": 2042, + "start": 2015, + "end": 2331, "loc": { "start": { "line": 77, "column": 1 }, "end": { - "line": 79, + "line": 87, "column": 2 } }, @@ -3880,8 +3880,8 @@ "computed": false, "key": { "type": "Identifier", - "start": 2001, - "end": 2010, + "start": 2015, + "end": 2021, "loc": { "start": { "line": 77, @@ -3889,217 +3889,6 @@ }, "end": { "line": 77, - "column": 10 - }, - "identifierName": "addEntity" - }, - "name": "addEntity", - "leadingComments": null - }, - "kind": "method", - "id": null, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "Identifier", - "start": 2011, - "end": 2017, - "loc": { - "start": { - "line": 77, - "column": 11 - }, - "end": { - "line": 77, - "column": 17 - }, - "identifierName": "entity" - }, - "name": "entity" - } - ], - "body": { - "type": "BlockStatement", - "start": 2019, - "end": 2042, - "loc": { - "start": { - "line": 77, - "column": 19 - }, - "end": { - "line": 79, - "column": 2 - } - }, - "body": [ - { - "type": "ExpressionStatement", - "start": 2023, - "end": 2039, - "loc": { - "start": { - "line": 78, - "column": 2 - }, - "end": { - "line": 78, - "column": 18 - } - }, - "expression": { - "type": "CallExpression", - "start": 2023, - "end": 2039, - "loc": { - "start": { - "line": 78, - "column": 2 - }, - "end": { - "line": 78, - "column": 18 - } - }, - "callee": { - "type": "MemberExpression", - "start": 2023, - "end": 2031, - "loc": { - "start": { - "line": 78, - "column": 2 - }, - "end": { - "line": 78, - "column": 10 - } - }, - "object": { - "type": "ThisExpression", - "start": 2023, - "end": 2027, - "loc": { - "start": { - "line": 78, - "column": 2 - }, - "end": { - "line": 78, - "column": 6 - } - } - }, - "property": { - "type": "Identifier", - "start": 2028, - "end": 2031, - "loc": { - "start": { - "line": 78, - "column": 7 - }, - "end": { - "line": 78, - "column": 10 - }, - "identifierName": "add" - }, - "name": "add" - }, - "computed": false - }, - "arguments": [ - { - "type": "Identifier", - "start": 2032, - "end": 2038, - "loc": { - "start": { - "line": 78, - "column": 11 - }, - "end": { - "line": 78, - "column": 17 - }, - "identifierName": "entity" - }, - "name": "entity" - } - ] - } - } - ], - "directives": [], - "trailingComments": null - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Add an entity and all of its components to the index", - "start": 1944, - "end": 1999, - "loc": { - "start": { - "line": 76, - "column": 1 - }, - "end": { - "line": 76, - "column": 56 - } - } - } - ], - "trailingComments": [ - { - "type": "CommentLine", - "value": " Remove certain components from the index for an entity", - "start": 2045, - "end": 2102, - "loc": { - "start": { - "line": 81, - "column": 1 - }, - "end": { - "line": 81, - "column": 58 - } - } - } - ] - }, - { - "type": "ClassMethod", - "start": 2104, - "end": 2420, - "loc": { - "start": { - "line": 82, - "column": 1 - }, - "end": { - "line": 92, - "column": 2 - } - }, - "static": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 2104, - "end": 2110, - "loc": { - "start": { - "line": 82, - "column": 1 - }, - "end": { - "line": 82, "column": 7 }, "identifierName": "remove" @@ -4115,15 +3904,15 @@ "params": [ { "type": "Identifier", - "start": 2111, - "end": 2117, + "start": 2022, + "end": 2028, "loc": { "start": { - "line": 82, + "line": 77, "column": 8 }, "end": { - "line": 82, + "line": 77, "column": 14 }, "identifierName": "entity" @@ -4132,29 +3921,29 @@ }, { "type": "RestElement", - "start": 2119, - "end": 2136, + "start": 2030, + "end": 2047, "loc": { "start": { - "line": 82, + "line": 77, "column": 16 }, "end": { - "line": 82, + "line": 77, "column": 33 } }, "argument": { "type": "Identifier", - "start": 2122, - "end": 2136, + "start": 2033, + "end": 2047, "loc": { "start": { - "line": 82, + "line": 77, "column": 19 }, "end": { - "line": 82, + "line": 77, "column": 33 }, "identifierName": "componentNames" @@ -4165,73 +3954,73 @@ ], "body": { "type": "BlockStatement", - "start": 2138, - "end": 2420, + "start": 2049, + "end": 2331, "loc": { "start": { - "line": 82, + "line": 77, "column": 35 }, "end": { - "line": 92, + "line": 87, "column": 2 } }, "body": [ { "type": "ForInStatement", - "start": 2142, - "end": 2417, + "start": 2053, + "end": 2328, "loc": { "start": { - "line": 83, + "line": 78, "column": 2 }, "end": { - "line": 91, + "line": 86, "column": 3 } }, "left": { "type": "VariableDeclaration", - "start": 2147, - "end": 2155, + "start": 2058, + "end": 2066, "loc": { "start": { - "line": 83, + "line": 78, "column": 7 }, "end": { - "line": 83, + "line": 78, "column": 15 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 2151, - "end": 2155, + "start": 2062, + "end": 2066, "loc": { "start": { - "line": 83, + "line": 78, "column": 11 }, "end": { - "line": 83, + "line": 78, "column": 15 } }, "id": { "type": "Identifier", - "start": 2151, - "end": 2155, + "start": 2062, + "end": 2066, "loc": { "start": { - "line": 83, + "line": 78, "column": 11 }, "end": { - "line": 83, + "line": 78, "column": 15 }, "identifierName": "hash" @@ -4245,44 +4034,44 @@ }, "right": { "type": "MemberExpression", - "start": 2159, - "end": 2169, + "start": 2070, + "end": 2080, "loc": { "start": { - "line": 83, + "line": 78, "column": 19 }, "end": { - "line": 83, + "line": 78, "column": 29 } }, "object": { "type": "ThisExpression", - "start": 2159, - "end": 2163, + "start": 2070, + "end": 2074, "loc": { "start": { - "line": 83, + "line": 78, "column": 19 }, "end": { - "line": 83, + "line": 78, "column": 23 } } }, "property": { "type": "Identifier", - "start": 2164, - "end": 2169, + "start": 2075, + "end": 2080, "loc": { "start": { - "line": 83, + "line": 78, "column": 24 }, "end": { - "line": 83, + "line": 78, "column": 29 }, "identifierName": "index" @@ -4293,59 +4082,59 @@ }, "body": { "type": "BlockStatement", - "start": 2171, - "end": 2417, + "start": 2082, + "end": 2328, "loc": { "start": { - "line": 83, + "line": 78, "column": 31 }, "end": { - "line": 91, + "line": 86, "column": 3 } }, "body": [ { "type": "VariableDeclaration", - "start": 2176, - "end": 2206, + "start": 2087, + "end": 2117, "loc": { "start": { - "line": 84, + "line": 79, "column": 3 }, "end": { - "line": 84, + "line": 79, "column": 33 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 2182, - "end": 2206, + "start": 2093, + "end": 2117, "loc": { "start": { - "line": 84, + "line": 79, "column": 9 }, "end": { - "line": 84, + "line": 79, "column": 33 } }, "id": { "type": "Identifier", - "start": 2182, - "end": 2187, + "start": 2093, + "end": 2098, "loc": { "start": { - "line": 84, + "line": 79, "column": 9 }, "end": { - "line": 84, + "line": 79, "column": 14 }, "identifierName": "group" @@ -4354,58 +4143,58 @@ }, "init": { "type": "MemberExpression", - "start": 2190, - "end": 2206, + "start": 2101, + "end": 2117, "loc": { "start": { - "line": 84, + "line": 79, "column": 17 }, "end": { - "line": 84, + "line": 79, "column": 33 } }, "object": { "type": "MemberExpression", - "start": 2190, - "end": 2200, + "start": 2101, + "end": 2111, "loc": { "start": { - "line": 84, + "line": 79, "column": 17 }, "end": { - "line": 84, + "line": 79, "column": 27 } }, "object": { "type": "ThisExpression", - "start": 2190, - "end": 2194, + "start": 2101, + "end": 2105, "loc": { "start": { - "line": 84, + "line": 79, "column": 17 }, "end": { - "line": 84, + "line": 79, "column": 21 } } }, "property": { "type": "Identifier", - "start": 2195, - "end": 2200, + "start": 2106, + "end": 2111, "loc": { "start": { - "line": 84, + "line": 79, "column": 22 }, "end": { - "line": 84, + "line": 79, "column": 27 }, "identifierName": "index" @@ -4416,15 +4205,15 @@ }, "property": { "type": "Identifier", - "start": 2201, - "end": 2205, + "start": 2112, + "end": 2116, "loc": { "start": { - "line": 84, + "line": 79, "column": 28 }, "end": { - "line": 84, + "line": 79, "column": 32 }, "identifierName": "hash" @@ -4442,15 +4231,15 @@ { "type": "CommentLine", "value": " Check if index group has any of the components that the entity has", - "start": 2211, - "end": 2280, + "start": 2122, + "end": 2191, "loc": { "start": { - "line": 86, + "line": 81, "column": 3 }, "end": { - "line": 86, + "line": 81, "column": 72 } } @@ -4459,57 +4248,57 @@ }, { "type": "IfStatement", - "start": 2284, - "end": 2413, + "start": 2195, + "end": 2324, "loc": { "start": { - "line": 87, + "line": 82, "column": 3 }, "end": { - "line": 90, + "line": 85, "column": 4 } }, "test": { "type": "CallExpression", - "start": 2288, - "end": 2343, + "start": 2199, + "end": 2254, "loc": { "start": { - "line": 87, + "line": 82, "column": 7 }, "end": { - "line": 87, + "line": 82, "column": 62 } }, "callee": { "type": "MemberExpression", - "start": 2288, - "end": 2307, + "start": 2199, + "end": 2218, "loc": { "start": { - "line": 87, + "line": 82, "column": 7 }, "end": { - "line": 87, + "line": 82, "column": 26 } }, "object": { "type": "Identifier", - "start": 2288, - "end": 2302, + "start": 2199, + "end": 2213, "loc": { "start": { - "line": 87, + "line": 82, "column": 7 }, "end": { - "line": 87, + "line": 82, "column": 21 }, "identifierName": "componentNames" @@ -4519,15 +4308,15 @@ }, "property": { "type": "Identifier", - "start": 2303, - "end": 2307, + "start": 2214, + "end": 2218, "loc": { "start": { - "line": 87, + "line": 82, "column": 22 }, "end": { - "line": 87, + "line": 82, "column": 26 }, "identifierName": "some" @@ -4540,15 +4329,15 @@ "arguments": [ { "type": "ArrowFunctionExpression", - "start": 2308, - "end": 2342, + "start": 2219, + "end": 2253, "loc": { "start": { - "line": 87, + "line": 82, "column": 27 }, "end": { - "line": 87, + "line": 82, "column": 61 } }, @@ -4559,15 +4348,15 @@ "params": [ { "type": "Identifier", - "start": 2308, - "end": 2312, + "start": 2219, + "end": 2223, "loc": { "start": { - "line": 87, + "line": 82, "column": 27 }, "end": { - "line": 87, + "line": 82, "column": 31 }, "identifierName": "name" @@ -4577,57 +4366,57 @@ ], "body": { "type": "CallExpression", - "start": 2316, - "end": 2342, + "start": 2227, + "end": 2253, "loc": { "start": { - "line": 87, + "line": 82, "column": 35 }, "end": { - "line": 87, + "line": 82, "column": 61 } }, "callee": { "type": "MemberExpression", - "start": 2316, - "end": 2336, + "start": 2227, + "end": 2247, "loc": { "start": { - "line": 87, + "line": 82, "column": 35 }, "end": { - "line": 87, + "line": 82, "column": 55 } }, "object": { "type": "MemberExpression", - "start": 2316, - "end": 2332, + "start": 2227, + "end": 2243, "loc": { "start": { - "line": 87, + "line": 82, "column": 35 }, "end": { - "line": 87, + "line": 82, "column": 51 } }, "object": { "type": "Identifier", - "start": 2316, - "end": 2321, + "start": 2227, + "end": 2232, "loc": { "start": { - "line": 87, + "line": 82, "column": 35 }, "end": { - "line": 87, + "line": 82, "column": 40 }, "identifierName": "group" @@ -4636,15 +4425,15 @@ }, "property": { "type": "Identifier", - "start": 2322, - "end": 2332, + "start": 2233, + "end": 2243, "loc": { "start": { - "line": 87, + "line": 82, "column": 41 }, "end": { - "line": 87, + "line": 82, "column": 51 }, "identifierName": "components" @@ -4655,15 +4444,15 @@ }, "property": { "type": "Identifier", - "start": 2333, - "end": 2336, + "start": 2244, + "end": 2247, "loc": { "start": { - "line": 87, + "line": 82, "column": 52 }, "end": { - "line": 87, + "line": 82, "column": 55 }, "identifierName": "has" @@ -4675,15 +4464,15 @@ "arguments": [ { "type": "Identifier", - "start": 2337, - "end": 2341, + "start": 2248, + "end": 2252, "loc": { "start": { - "line": 87, + "line": 82, "column": 56 }, "end": { - "line": 87, + "line": 82, "column": 60 }, "identifierName": "name" @@ -4698,86 +4487,86 @@ }, "consequent": { "type": "BlockStatement", - "start": 2345, - "end": 2413, + "start": 2256, + "end": 2324, "loc": { "start": { - "line": 87, + "line": 82, "column": 64 }, "end": { - "line": 90, + "line": 85, "column": 4 } }, "body": [ { "type": "ExpressionStatement", - "start": 2376, - "end": 2408, + "start": 2287, + "end": 2319, "loc": { "start": { - "line": 89, + "line": 84, "column": 4 }, "end": { - "line": 89, + "line": 84, "column": 36 } }, "expression": { "type": "CallExpression", - "start": 2376, - "end": 2408, + "start": 2287, + "end": 2319, "loc": { "start": { - "line": 89, + "line": 84, "column": 4 }, "end": { - "line": 89, + "line": 84, "column": 36 } }, "callee": { "type": "MemberExpression", - "start": 2376, - "end": 2397, + "start": 2287, + "end": 2308, "loc": { "start": { - "line": 89, + "line": 84, "column": 4 }, "end": { - "line": 89, + "line": 84, "column": 25 } }, "object": { "type": "MemberExpression", - "start": 2376, - "end": 2390, + "start": 2287, + "end": 2301, "loc": { "start": { - "line": 89, + "line": 84, "column": 4 }, "end": { - "line": 89, + "line": 84, "column": 18 } }, "object": { "type": "Identifier", - "start": 2376, - "end": 2381, + "start": 2287, + "end": 2292, "loc": { "start": { - "line": 89, + "line": 84, "column": 4 }, "end": { - "line": 89, + "line": 84, "column": 9 }, "identifierName": "group" @@ -4787,15 +4576,15 @@ }, "property": { "type": "Identifier", - "start": 2382, - "end": 2390, + "start": 2293, + "end": 2301, "loc": { "start": { - "line": 89, + "line": 84, "column": 10 }, "end": { - "line": 89, + "line": 84, "column": 18 }, "identifierName": "entities" @@ -4807,15 +4596,15 @@ }, "property": { "type": "Identifier", - "start": 2391, - "end": 2397, + "start": 2302, + "end": 2308, "loc": { "start": { - "line": 89, + "line": 84, "column": 19 }, "end": { - "line": 89, + "line": 84, "column": 25 }, "identifierName": "delete" @@ -4828,29 +4617,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 2398, - "end": 2407, + "start": 2309, + "end": 2318, "loc": { "start": { - "line": 89, + "line": 84, "column": 26 }, "end": { - "line": 89, + "line": 84, "column": 35 } }, "object": { "type": "Identifier", - "start": 2398, - "end": 2404, + "start": 2309, + "end": 2315, "loc": { "start": { - "line": 89, + "line": 84, "column": 26 }, "end": { - "line": 89, + "line": 84, "column": 32 }, "identifierName": "entity" @@ -4859,15 +4648,15 @@ }, "property": { "type": "Identifier", - "start": 2405, - "end": 2407, + "start": 2316, + "end": 2318, "loc": { "start": { - "line": 89, + "line": 84, "column": 33 }, "end": { - "line": 89, + "line": 84, "column": 35 }, "identifierName": "id" @@ -4883,15 +4672,15 @@ { "type": "CommentLine", "value": " Remove the entity", - "start": 2351, - "end": 2371, + "start": 2262, + "end": 2282, "loc": { "start": { - "line": 88, + "line": 83, "column": 4 }, "end": { - "line": 88, + "line": 83, "column": 24 } } @@ -4906,15 +4695,15 @@ { "type": "CommentLine", "value": " Check if index group has any of the components that the entity has", - "start": 2211, - "end": 2280, + "start": 2122, + "end": 2191, "loc": { "start": { - "line": 86, + "line": 81, "column": 3 }, "end": { - "line": 86, + "line": 81, "column": 72 } } @@ -4926,315 +4715,39 @@ } } ], - "directives": [], - "trailingComments": null + "directives": [] }, "leadingComments": [ { "type": "CommentLine", "value": " Remove certain components from the index for an entity", - "start": 2045, - "end": 2102, + "start": 1956, + "end": 2013, "loc": { "start": { - "line": 81, + "line": 76, "column": 1 }, "end": { - "line": 81, + "line": 76, "column": 58 } } } - ], - "trailingComments": [ - { - "type": "CommentLine", - "value": " Remove an entity and all of its components from the index", - "start": 2423, - "end": 2483, - "loc": { - "start": { - "line": 94, - "column": 1 - }, - "end": { - "line": 94, - "column": 61 - } - } - } ] - }, - { - "type": "ClassMethod", - "start": 2485, - "end": 2554, - "loc": { - "start": { - "line": 95, - "column": 1 - }, - "end": { - "line": 97, - "column": 2 - } - }, - "static": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 2485, - "end": 2497, - "loc": { - "start": { - "line": 95, - "column": 1 - }, - "end": { - "line": 95, - "column": 13 - }, - "identifierName": "removeEntity" - }, - "name": "removeEntity", - "leadingComments": null - }, - "kind": "method", - "id": null, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "Identifier", - "start": 2498, - "end": 2504, - "loc": { - "start": { - "line": 95, - "column": 14 - }, - "end": { - "line": 95, - "column": 20 - }, - "identifierName": "entity" - }, - "name": "entity" - } - ], - "body": { - "type": "BlockStatement", - "start": 2506, - "end": 2554, - "loc": { - "start": { - "line": 95, - "column": 22 - }, - "end": { - "line": 97, - "column": 2 - } - }, - "body": [ - { - "type": "ExpressionStatement", - "start": 2510, - "end": 2551, - "loc": { - "start": { - "line": 96, - "column": 2 - }, - "end": { - "line": 96, - "column": 43 - } - }, - "expression": { - "type": "CallExpression", - "start": 2510, - "end": 2551, - "loc": { - "start": { - "line": 96, - "column": 2 - }, - "end": { - "line": 96, - "column": 43 - } - }, - "callee": { - "type": "MemberExpression", - "start": 2510, - "end": 2521, - "loc": { - "start": { - "line": 96, - "column": 2 - }, - "end": { - "line": 96, - "column": 13 - } - }, - "object": { - "type": "ThisExpression", - "start": 2510, - "end": 2514, - "loc": { - "start": { - "line": 96, - "column": 2 - }, - "end": { - "line": 96, - "column": 6 - } - } - }, - "property": { - "type": "Identifier", - "start": 2515, - "end": 2521, - "loc": { - "start": { - "line": 96, - "column": 7 - }, - "end": { - "line": 96, - "column": 13 - }, - "identifierName": "remove" - }, - "name": "remove" - }, - "computed": false - }, - "arguments": [ - { - "type": "Identifier", - "start": 2522, - "end": 2528, - "loc": { - "start": { - "line": 96, - "column": 14 - }, - "end": { - "line": 96, - "column": 20 - }, - "identifierName": "entity" - }, - "name": "entity" - }, - { - "type": "SpreadElement", - "start": 2530, - "end": 2550, - "loc": { - "start": { - "line": 96, - "column": 22 - }, - "end": { - "line": 96, - "column": 42 - } - }, - "argument": { - "type": "MemberExpression", - "start": 2533, - "end": 2550, - "loc": { - "start": { - "line": 96, - "column": 25 - }, - "end": { - "line": 96, - "column": 42 - } - }, - "object": { - "type": "Identifier", - "start": 2533, - "end": 2539, - "loc": { - "start": { - "line": 96, - "column": 25 - }, - "end": { - "line": 96, - "column": 31 - }, - "identifierName": "entity" - }, - "name": "entity" - }, - "property": { - "type": "Identifier", - "start": 2540, - "end": 2550, - "loc": { - "start": { - "line": 96, - "column": 32 - }, - "end": { - "line": 96, - "column": 42 - }, - "identifierName": "components" - }, - "name": "components" - }, - "computed": false - } - } - ] - } - } - ], - "directives": [] - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Remove an entity and all of its components from the index", - "start": 2423, - "end": 2483, - "loc": { - "start": { - "line": 94, - "column": 1 - }, - "end": { - "line": 94, - "column": 61 - } - } - } - ] - } - ] - }, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "*\n * An alternative indexer class to SimpleIndex. This has true O(1) queries (when memoized), for the cost\n * of slower component add/remove operations. As more queries are made, the slower add/remove become.\n *\n * @class MemoizedQueryIndex (name)\n ", - "start": 0, - "end": 258, - "loc": { - "start": { - "line": 1, - "column": 0 + } + ] + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": "*\n * An alternative indexer class to SimpleIndex. This has true O(1) queries (when memoized), for the cost\n * of slower component add/remove operations. As more queries are made, the slower add/remove become.\n *\n * @class MemoizedQueryIndex (name)\n ", + "start": 0, + "end": 258, + "loc": { + "start": { + "line": 1, + "column": 0 }, "end": { "line": 6, @@ -5246,58 +4759,58 @@ }, { "type": "ExpressionStatement", - "start": 2558, - "end": 2605, + "start": 2335, + "end": 2382, "loc": { "start": { - "line": 100, + "line": 90, "column": 0 }, "end": { - "line": 100, + "line": 90, "column": 47 } }, "expression": { "type": "AssignmentExpression", - "start": 2558, - "end": 2605, + "start": 2335, + "end": 2382, "loc": { "start": { - "line": 100, + "line": 90, "column": 0 }, "end": { - "line": 100, + "line": 90, "column": 47 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 2558, - "end": 2584, + "start": 2335, + "end": 2361, "loc": { "start": { - "line": 100, + "line": 90, "column": 0 }, "end": { - "line": 100, + "line": 90, "column": 26 } }, "object": { "type": "Identifier", - "start": 2558, - "end": 2565, + "start": 2335, + "end": 2342, "loc": { "start": { - "line": 100, + "line": 90, "column": 0 }, "end": { - "line": 100, + "line": 90, "column": 7 }, "identifierName": "exports" @@ -5306,15 +4819,15 @@ }, "property": { "type": "Identifier", - "start": 2566, - "end": 2584, + "start": 2343, + "end": 2361, "loc": { "start": { - "line": 100, + "line": 90, "column": 8 }, "end": { - "line": 100, + "line": 90, "column": 26 }, "identifierName": "MemoizedQueryIndex" @@ -5325,15 +4838,15 @@ }, "right": { "type": "Identifier", - "start": 2587, - "end": 2605, + "start": 2364, + "end": 2382, "loc": { "start": { - "line": 100, + "line": 90, "column": 29 }, "end": { - "line": 100, + "line": 90, "column": 47 }, "identifierName": "MemoizedQueryIndex" @@ -5540,9 +5053,9 @@ }, { "type": "CommentLine", - "value": " Must use all component names", + "value": " Must use all component names from entity", "start": 1638, - "end": 1669, + "end": 1681, "loc": { "start": { "line": 63, @@ -5550,15 +5063,15 @@ }, "end": { "line": 63, - "column": 32 + "column": 44 } } }, { "type": "CommentLine", "value": " Check if the entity has all of the components of the index group", - "start": 1756, - "end": 1823, + "start": 1768, + "end": 1835, "loc": { "start": { "line": 68, @@ -5573,8 +5086,8 @@ { "type": "CommentLine", "value": " Add the entity", - "start": 1870, - "end": 1887, + "start": 1882, + "end": 1899, "loc": { "start": { "line": 70, @@ -5588,9 +5101,9 @@ }, { "type": "CommentLine", - "value": " Add an entity and all of its components to the index", - "start": 1944, - "end": 1999, + "value": " Remove certain components from the index for an entity", + "start": 1956, + "end": 2013, "loc": { "start": { "line": 76, @@ -5598,22 +5111,6 @@ }, "end": { "line": 76, - "column": 56 - } - } - }, - { - "type": "CommentLine", - "value": " Remove certain components from the index for an entity", - "start": 2045, - "end": 2102, - "loc": { - "start": { - "line": 81, - "column": 1 - }, - "end": { - "line": 81, "column": 58 } } @@ -5621,15 +5118,15 @@ { "type": "CommentLine", "value": " Check if index group has any of the components that the entity has", - "start": 2211, - "end": 2280, + "start": 2122, + "end": 2191, "loc": { "start": { - "line": 86, + "line": 81, "column": 3 }, "end": { - "line": 86, + "line": 81, "column": 72 } } @@ -5637,34 +5134,18 @@ { "type": "CommentLine", "value": " Remove the entity", - "start": 2351, - "end": 2371, + "start": 2262, + "end": 2282, "loc": { "start": { - "line": 88, + "line": 83, "column": 4 }, "end": { - "line": 88, + "line": 83, "column": 24 } } - }, - { - "type": "CommentLine", - "value": " Remove an entity and all of its components from the index", - "start": 2423, - "end": 2483, - "loc": { - "start": { - "line": 94, - "column": 1 - }, - "end": { - "line": 94, - "column": 61 - } - } } ], "tokens": [ @@ -11116,9 +10597,9 @@ }, { "type": "CommentLine", - "value": " Must use all component names", + "value": " Must use all component names from entity", "start": 1638, - "end": 1669, + "end": 1681, "loc": { "start": { "line": 63, @@ -11126,7 +10607,7 @@ }, "end": { "line": 63, - "column": 32 + "column": 44 } } }, @@ -11143,8 +10624,8 @@ "binop": null }, "value": "add", - "start": 1671, - "end": 1674, + "start": 1683, + "end": 1686, "loc": { "start": { "line": 64, @@ -11168,8 +10649,8 @@ "postfix": false, "binop": null }, - "start": 1674, - "end": 1675, + "start": 1686, + "end": 1687, "loc": { "start": { "line": 64, @@ -11194,8 +10675,8 @@ "binop": null }, "value": "entity", - "start": 1675, - "end": 1681, + "start": 1687, + "end": 1693, "loc": { "start": { "line": 64, @@ -11219,8 +10700,8 @@ "postfix": false, "binop": null }, - "start": 1681, - "end": 1682, + "start": 1693, + "end": 1694, "loc": { "start": { "line": 64, @@ -11244,8 +10725,8 @@ "postfix": false, "binop": null }, - "start": 1683, - "end": 1684, + "start": 1695, + "end": 1696, "loc": { "start": { "line": 64, @@ -11272,8 +10753,8 @@ "updateContext": null }, "value": "for", - "start": 1687, - "end": 1690, + "start": 1699, + "end": 1702, "loc": { "start": { "line": 65, @@ -11297,8 +10778,8 @@ "postfix": false, "binop": null }, - "start": 1691, - "end": 1692, + "start": 1703, + "end": 1704, "loc": { "start": { "line": 65, @@ -11325,8 +10806,8 @@ "updateContext": null }, "value": "let", - "start": 1692, - "end": 1695, + "start": 1704, + "end": 1707, "loc": { "start": { "line": 65, @@ -11351,8 +10832,8 @@ "binop": null }, "value": "hash", - "start": 1696, - "end": 1700, + "start": 1708, + "end": 1712, "loc": { "start": { "line": 65, @@ -11379,8 +10860,8 @@ "updateContext": null }, "value": "in", - "start": 1701, - "end": 1703, + "start": 1713, + "end": 1715, "loc": { "start": { "line": 65, @@ -11407,8 +10888,8 @@ "updateContext": null }, "value": "this", - "start": 1704, - "end": 1708, + "start": 1716, + "end": 1720, "loc": { "start": { "line": 65, @@ -11433,8 +10914,8 @@ "binop": null, "updateContext": null }, - "start": 1708, - "end": 1709, + "start": 1720, + "end": 1721, "loc": { "start": { "line": 65, @@ -11459,8 +10940,8 @@ "binop": null }, "value": "index", - "start": 1709, - "end": 1714, + "start": 1721, + "end": 1726, "loc": { "start": { "line": 65, @@ -11484,8 +10965,8 @@ "postfix": false, "binop": null }, - "start": 1714, - "end": 1715, + "start": 1726, + "end": 1727, "loc": { "start": { "line": 65, @@ -11509,8 +10990,8 @@ "postfix": false, "binop": null }, - "start": 1716, - "end": 1717, + "start": 1728, + "end": 1729, "loc": { "start": { "line": 65, @@ -11537,8 +11018,8 @@ "updateContext": null }, "value": "const", - "start": 1721, - "end": 1726, + "start": 1733, + "end": 1738, "loc": { "start": { "line": 66, @@ -11563,8 +11044,8 @@ "binop": null }, "value": "group", - "start": 1727, - "end": 1732, + "start": 1739, + "end": 1744, "loc": { "start": { "line": 66, @@ -11590,8 +11071,8 @@ "updateContext": null }, "value": "=", - "start": 1733, - "end": 1734, + "start": 1745, + "end": 1746, "loc": { "start": { "line": 66, @@ -11618,8 +11099,8 @@ "updateContext": null }, "value": "this", - "start": 1735, - "end": 1739, + "start": 1747, + "end": 1751, "loc": { "start": { "line": 66, @@ -11644,8 +11125,8 @@ "binop": null, "updateContext": null }, - "start": 1739, - "end": 1740, + "start": 1751, + "end": 1752, "loc": { "start": { "line": 66, @@ -11670,8 +11151,8 @@ "binop": null }, "value": "index", - "start": 1740, - "end": 1745, + "start": 1752, + "end": 1757, "loc": { "start": { "line": 66, @@ -11696,8 +11177,8 @@ "binop": null, "updateContext": null }, - "start": 1745, - "end": 1746, + "start": 1757, + "end": 1758, "loc": { "start": { "line": 66, @@ -11722,8 +11203,8 @@ "binop": null }, "value": "hash", - "start": 1746, - "end": 1750, + "start": 1758, + "end": 1762, "loc": { "start": { "line": 66, @@ -11748,8 +11229,8 @@ "binop": null, "updateContext": null }, - "start": 1750, - "end": 1751, + "start": 1762, + "end": 1763, "loc": { "start": { "line": 66, @@ -11764,8 +11245,8 @@ { "type": "CommentLine", "value": " Check if the entity has all of the components of the index group", - "start": 1756, - "end": 1823, + "start": 1768, + "end": 1835, "loc": { "start": { "line": 68, @@ -11792,8 +11273,8 @@ "updateContext": null }, "value": "if", - "start": 1827, - "end": 1829, + "start": 1839, + "end": 1841, "loc": { "start": { "line": 69, @@ -11817,8 +11298,8 @@ "postfix": false, "binop": null }, - "start": 1830, - "end": 1831, + "start": 1842, + "end": 1843, "loc": { "start": { "line": 69, @@ -11843,8 +11324,8 @@ "binop": null }, "value": "entity", - "start": 1831, - "end": 1837, + "start": 1843, + "end": 1849, "loc": { "start": { "line": 69, @@ -11869,8 +11350,8 @@ "binop": null, "updateContext": null }, - "start": 1837, - "end": 1838, + "start": 1849, + "end": 1850, "loc": { "start": { "line": 69, @@ -11895,8 +11376,8 @@ "binop": null }, "value": "has", - "start": 1838, - "end": 1841, + "start": 1850, + "end": 1853, "loc": { "start": { "line": 69, @@ -11920,8 +11401,8 @@ "postfix": false, "binop": null }, - "start": 1841, - "end": 1842, + "start": 1853, + "end": 1854, "loc": { "start": { "line": 69, @@ -11946,8 +11427,8 @@ "binop": null, "updateContext": null }, - "start": 1842, - "end": 1845, + "start": 1854, + "end": 1857, "loc": { "start": { "line": 69, @@ -11972,8 +11453,8 @@ "binop": null }, "value": "group", - "start": 1845, - "end": 1850, + "start": 1857, + "end": 1862, "loc": { "start": { "line": 69, @@ -11998,8 +11479,8 @@ "binop": null, "updateContext": null }, - "start": 1850, - "end": 1851, + "start": 1862, + "end": 1863, "loc": { "start": { "line": 69, @@ -12024,8 +11505,8 @@ "binop": null }, "value": "components", - "start": 1851, - "end": 1861, + "start": 1863, + "end": 1873, "loc": { "start": { "line": 69, @@ -12049,8 +11530,8 @@ "postfix": false, "binop": null }, - "start": 1861, - "end": 1862, + "start": 1873, + "end": 1874, "loc": { "start": { "line": 69, @@ -12074,8 +11555,8 @@ "postfix": false, "binop": null }, - "start": 1862, - "end": 1863, + "start": 1874, + "end": 1875, "loc": { "start": { "line": 69, @@ -12099,8 +11580,8 @@ "postfix": false, "binop": null }, - "start": 1864, - "end": 1865, + "start": 1876, + "end": 1877, "loc": { "start": { "line": 69, @@ -12115,8 +11596,8 @@ { "type": "CommentLine", "value": " Add the entity", - "start": 1870, - "end": 1887, + "start": 1882, + "end": 1899, "loc": { "start": { "line": 70, @@ -12141,8 +11622,8 @@ "binop": null }, "value": "group", - "start": 1892, - "end": 1897, + "start": 1904, + "end": 1909, "loc": { "start": { "line": 71, @@ -12167,8 +11648,8 @@ "binop": null, "updateContext": null }, - "start": 1897, - "end": 1898, + "start": 1909, + "end": 1910, "loc": { "start": { "line": 71, @@ -12193,8 +11674,8 @@ "binop": null }, "value": "entities", - "start": 1898, - "end": 1906, + "start": 1910, + "end": 1918, "loc": { "start": { "line": 71, @@ -12219,8 +11700,8 @@ "binop": null, "updateContext": null }, - "start": 1906, - "end": 1907, + "start": 1918, + "end": 1919, "loc": { "start": { "line": 71, @@ -12245,8 +11726,8 @@ "binop": null }, "value": "set", - "start": 1907, - "end": 1910, + "start": 1919, + "end": 1922, "loc": { "start": { "line": 71, @@ -12270,8 +11751,8 @@ "postfix": false, "binop": null }, - "start": 1910, - "end": 1911, + "start": 1922, + "end": 1923, "loc": { "start": { "line": 71, @@ -12296,8 +11777,8 @@ "binop": null }, "value": "entity", - "start": 1911, - "end": 1917, + "start": 1923, + "end": 1929, "loc": { "start": { "line": 71, @@ -12322,8 +11803,8 @@ "binop": null, "updateContext": null }, - "start": 1917, - "end": 1918, + "start": 1929, + "end": 1930, "loc": { "start": { "line": 71, @@ -12348,8 +11829,8 @@ "binop": null }, "value": "id", - "start": 1918, - "end": 1920, + "start": 1930, + "end": 1932, "loc": { "start": { "line": 71, @@ -12374,8 +11855,8 @@ "binop": null, "updateContext": null }, - "start": 1920, - "end": 1921, + "start": 1932, + "end": 1933, "loc": { "start": { "line": 71, @@ -12400,8 +11881,8 @@ "binop": null }, "value": "entity", - "start": 1922, - "end": 1928, + "start": 1934, + "end": 1940, "loc": { "start": { "line": 71, @@ -12425,8 +11906,8 @@ "postfix": false, "binop": null }, - "start": 1928, - "end": 1929, + "start": 1940, + "end": 1941, "loc": { "start": { "line": 71, @@ -12450,8 +11931,8 @@ "postfix": false, "binop": null }, - "start": 1933, - "end": 1934, + "start": 1945, + "end": 1946, "loc": { "start": { "line": 72, @@ -12475,8 +11956,8 @@ "postfix": false, "binop": null }, - "start": 1937, - "end": 1938, + "start": 1949, + "end": 1950, "loc": { "start": { "line": 73, @@ -12500,8 +11981,8 @@ "postfix": false, "binop": null }, - "start": 1940, - "end": 1941, + "start": 1952, + "end": 1953, "loc": { "start": { "line": 74, @@ -12515,9 +11996,9 @@ }, { "type": "CommentLine", - "value": " Add an entity and all of its components to the index", - "start": 1944, - "end": 1999, + "value": " Remove certain components from the index for an entity", + "start": 1956, + "end": 2013, "loc": { "start": { "line": 76, @@ -12525,7 +12006,7 @@ }, "end": { "line": 76, - "column": 56 + "column": 58 } } }, @@ -12541,9 +12022,9 @@ "postfix": false, "binop": null }, - "value": "addEntity", - "start": 2001, - "end": 2010, + "value": "remove", + "start": 2015, + "end": 2021, "loc": { "start": { "line": 77, @@ -12551,7 +12032,7 @@ }, "end": { "line": 77, - "column": 10 + "column": 7 } } }, @@ -12567,16 +12048,16 @@ "postfix": false, "binop": null }, - "start": 2010, - "end": 2011, + "start": 2021, + "end": 2022, "loc": { "start": { "line": 77, - "column": 10 + "column": 7 }, "end": { "line": 77, - "column": 11 + "column": 8 } } }, @@ -12593,73 +12074,74 @@ "binop": null }, "value": "entity", - "start": 2011, - "end": 2017, + "start": 2022, + "end": 2028, "loc": { "start": { "line": 77, - "column": 11 + "column": 8 }, "end": { "line": 77, - "column": 17 + "column": 14 } } }, { "type": { - "label": ")", - "beforeExpr": false, + "label": ",", + "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 2017, - "end": 2018, + "start": 2028, + "end": 2029, "loc": { "start": { "line": 77, - "column": 17 + "column": 14 }, "end": { "line": 77, - "column": 18 + "column": 15 } } }, { "type": { - "label": "{", + "label": "...", "beforeExpr": true, - "startsExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 2019, - "end": 2020, + "start": 2030, + "end": 2033, "loc": { "start": { "line": 77, - "column": 19 + "column": 16 }, "end": { "line": 77, - "column": 20 + "column": 19 } } }, { "type": { - "label": "this", - "keyword": "this", + "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, @@ -12667,26 +12149,25 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "value": "this", - "start": 2023, - "end": 2027, + "value": "componentNames", + "start": 2033, + "end": 2047, "loc": { "start": { - "line": 78, - "column": 2 + "line": 77, + "column": 19 }, "end": { - "line": 78, - "column": 6 + "line": 77, + "column": 33 } } }, { "type": { - "label": ".", + "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -12694,26 +12175,25 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 2027, - "end": 2028, + "start": 2047, + "end": 2048, "loc": { "start": { - "line": 78, - "column": 6 + "line": 77, + "column": 33 }, "end": { - "line": 78, - "column": 7 + "line": 77, + "column": 34 } } }, { "type": { - "label": "name", - "beforeExpr": false, + "label": "{", + "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -12722,49 +12202,51 @@ "postfix": false, "binop": null }, - "value": "add", - "start": 2028, - "end": 2031, + "start": 2049, + "end": 2050, "loc": { "start": { - "line": 78, - "column": 7 + "line": 77, + "column": 35 }, "end": { - "line": 78, - "column": 10 + "line": 77, + "column": 36 } } }, { "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, + "label": "for", + "keyword": "for", + "beforeExpr": false, + "startsExpr": false, "rightAssociative": false, - "isLoop": false, + "isLoop": true, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 2031, - "end": 2032, + "value": "for", + "start": 2053, + "end": 2056, "loc": { "start": { "line": 78, - "column": 10 + "column": 2 }, "end": { "line": 78, - "column": 11 + "column": 5 } } }, { "type": { - "label": "name", - "beforeExpr": false, + "label": "(", + "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -12773,23 +12255,23 @@ "postfix": false, "binop": null }, - "value": "entity", - "start": 2032, - "end": 2038, + "start": 2057, + "end": 2058, "loc": { "start": { "line": 78, - "column": 11 + "column": 6 }, "end": { "line": 78, - "column": 17 + "column": 7 } } }, { "type": { - "label": ")", + "label": "let", + "keyword": "let", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -12797,26 +12279,28 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 2038, - "end": 2039, + "value": "let", + "start": 2058, + "end": 2061, "loc": { "start": { "line": 78, - "column": 17 + "column": 7 }, "end": { "line": 78, - "column": 18 + "column": 10 } } }, { "type": { - "label": "}", + "label": "name", "beforeExpr": false, - "startsExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -12824,38 +12308,52 @@ "postfix": false, "binop": null }, - "start": 2041, - "end": 2042, + "value": "hash", + "start": 2062, + "end": 2066, "loc": { "start": { - "line": 79, - "column": 1 + "line": 78, + "column": 11 }, "end": { - "line": 79, - "column": 2 + "line": 78, + "column": 15 } } }, { - "type": "CommentLine", - "value": " Remove certain components from the index for an entity", - "start": 2045, - "end": 2102, + "type": { + "label": "in", + "keyword": "in", + "beforeExpr": true, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": 7, + "updateContext": null + }, + "value": "in", + "start": 2067, + "end": 2069, "loc": { "start": { - "line": 81, - "column": 1 + "line": 78, + "column": 16 }, "end": { - "line": 81, - "column": 58 + "line": 78, + "column": 18 } } }, { "type": { - "label": "name", + "label": "this", + "keyword": "this", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, @@ -12863,44 +12361,46 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "value": "remove", - "start": 2104, - "end": 2110, + "value": "this", + "start": 2070, + "end": 2074, "loc": { "start": { - "line": 82, - "column": 1 + "line": 78, + "column": 19 }, "end": { - "line": 82, - "column": 7 + "line": 78, + "column": 23 } } }, { "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, + "label": ".", + "beforeExpr": false, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 2110, - "end": 2111, + "start": 2074, + "end": 2075, "loc": { "start": { - "line": 82, - "column": 7 + "line": 78, + "column": 23 }, "end": { - "line": 82, - "column": 8 + "line": 78, + "column": 24 } } }, @@ -12916,855 +12416,76 @@ "postfix": false, "binop": null }, - "value": "entity", - "start": 2111, - "end": 2117, + "value": "index", + "start": 2075, + "end": 2080, "loc": { "start": { - "line": 82, - "column": 8 + "line": 78, + "column": 24 }, "end": { - "line": 82, - "column": 14 + "line": 78, + "column": 29 } } }, { "type": { - "label": ",", - "beforeExpr": true, + "label": ")", + "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 2117, - "end": 2118, + "start": 2080, + "end": 2081, "loc": { "start": { - "line": 82, - "column": 14 + "line": 78, + "column": 29 }, "end": { - "line": 82, - "column": 15 + "line": 78, + "column": 30 } } }, { "type": { - "label": "...", + "label": "{", "beforeExpr": true, - "startsExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 2119, - "end": 2122, + "start": 2082, + "end": 2083, "loc": { "start": { - "line": 82, - "column": 16 + "line": 78, + "column": 31 }, "end": { - "line": 82, - "column": 19 + "line": 78, + "column": 32 } } }, { "type": { - "label": "name", + "label": "const", + "keyword": "const", "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "componentNames", - "start": 2122, - "end": 2136, - "loc": { - "start": { - "line": 82, - "column": 19 - }, - "end": { - "line": 82, - "column": 33 - } - } - }, - { - "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 2136, - "end": 2137, - "loc": { - "start": { - "line": 82, - "column": 33 - }, - "end": { - "line": 82, - "column": 34 - } - } - }, - { - "type": { - "label": "{", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 2138, - "end": 2139, - "loc": { - "start": { - "line": 82, - "column": 35 - }, - "end": { - "line": 82, - "column": 36 - } - } - }, - { - "type": { - "label": "for", - "keyword": "for", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": true, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "for", - "start": 2142, - "end": 2145, - "loc": { - "start": { - "line": 83, - "column": 2 - }, - "end": { - "line": 83, - "column": 5 - } - } - }, - { - "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 2146, - "end": 2147, - "loc": { - "start": { - "line": 83, - "column": 6 - }, - "end": { - "line": 83, - "column": 7 - } - } - }, - { - "type": { - "label": "let", - "keyword": "let", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "let", - "start": 2147, - "end": 2150, - "loc": { - "start": { - "line": 83, - "column": 7 - }, - "end": { - "line": 83, - "column": 10 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "hash", - "start": 2151, - "end": 2155, - "loc": { - "start": { - "line": 83, - "column": 11 - }, - "end": { - "line": 83, - "column": 15 - } - } - }, - { - "type": { - "label": "in", - "keyword": "in", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": 7, - "updateContext": null - }, - "value": "in", - "start": 2156, - "end": 2158, - "loc": { - "start": { - "line": 83, - "column": 16 - }, - "end": { - "line": 83, - "column": 18 - } - } - }, - { - "type": { - "label": "this", - "keyword": "this", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "this", - "start": 2159, - "end": 2163, - "loc": { - "start": { - "line": 83, - "column": 19 - }, - "end": { - "line": 83, - "column": 23 - } - } - }, - { - "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 2163, - "end": 2164, - "loc": { - "start": { - "line": 83, - "column": 23 - }, - "end": { - "line": 83, - "column": 24 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "index", - "start": 2164, - "end": 2169, - "loc": { - "start": { - "line": 83, - "column": 24 - }, - "end": { - "line": 83, - "column": 29 - } - } - }, - { - "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 2169, - "end": 2170, - "loc": { - "start": { - "line": 83, - "column": 29 - }, - "end": { - "line": 83, - "column": 30 - } - } - }, - { - "type": { - "label": "{", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 2171, - "end": 2172, - "loc": { - "start": { - "line": 83, - "column": 31 - }, - "end": { - "line": 83, - "column": 32 - } - } - }, - { - "type": { - "label": "const", - "keyword": "const", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "const", - "start": 2176, - "end": 2181, - "loc": { - "start": { - "line": 84, - "column": 3 - }, - "end": { - "line": 84, - "column": 8 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "group", - "start": 2182, - "end": 2187, - "loc": { - "start": { - "line": 84, - "column": 9 - }, - "end": { - "line": 84, - "column": 14 - } - } - }, - { - "type": { - "label": "=", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": true, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "=", - "start": 2188, - "end": 2189, - "loc": { - "start": { - "line": 84, - "column": 15 - }, - "end": { - "line": 84, - "column": 16 - } - } - }, - { - "type": { - "label": "this", - "keyword": "this", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "this", - "start": 2190, - "end": 2194, - "loc": { - "start": { - "line": 84, - "column": 17 - }, - "end": { - "line": 84, - "column": 21 - } - } - }, - { - "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 2194, - "end": 2195, - "loc": { - "start": { - "line": 84, - "column": 21 - }, - "end": { - "line": 84, - "column": 22 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "index", - "start": 2195, - "end": 2200, - "loc": { - "start": { - "line": 84, - "column": 22 - }, - "end": { - "line": 84, - "column": 27 - } - } - }, - { - "type": { - "label": "[", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 2200, - "end": 2201, - "loc": { - "start": { - "line": 84, - "column": 27 - }, - "end": { - "line": 84, - "column": 28 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "hash", - "start": 2201, - "end": 2205, - "loc": { - "start": { - "line": 84, - "column": 28 - }, - "end": { - "line": 84, - "column": 32 - } - } - }, - { - "type": { - "label": "]", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 2205, - "end": 2206, - "loc": { - "start": { - "line": 84, - "column": 32 - }, - "end": { - "line": 84, - "column": 33 - } - } - }, - { - "type": "CommentLine", - "value": " Check if index group has any of the components that the entity has", - "start": 2211, - "end": 2280, - "loc": { - "start": { - "line": 86, - "column": 3 - }, - "end": { - "line": 86, - "column": 72 - } - } - }, - { - "type": { - "label": "if", - "keyword": "if", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "if", - "start": 2284, - "end": 2286, - "loc": { - "start": { - "line": 87, - "column": 3 - }, - "end": { - "line": 87, - "column": 5 - } - } - }, - { - "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 2287, - "end": 2288, - "loc": { - "start": { - "line": 87, - "column": 6 - }, - "end": { - "line": 87, - "column": 7 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "componentNames", - "start": 2288, - "end": 2302, - "loc": { - "start": { - "line": 87, - "column": 7 - }, - "end": { - "line": 87, - "column": 21 - } - } - }, - { - "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 2302, - "end": 2303, - "loc": { - "start": { - "line": 87, - "column": 21 - }, - "end": { - "line": 87, - "column": 22 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "some", - "start": 2303, - "end": 2307, - "loc": { - "start": { - "line": 87, - "column": 22 - }, - "end": { - "line": 87, - "column": 26 - } - } - }, - { - "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 2307, - "end": 2308, - "loc": { - "start": { - "line": 87, - "column": 26 - }, - "end": { - "line": 87, - "column": 27 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "name", - "start": 2308, - "end": 2312, - "loc": { - "start": { - "line": 87, - "column": 27 - }, - "end": { - "line": 87, - "column": 31 - } - } - }, - { - "type": { - "label": "=>", - "beforeExpr": true, - "startsExpr": false, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -13773,16 +12494,17 @@ "binop": null, "updateContext": null }, - "start": 2313, - "end": 2315, + "value": "const", + "start": 2087, + "end": 2092, "loc": { "start": { - "line": 87, - "column": 32 + "line": 79, + "column": 3 }, "end": { - "line": 87, - "column": 34 + "line": 79, + "column": 8 } } }, @@ -13799,179 +12521,105 @@ "binop": null }, "value": "group", - "start": 2316, - "end": 2321, - "loc": { - "start": { - "line": 87, - "column": 35 - }, - "end": { - "line": 87, - "column": 40 - } - } - }, - { - "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 2321, - "end": 2322, - "loc": { - "start": { - "line": 87, - "column": 40 - }, - "end": { - "line": 87, - "column": 41 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "components", - "start": 2322, - "end": 2332, + "start": 2093, + "end": 2098, "loc": { "start": { - "line": 87, - "column": 41 + "line": 79, + "column": 9 }, "end": { - "line": 87, - "column": 51 + "line": 79, + "column": 14 } } }, { "type": { - "label": ".", - "beforeExpr": false, + "label": "=", + "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 2332, - "end": 2333, - "loc": { - "start": { - "line": 87, - "column": 51 - }, - "end": { - "line": 87, - "column": 52 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, + "isAssign": true, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "value": "has", - "start": 2333, - "end": 2336, + "value": "=", + "start": 2099, + "end": 2100, "loc": { "start": { - "line": 87, - "column": 52 + "line": 79, + "column": 15 }, "end": { - "line": 87, - "column": 55 + "line": 79, + "column": 16 } } }, { "type": { - "label": "(", - "beforeExpr": true, + "label": "this", + "keyword": "this", + "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 2336, - "end": 2337, + "value": "this", + "start": 2101, + "end": 2105, "loc": { "start": { - "line": 87, - "column": 55 + "line": 79, + "column": 17 }, "end": { - "line": 87, - "column": 56 + "line": 79, + "column": 21 } } }, { "type": { - "label": "name", + "label": ".", "beforeExpr": false, - "startsExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "value": "name", - "start": 2337, - "end": 2341, + "start": 2105, + "end": 2106, "loc": { "start": { - "line": 87, - "column": 56 + "line": 79, + "column": 21 }, "end": { - "line": 87, - "column": 60 + "line": 79, + "column": 22 } } }, { "type": { - "label": ")", + "label": "name", "beforeExpr": false, - "startsExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -13979,49 +12627,51 @@ "postfix": false, "binop": null }, - "start": 2341, - "end": 2342, + "value": "index", + "start": 2106, + "end": 2111, "loc": { "start": { - "line": 87, - "column": 60 + "line": 79, + "column": 22 }, "end": { - "line": 87, - "column": 61 + "line": 79, + "column": 27 } } }, { "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, + "label": "[", + "beforeExpr": true, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 2342, - "end": 2343, + "start": 2111, + "end": 2112, "loc": { "start": { - "line": 87, - "column": 61 + "line": 79, + "column": 27 }, "end": { - "line": 87, - "column": 62 + "line": 79, + "column": 28 } } }, { "type": { - "label": ")", + "label": "name", "beforeExpr": false, - "startsExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -14029,109 +12679,112 @@ "postfix": false, "binop": null }, - "start": 2343, - "end": 2344, + "value": "hash", + "start": 2112, + "end": 2116, "loc": { "start": { - "line": 87, - "column": 62 + "line": 79, + "column": 28 }, "end": { - "line": 87, - "column": 63 + "line": 79, + "column": 32 } } }, { "type": { - "label": "{", - "beforeExpr": true, - "startsExpr": true, + "label": "]", + "beforeExpr": false, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 2345, - "end": 2346, + "start": 2116, + "end": 2117, "loc": { "start": { - "line": 87, - "column": 64 + "line": 79, + "column": 32 }, "end": { - "line": 87, - "column": 65 + "line": 79, + "column": 33 } } }, { "type": "CommentLine", - "value": " Remove the entity", - "start": 2351, - "end": 2371, + "value": " Check if index group has any of the components that the entity has", + "start": 2122, + "end": 2191, "loc": { "start": { - "line": 88, - "column": 4 + "line": 81, + "column": 3 }, "end": { - "line": 88, - "column": 24 + "line": 81, + "column": 72 } } }, { "type": { - "label": "name", + "label": "if", + "keyword": "if", "beforeExpr": false, - "startsExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "value": "group", - "start": 2376, - "end": 2381, + "value": "if", + "start": 2195, + "end": 2197, "loc": { "start": { - "line": 89, - "column": 4 + "line": 82, + "column": 3 }, "end": { - "line": 89, - "column": 9 + "line": 82, + "column": 5 } } }, { "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, + "label": "(", + "beforeExpr": true, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 2381, - "end": 2382, + "start": 2198, + "end": 2199, "loc": { "start": { - "line": 89, - "column": 9 + "line": 82, + "column": 6 }, "end": { - "line": 89, - "column": 10 + "line": 82, + "column": 7 } } }, @@ -14147,17 +12800,17 @@ "postfix": false, "binop": null }, - "value": "entities", - "start": 2382, - "end": 2390, + "value": "componentNames", + "start": 2199, + "end": 2213, "loc": { "start": { - "line": 89, - "column": 10 + "line": 82, + "column": 7 }, "end": { - "line": 89, - "column": 18 + "line": 82, + "column": 21 } } }, @@ -14174,44 +12827,42 @@ "binop": null, "updateContext": null }, - "start": 2390, - "end": 2391, + "start": 2213, + "end": 2214, "loc": { "start": { - "line": 89, - "column": 18 + "line": 82, + "column": 21 }, "end": { - "line": 89, - "column": 19 + "line": 82, + "column": 22 } } }, { "type": { - "label": "delete", - "keyword": "delete", - "beforeExpr": true, + "label": "name", + "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, - "prefix": true, + "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "value": "delete", - "start": 2391, - "end": 2397, + "value": "some", + "start": 2214, + "end": 2218, "loc": { "start": { - "line": 89, - "column": 19 + "line": 82, + "column": 22 }, "end": { - "line": 89, - "column": 25 + "line": 82, + "column": 26 } } }, @@ -14227,16 +12878,16 @@ "postfix": false, "binop": null }, - "start": 2397, - "end": 2398, + "start": 2218, + "end": 2219, "loc": { "start": { - "line": 89, - "column": 25 + "line": 82, + "column": 26 }, "end": { - "line": 89, - "column": 26 + "line": 82, + "column": 27 } } }, @@ -14252,24 +12903,24 @@ "postfix": false, "binop": null }, - "value": "entity", - "start": 2398, - "end": 2404, + "value": "name", + "start": 2219, + "end": 2223, "loc": { "start": { - "line": 89, - "column": 26 + "line": 82, + "column": 27 }, "end": { - "line": 89, - "column": 32 + "line": 82, + "column": 31 } } }, { "type": { - "label": ".", - "beforeExpr": false, + "label": "=>", + "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, @@ -14279,16 +12930,16 @@ "binop": null, "updateContext": null }, - "start": 2404, - "end": 2405, + "start": 2224, + "end": 2226, "loc": { "start": { - "line": 89, + "line": 82, "column": 32 }, "end": { - "line": 89, - "column": 33 + "line": 82, + "column": 34 } } }, @@ -14304,23 +12955,23 @@ "postfix": false, "binop": null }, - "value": "id", - "start": 2405, - "end": 2407, + "value": "group", + "start": 2227, + "end": 2232, "loc": { "start": { - "line": 89, - "column": 33 + "line": 82, + "column": 35 }, "end": { - "line": 89, - "column": 35 + "line": 82, + "column": 40 } } }, { "type": { - "label": ")", + "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -14328,26 +12979,27 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 2407, - "end": 2408, + "start": 2232, + "end": 2233, "loc": { "start": { - "line": 89, - "column": 35 + "line": 82, + "column": 40 }, "end": { - "line": 89, - "column": 36 + "line": 82, + "column": 41 } } }, { "type": { - "label": "}", + "label": "name", "beforeExpr": false, - "startsExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -14355,22 +13007,23 @@ "postfix": false, "binop": null }, - "start": 2412, - "end": 2413, + "value": "components", + "start": 2233, + "end": 2243, "loc": { "start": { - "line": 90, - "column": 3 + "line": 82, + "column": 41 }, "end": { - "line": 90, - "column": 4 + "line": 82, + "column": 51 } } }, { "type": { - "label": "}", + "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -14378,26 +13031,27 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 2416, - "end": 2417, + "start": 2243, + "end": 2244, "loc": { "start": { - "line": 91, - "column": 2 + "line": 82, + "column": 51 }, "end": { - "line": 91, - "column": 3 + "line": 82, + "column": 52 } } }, { "type": { - "label": "}", + "label": "name", "beforeExpr": false, - "startsExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -14405,32 +13059,42 @@ "postfix": false, "binop": null }, - "start": 2419, - "end": 2420, + "value": "has", + "start": 2244, + "end": 2247, "loc": { "start": { - "line": 92, - "column": 1 + "line": 82, + "column": 52 }, "end": { - "line": 92, - "column": 2 + "line": 82, + "column": 55 } } }, { - "type": "CommentLine", - "value": " Remove an entity and all of its components from the index", - "start": 2423, - "end": 2483, + "type": { + "label": "(", + "beforeExpr": true, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 2247, + "end": 2248, "loc": { "start": { - "line": 94, - "column": 1 + "line": 82, + "column": 55 }, "end": { - "line": 94, - "column": 61 + "line": 82, + "column": 56 } } }, @@ -14446,25 +13110,25 @@ "postfix": false, "binop": null }, - "value": "removeEntity", - "start": 2485, - "end": 2497, + "value": "name", + "start": 2248, + "end": 2252, "loc": { "start": { - "line": 95, - "column": 1 + "line": 82, + "column": 56 }, "end": { - "line": 95, - "column": 13 + "line": 82, + "column": 60 } } }, { "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, + "label": ")", + "beforeExpr": false, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -14472,24 +13136,24 @@ "postfix": false, "binop": null }, - "start": 2497, - "end": 2498, + "start": 2252, + "end": 2253, "loc": { "start": { - "line": 95, - "column": 13 + "line": 82, + "column": 60 }, "end": { - "line": 95, - "column": 14 + "line": 82, + "column": 61 } } }, { "type": { - "label": "name", + "label": ")", "beforeExpr": false, - "startsExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -14497,17 +13161,16 @@ "postfix": false, "binop": null }, - "value": "entity", - "start": 2498, - "end": 2504, + "start": 2253, + "end": 2254, "loc": { "start": { - "line": 95, - "column": 14 + "line": 82, + "column": 61 }, "end": { - "line": 95, - "column": 20 + "line": 82, + "column": 62 } } }, @@ -14523,16 +13186,16 @@ "postfix": false, "binop": null }, - "start": 2504, - "end": 2505, + "start": 2254, + "end": 2255, "loc": { "start": { - "line": 95, - "column": 20 + "line": 82, + "column": 62 }, "end": { - "line": 95, - "column": 21 + "line": 82, + "column": 63 } } }, @@ -14548,23 +13211,38 @@ "postfix": false, "binop": null }, - "start": 2506, - "end": 2507, + "start": 2256, + "end": 2257, "loc": { "start": { - "line": 95, - "column": 22 + "line": 82, + "column": 64 }, "end": { - "line": 95, - "column": 23 + "line": 82, + "column": 65 + } + } + }, + { + "type": "CommentLine", + "value": " Remove the entity", + "start": 2262, + "end": 2282, + "loc": { + "start": { + "line": 83, + "column": 4 + }, + "end": { + "line": 83, + "column": 24 } } }, { "type": { - "label": "this", - "keyword": "this", + "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, @@ -14572,20 +13250,19 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "value": "this", - "start": 2510, - "end": 2514, + "value": "group", + "start": 2287, + "end": 2292, "loc": { "start": { - "line": 96, - "column": 2 + "line": 84, + "column": 4 }, "end": { - "line": 96, - "column": 6 + "line": 84, + "column": 9 } } }, @@ -14602,16 +13279,16 @@ "binop": null, "updateContext": null }, - "start": 2514, - "end": 2515, + "start": 2292, + "end": 2293, "loc": { "start": { - "line": 96, - "column": 6 + "line": 84, + "column": 9 }, "end": { - "line": 96, - "column": 7 + "line": 84, + "column": 10 } } }, @@ -14627,49 +13304,78 @@ "postfix": false, "binop": null }, - "value": "remove", - "start": 2515, - "end": 2521, + "value": "entities", + "start": 2293, + "end": 2301, "loc": { "start": { - "line": 96, - "column": 7 + "line": 84, + "column": 10 }, "end": { - "line": 96, - "column": 13 + "line": 84, + "column": 18 } } }, { "type": { - "label": "(", + "label": ".", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "start": 2301, + "end": 2302, + "loc": { + "start": { + "line": 84, + "column": 18 + }, + "end": { + "line": 84, + "column": 19 + } + } + }, + { + "type": { + "label": "delete", + "keyword": "delete", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, - "prefix": false, + "prefix": true, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 2521, - "end": 2522, + "value": "delete", + "start": 2302, + "end": 2308, "loc": { "start": { - "line": 96, - "column": 13 + "line": 84, + "column": 19 }, "end": { - "line": 96, - "column": 14 + "line": 84, + "column": 25 } } }, { "type": { - "label": "name", - "beforeExpr": false, + "label": "(", + "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -14678,50 +13384,49 @@ "postfix": false, "binop": null }, - "value": "entity", - "start": 2522, - "end": 2528, + "start": 2308, + "end": 2309, "loc": { "start": { - "line": 96, - "column": 14 + "line": 84, + "column": 25 }, "end": { - "line": 96, - "column": 20 + "line": 84, + "column": 26 } } }, { "type": { - "label": ",", - "beforeExpr": true, - "startsExpr": false, + "label": "name", + "beforeExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 2528, - "end": 2529, + "value": "entity", + "start": 2309, + "end": 2315, "loc": { "start": { - "line": 96, - "column": 20 + "line": 84, + "column": 26 }, "end": { - "line": 96, - "column": 21 + "line": 84, + "column": 32 } } }, { "type": { - "label": "...", - "beforeExpr": true, + "label": ".", + "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, @@ -14731,16 +13436,16 @@ "binop": null, "updateContext": null }, - "start": 2530, - "end": 2533, + "start": 2315, + "end": 2316, "loc": { "start": { - "line": 96, - "column": 22 + "line": 84, + "column": 32 }, "end": { - "line": 96, - "column": 25 + "line": 84, + "column": 33 } } }, @@ -14756,23 +13461,23 @@ "postfix": false, "binop": null }, - "value": "entity", - "start": 2533, - "end": 2539, + "value": "id", + "start": 2316, + "end": 2318, "loc": { "start": { - "line": 96, - "column": 25 + "line": 84, + "column": 33 }, "end": { - "line": 96, - "column": 31 + "line": 84, + "column": 35 } } }, { "type": { - "label": ".", + "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -14780,27 +13485,26 @@ "isAssign": false, "prefix": false, "postfix": false, - "binop": null, - "updateContext": null + "binop": null }, - "start": 2539, - "end": 2540, + "start": 2318, + "end": 2319, "loc": { "start": { - "line": 96, - "column": 31 + "line": 84, + "column": 35 }, "end": { - "line": 96, - "column": 32 + "line": 84, + "column": 36 } } }, { "type": { - "label": "name", + "label": "}", "beforeExpr": false, - "startsExpr": true, + "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -14808,23 +13512,22 @@ "postfix": false, "binop": null }, - "value": "components", - "start": 2540, - "end": 2550, + "start": 2323, + "end": 2324, "loc": { "start": { - "line": 96, - "column": 32 + "line": 85, + "column": 3 }, "end": { - "line": 96, - "column": 42 + "line": 85, + "column": 4 } } }, { "type": { - "label": ")", + "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -14834,16 +13537,16 @@ "postfix": false, "binop": null }, - "start": 2550, - "end": 2551, + "start": 2327, + "end": 2328, "loc": { "start": { - "line": 96, - "column": 42 + "line": 86, + "column": 2 }, "end": { - "line": 96, - "column": 43 + "line": 86, + "column": 3 } } }, @@ -14859,15 +13562,15 @@ "postfix": false, "binop": null }, - "start": 2553, - "end": 2554, + "start": 2330, + "end": 2331, "loc": { "start": { - "line": 97, + "line": 87, "column": 1 }, "end": { - "line": 97, + "line": 87, "column": 2 } } @@ -14884,15 +13587,15 @@ "postfix": false, "binop": null }, - "start": 2555, - "end": 2556, + "start": 2332, + "end": 2333, "loc": { "start": { - "line": 98, + "line": 88, "column": 0 }, "end": { - "line": 98, + "line": 88, "column": 1 } } @@ -14910,15 +13613,15 @@ "binop": null }, "value": "exports", - "start": 2558, - "end": 2565, + "start": 2335, + "end": 2342, "loc": { "start": { - "line": 100, + "line": 90, "column": 0 }, "end": { - "line": 100, + "line": 90, "column": 7 } } @@ -14936,15 +13639,15 @@ "binop": null, "updateContext": null }, - "start": 2565, - "end": 2566, + "start": 2342, + "end": 2343, "loc": { "start": { - "line": 100, + "line": 90, "column": 7 }, "end": { - "line": 100, + "line": 90, "column": 8 } } @@ -14962,15 +13665,15 @@ "binop": null }, "value": "MemoizedQueryIndex", - "start": 2566, - "end": 2584, + "start": 2343, + "end": 2361, "loc": { "start": { - "line": 100, + "line": 90, "column": 8 }, "end": { - "line": 100, + "line": 90, "column": 26 } } @@ -14989,15 +13692,15 @@ "updateContext": null }, "value": "=", - "start": 2585, - "end": 2586, + "start": 2362, + "end": 2363, "loc": { "start": { - "line": 100, + "line": 90, "column": 27 }, "end": { - "line": 100, + "line": 90, "column": 28 } } @@ -15015,15 +13718,15 @@ "binop": null }, "value": "MemoizedQueryIndex", - "start": 2587, - "end": 2605, + "start": 2364, + "end": 2382, "loc": { "start": { - "line": 100, + "line": 90, "column": 29 }, "end": { - "line": 100, + "line": 90, "column": 47 } } @@ -15041,15 +13744,15 @@ "binop": null, "updateContext": null }, - "start": 2606, - "end": 2606, + "start": 2383, + "end": 2383, "loc": { "start": { - "line": 101, + "line": 91, "column": 0 }, "end": { - "line": 101, + "line": 91, "column": 0 } } diff --git a/docs/ast/source/simple_index.js.json b/docs/ast/source/simple_index.js.json index fef2d61..8a874b0 100644 --- a/docs/ast/source/simple_index.js.json +++ b/docs/ast/source/simple_index.js.json @@ -1,28 +1,28 @@ { "type": "File", "start": 0, - "end": 1994, + "end": 1654, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 78, + "line": 67, "column": 0 } }, "program": { "type": "Program", "start": 0, - "end": 1994, + "end": 1654, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 78, + "line": 67, "column": 0 } }, @@ -363,14 +363,14 @@ { "type": "ClassDeclaration", "start": 343, - "end": 1958, + "end": 1618, "loc": { "start": { "line": 13, "column": 0 }, "end": { - "line": 75, + "line": 64, "column": 1 } }, @@ -396,14 +396,14 @@ "body": { "type": "ClassBody", "start": 361, - "end": 1958, + "end": 1618, "loc": { "start": { "line": 13, "column": 18 }, "end": { - "line": 75, + "line": 64, "column": 1 } }, @@ -3053,283 +3053,9 @@ "trailingComments": [ { "type": "CommentLine", - "value": " TODO: Remove these from the index classes, have Entity pass whatever is needed", - "start": 1429, - "end": 1510, - "loc": { - "start": { - "line": 58, - "column": 1 - }, - "end": { - "line": 58, - "column": 82 - } - } - }, - { - "type": "CommentLine", - "value": " Add an entity and all of its components to the index", - "start": 1512, - "end": 1567, - "loc": { - "start": { - "line": 59, - "column": 1 - }, - "end": { - "line": 59, - "column": 56 - } - } - } - ] - }, - { - "type": "ClassMethod", - "start": 1569, - "end": 1632, - "loc": { - "start": { - "line": 60, - "column": 1 - }, - "end": { - "line": 62, - "column": 2 - } - }, - "static": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 1569, - "end": 1578, - "loc": { - "start": { - "line": 60, - "column": 1 - }, - "end": { - "line": 60, - "column": 10 - }, - "identifierName": "addEntity" - }, - "name": "addEntity", - "leadingComments": null - }, - "kind": "method", - "id": null, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "Identifier", - "start": 1579, - "end": 1585, - "loc": { - "start": { - "line": 60, - "column": 11 - }, - "end": { - "line": 60, - "column": 17 - }, - "identifierName": "entity" - }, - "name": "entity" - } - ], - "body": { - "type": "BlockStatement", - "start": 1587, - "end": 1632, - "loc": { - "start": { - "line": 60, - "column": 19 - }, - "end": { - "line": 62, - "column": 2 - } - }, - "body": [ - { - "type": "ExpressionStatement", - "start": 1591, - "end": 1629, - "loc": { - "start": { - "line": 61, - "column": 2 - }, - "end": { - "line": 61, - "column": 40 - } - }, - "expression": { - "type": "CallExpression", - "start": 1591, - "end": 1629, - "loc": { - "start": { - "line": 61, - "column": 2 - }, - "end": { - "line": 61, - "column": 40 - } - }, - "callee": { - "type": "MemberExpression", - "start": 1591, - "end": 1599, - "loc": { - "start": { - "line": 61, - "column": 2 - }, - "end": { - "line": 61, - "column": 10 - } - }, - "object": { - "type": "ThisExpression", - "start": 1591, - "end": 1595, - "loc": { - "start": { - "line": 61, - "column": 2 - }, - "end": { - "line": 61, - "column": 6 - } - } - }, - "property": { - "type": "Identifier", - "start": 1596, - "end": 1599, - "loc": { - "start": { - "line": 61, - "column": 7 - }, - "end": { - "line": 61, - "column": 10 - }, - "identifierName": "add" - }, - "name": "add" - }, - "computed": false - }, - "arguments": [ - { - "type": "Identifier", - "start": 1600, - "end": 1606, - "loc": { - "start": { - "line": 61, - "column": 11 - }, - "end": { - "line": 61, - "column": 17 - }, - "identifierName": "entity" - }, - "name": "entity" - }, - { - "type": "SpreadElement", - "start": 1608, - "end": 1628, - "loc": { - "start": { - "line": 61, - "column": 19 - }, - "end": { - "line": 61, - "column": 39 - } - }, - "argument": { - "type": "MemberExpression", - "start": 1611, - "end": 1628, - "loc": { - "start": { - "line": 61, - "column": 22 - }, - "end": { - "line": 61, - "column": 39 - } - }, - "object": { - "type": "Identifier", - "start": 1611, - "end": 1617, - "loc": { - "start": { - "line": 61, - "column": 22 - }, - "end": { - "line": 61, - "column": 28 - }, - "identifierName": "entity" - }, - "name": "entity" - }, - "property": { - "type": "Identifier", - "start": 1618, - "end": 1628, - "loc": { - "start": { - "line": 61, - "column": 29 - }, - "end": { - "line": 61, - "column": 39 - }, - "identifierName": "components" - }, - "name": "components" - }, - "computed": false - } - } - ] - } - } - ], - "directives": [], - "trailingComments": null - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " TODO: Remove these from the index classes, have Entity pass whatever is needed", + "value": " Remove certain components from the index for an entity", "start": 1429, - "end": 1510, + "end": 1486, "loc": { "start": { "line": 58, @@ -3337,40 +3063,6 @@ }, "end": { "line": 58, - "column": 82 - } - } - }, - { - "type": "CommentLine", - "value": " Add an entity and all of its components to the index", - "start": 1512, - "end": 1567, - "loc": { - "start": { - "line": 59, - "column": 1 - }, - "end": { - "line": 59, - "column": 56 - } - } - } - ], - "trailingComments": [ - { - "type": "CommentLine", - "value": " Remove certain components from the index for an entity", - "start": 1635, - "end": 1692, - "loc": { - "start": { - "line": 64, - "column": 1 - }, - "end": { - "line": 64, "column": 58 } } @@ -3379,15 +3071,15 @@ }, { "type": "ClassMethod", - "start": 1694, - "end": 1822, + "start": 1488, + "end": 1616, "loc": { "start": { - "line": 65, + "line": 59, "column": 1 }, "end": { - "line": 69, + "line": 63, "column": 2 } }, @@ -3395,15 +3087,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 1694, - "end": 1700, + "start": 1488, + "end": 1494, "loc": { "start": { - "line": 65, + "line": 59, "column": 1 }, "end": { - "line": 65, + "line": 59, "column": 7 }, "identifierName": "remove" @@ -3419,15 +3111,15 @@ "params": [ { "type": "Identifier", - "start": 1701, - "end": 1707, + "start": 1495, + "end": 1501, "loc": { "start": { - "line": 65, + "line": 59, "column": 8 }, "end": { - "line": 65, + "line": 59, "column": 14 }, "identifierName": "entity" @@ -3436,29 +3128,29 @@ }, { "type": "RestElement", - "start": 1709, - "end": 1726, + "start": 1503, + "end": 1520, "loc": { "start": { - "line": 65, + "line": 59, "column": 16 }, "end": { - "line": 65, + "line": 59, "column": 33 } }, "argument": { "type": "Identifier", - "start": 1712, - "end": 1726, + "start": 1506, + "end": 1520, "loc": { "start": { - "line": 65, + "line": 59, "column": 19 }, "end": { - "line": 65, + "line": 59, "column": 33 }, "identifierName": "componentNames" @@ -3469,73 +3161,73 @@ ], "body": { "type": "BlockStatement", - "start": 1728, - "end": 1822, + "start": 1522, + "end": 1616, "loc": { "start": { - "line": 65, + "line": 59, "column": 35 }, "end": { - "line": 69, + "line": 63, "column": 2 } }, "body": [ { "type": "ForOfStatement", - "start": 1732, - "end": 1819, + "start": 1526, + "end": 1613, "loc": { "start": { - "line": 66, + "line": 60, "column": 2 }, "end": { - "line": 68, + "line": 62, "column": 3 } }, "left": { "type": "VariableDeclaration", - "start": 1737, - "end": 1750, + "start": 1531, + "end": 1544, "loc": { "start": { - "line": 66, + "line": 60, "column": 7 }, "end": { - "line": 66, + "line": 60, "column": 20 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 1741, - "end": 1750, + "start": 1535, + "end": 1544, "loc": { "start": { - "line": 66, + "line": 60, "column": 11 }, "end": { - "line": 66, + "line": 60, "column": 20 } }, "id": { "type": "Identifier", - "start": 1741, - "end": 1750, + "start": 1535, + "end": 1544, "loc": { "start": { - "line": 66, + "line": 60, "column": 11 }, "end": { - "line": 66, + "line": 60, "column": 20 }, "identifierName": "component" @@ -3549,15 +3241,15 @@ }, "right": { "type": "Identifier", - "start": 1754, - "end": 1768, + "start": 1548, + "end": 1562, "loc": { "start": { - "line": 66, + "line": 60, "column": 24 }, "end": { - "line": 66, + "line": 60, "column": 38 }, "identifierName": "componentNames" @@ -3566,115 +3258,115 @@ }, "body": { "type": "BlockStatement", - "start": 1770, - "end": 1819, + "start": 1564, + "end": 1613, "loc": { "start": { - "line": 66, + "line": 60, "column": 40 }, "end": { - "line": 68, + "line": 62, "column": 3 } }, "body": [ { "type": "ExpressionStatement", - "start": 1775, - "end": 1815, + "start": 1569, + "end": 1609, "loc": { "start": { - "line": 67, + "line": 61, "column": 3 }, "end": { - "line": 67, + "line": 61, "column": 43 } }, "expression": { "type": "CallExpression", - "start": 1775, - "end": 1815, + "start": 1569, + "end": 1609, "loc": { "start": { - "line": 67, + "line": 61, "column": 3 }, "end": { - "line": 67, + "line": 61, "column": 43 } }, "callee": { "type": "MemberExpression", - "start": 1775, - "end": 1804, + "start": 1569, + "end": 1598, "loc": { "start": { - "line": 67, + "line": 61, "column": 3 }, "end": { - "line": 67, + "line": 61, "column": 32 } }, "object": { "type": "CallExpression", - "start": 1775, - "end": 1797, + "start": 1569, + "end": 1591, "loc": { "start": { - "line": 67, + "line": 61, "column": 3 }, "end": { - "line": 67, + "line": 61, "column": 25 } }, "callee": { "type": "MemberExpression", - "start": 1775, - "end": 1786, + "start": 1569, + "end": 1580, "loc": { "start": { - "line": 67, + "line": 61, "column": 3 }, "end": { - "line": 67, + "line": 61, "column": 14 } }, "object": { "type": "ThisExpression", - "start": 1775, - "end": 1779, + "start": 1569, + "end": 1573, "loc": { "start": { - "line": 67, + "line": 61, "column": 3 }, "end": { - "line": 67, + "line": 61, "column": 7 } } }, "property": { "type": "Identifier", - "start": 1780, - "end": 1786, + "start": 1574, + "end": 1580, "loc": { "start": { - "line": 67, + "line": 61, "column": 8 }, "end": { - "line": 67, + "line": 61, "column": 14 }, "identifierName": "access" @@ -3686,15 +3378,15 @@ "arguments": [ { "type": "Identifier", - "start": 1787, - "end": 1796, + "start": 1581, + "end": 1590, "loc": { "start": { - "line": 67, + "line": 61, "column": 15 }, "end": { - "line": 67, + "line": 61, "column": 24 }, "identifierName": "component" @@ -3705,15 +3397,15 @@ }, "property": { "type": "Identifier", - "start": 1798, - "end": 1804, + "start": 1592, + "end": 1598, "loc": { "start": { - "line": 67, + "line": 61, "column": 26 }, "end": { - "line": 67, + "line": 61, "column": 32 }, "identifierName": "delete" @@ -3725,29 +3417,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 1805, - "end": 1814, + "start": 1599, + "end": 1608, "loc": { "start": { - "line": 67, + "line": 61, "column": 33 }, "end": { - "line": 67, + "line": 61, "column": 42 } }, "object": { "type": "Identifier", - "start": 1805, - "end": 1811, + "start": 1599, + "end": 1605, "loc": { "start": { - "line": 67, + "line": 61, "column": 33 }, "end": { - "line": 67, + "line": 61, "column": 39 }, "identifierName": "entity" @@ -3756,15 +3448,15 @@ }, "property": { "type": "Identifier", - "start": 1812, - "end": 1814, + "start": 1606, + "end": 1608, "loc": { "start": { - "line": 67, + "line": 61, "column": 40 }, "end": { - "line": 67, + "line": 61, "column": 42 }, "identifierName": "id" @@ -3781,301 +3473,25 @@ } } ], - "directives": [], - "trailingComments": null + "directives": [] }, "leadingComments": [ { "type": "CommentLine", "value": " Remove certain components from the index for an entity", - "start": 1635, - "end": 1692, + "start": 1429, + "end": 1486, "loc": { "start": { - "line": 64, + "line": 58, "column": 1 }, "end": { - "line": 64, + "line": 58, "column": 58 } } } - ], - "trailingComments": [ - { - "type": "CommentLine", - "value": " Remove an entity and all of its components from the index", - "start": 1825, - "end": 1885, - "loc": { - "start": { - "line": 71, - "column": 1 - }, - "end": { - "line": 71, - "column": 61 - } - } - } - ] - }, - { - "type": "ClassMethod", - "start": 1887, - "end": 1956, - "loc": { - "start": { - "line": 72, - "column": 1 - }, - "end": { - "line": 74, - "column": 2 - } - }, - "static": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 1887, - "end": 1899, - "loc": { - "start": { - "line": 72, - "column": 1 - }, - "end": { - "line": 72, - "column": 13 - }, - "identifierName": "removeEntity" - }, - "name": "removeEntity", - "leadingComments": null - }, - "kind": "method", - "id": null, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "Identifier", - "start": 1900, - "end": 1906, - "loc": { - "start": { - "line": 72, - "column": 14 - }, - "end": { - "line": 72, - "column": 20 - }, - "identifierName": "entity" - }, - "name": "entity" - } - ], - "body": { - "type": "BlockStatement", - "start": 1908, - "end": 1956, - "loc": { - "start": { - "line": 72, - "column": 22 - }, - "end": { - "line": 74, - "column": 2 - } - }, - "body": [ - { - "type": "ExpressionStatement", - "start": 1912, - "end": 1953, - "loc": { - "start": { - "line": 73, - "column": 2 - }, - "end": { - "line": 73, - "column": 43 - } - }, - "expression": { - "type": "CallExpression", - "start": 1912, - "end": 1953, - "loc": { - "start": { - "line": 73, - "column": 2 - }, - "end": { - "line": 73, - "column": 43 - } - }, - "callee": { - "type": "MemberExpression", - "start": 1912, - "end": 1923, - "loc": { - "start": { - "line": 73, - "column": 2 - }, - "end": { - "line": 73, - "column": 13 - } - }, - "object": { - "type": "ThisExpression", - "start": 1912, - "end": 1916, - "loc": { - "start": { - "line": 73, - "column": 2 - }, - "end": { - "line": 73, - "column": 6 - } - } - }, - "property": { - "type": "Identifier", - "start": 1917, - "end": 1923, - "loc": { - "start": { - "line": 73, - "column": 7 - }, - "end": { - "line": 73, - "column": 13 - }, - "identifierName": "remove" - }, - "name": "remove" - }, - "computed": false - }, - "arguments": [ - { - "type": "Identifier", - "start": 1924, - "end": 1930, - "loc": { - "start": { - "line": 73, - "column": 14 - }, - "end": { - "line": 73, - "column": 20 - }, - "identifierName": "entity" - }, - "name": "entity" - }, - { - "type": "SpreadElement", - "start": 1932, - "end": 1952, - "loc": { - "start": { - "line": 73, - "column": 22 - }, - "end": { - "line": 73, - "column": 42 - } - }, - "argument": { - "type": "MemberExpression", - "start": 1935, - "end": 1952, - "loc": { - "start": { - "line": 73, - "column": 25 - }, - "end": { - "line": 73, - "column": 42 - } - }, - "object": { - "type": "Identifier", - "start": 1935, - "end": 1941, - "loc": { - "start": { - "line": 73, - "column": 25 - }, - "end": { - "line": 73, - "column": 31 - }, - "identifierName": "entity" - }, - "name": "entity" - }, - "property": { - "type": "Identifier", - "start": 1942, - "end": 1952, - "loc": { - "start": { - "line": 73, - "column": 32 - }, - "end": { - "line": 73, - "column": 42 - }, - "identifierName": "components" - }, - "name": "components" - }, - "computed": false - } - } - ] - } - } - ], - "directives": [] - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Remove an entity and all of its components from the index", - "start": 1825, - "end": 1885, - "loc": { - "start": { - "line": 71, - "column": 1 - }, - "end": { - "line": 71, - "column": 61 - } - } - } ] } ] @@ -4101,58 +3517,58 @@ }, { "type": "ExpressionStatement", - "start": 1960, - "end": 1993, + "start": 1620, + "end": 1653, "loc": { "start": { - "line": 77, + "line": 66, "column": 0 }, "end": { - "line": 77, + "line": 66, "column": 33 } }, "expression": { "type": "AssignmentExpression", - "start": 1960, - "end": 1993, + "start": 1620, + "end": 1653, "loc": { "start": { - "line": 77, + "line": 66, "column": 0 }, "end": { - "line": 77, + "line": 66, "column": 33 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 1960, - "end": 1979, + "start": 1620, + "end": 1639, "loc": { "start": { - "line": 77, + "line": 66, "column": 0 }, "end": { - "line": 77, + "line": 66, "column": 19 } }, "object": { "type": "Identifier", - "start": 1960, - "end": 1967, + "start": 1620, + "end": 1627, "loc": { "start": { - "line": 77, + "line": 66, "column": 0 }, "end": { - "line": 77, + "line": 66, "column": 7 }, "identifierName": "exports" @@ -4161,15 +3577,15 @@ }, "property": { "type": "Identifier", - "start": 1968, - "end": 1979, + "start": 1628, + "end": 1639, "loc": { "start": { - "line": 77, + "line": 66, "column": 8 }, "end": { - "line": 77, + "line": 66, "column": 19 }, "identifierName": "SimpleIndex" @@ -4180,15 +3596,15 @@ }, "right": { "type": "Identifier", - "start": 1982, - "end": 1993, + "start": 1642, + "end": 1653, "loc": { "start": { - "line": 77, + "line": 66, "column": 22 }, "end": { - "line": 77, + "line": 66, "column": 33 }, "identifierName": "SimpleIndex" @@ -4347,9 +3763,9 @@ }, { "type": "CommentLine", - "value": " TODO: Remove these from the index classes, have Entity pass whatever is needed", + "value": " Remove certain components from the index for an entity", "start": 1429, - "end": 1510, + "end": 1486, "loc": { "start": { "line": 58, @@ -4357,57 +3773,9 @@ }, "end": { "line": 58, - "column": 82 - } - } - }, - { - "type": "CommentLine", - "value": " Add an entity and all of its components to the index", - "start": 1512, - "end": 1567, - "loc": { - "start": { - "line": 59, - "column": 1 - }, - "end": { - "line": 59, - "column": 56 - } - } - }, - { - "type": "CommentLine", - "value": " Remove certain components from the index for an entity", - "start": 1635, - "end": 1692, - "loc": { - "start": { - "line": 64, - "column": 1 - }, - "end": { - "line": 64, "column": 58 } } - }, - { - "type": "CommentLine", - "value": " Remove an entity and all of its components from the index", - "start": 1825, - "end": 1885, - "loc": { - "start": { - "line": 71, - "column": 1 - }, - "end": { - "line": 71, - "column": 61 - } - } } ], "tokens": [ @@ -9987,9 +9355,9 @@ }, { "type": "CommentLine", - "value": " TODO: Remove these from the index classes, have Entity pass whatever is needed", + "value": " Remove certain components from the index for an entity", "start": 1429, - "end": 1510, + "end": 1486, "loc": { "start": { "line": 58, @@ -9997,23 +9365,7 @@ }, "end": { "line": 58, - "column": 82 - } - } - }, - { - "type": "CommentLine", - "value": " Add an entity and all of its components to the index", - "start": 1512, - "end": 1567, - "loc": { - "start": { - "line": 59, - "column": 1 - }, - "end": { - "line": 59, - "column": 56 + "column": 58 } } }, @@ -10029,17 +9381,17 @@ "postfix": false, "binop": null }, - "value": "addEntity", - "start": 1569, - "end": 1578, + "value": "remove", + "start": 1488, + "end": 1494, "loc": { "start": { - "line": 60, + "line": 59, "column": 1 }, "end": { - "line": 60, - "column": 10 + "line": 59, + "column": 7 } } }, @@ -10055,16 +9407,16 @@ "postfix": false, "binop": null }, - "start": 1578, - "end": 1579, + "start": 1494, + "end": 1495, "loc": { "start": { - "line": 60, - "column": 10 + "line": 59, + "column": 7 }, "end": { - "line": 60, - "column": 11 + "line": 59, + "column": 8 } } }, @@ -10081,842 +9433,49 @@ "binop": null }, "value": "entity", - "start": 1579, - "end": 1585, + "start": 1495, + "end": 1501, "loc": { "start": { - "line": 60, - "column": 11 + "line": 59, + "column": 8 }, "end": { - "line": 60, - "column": 17 + "line": 59, + "column": 14 } } }, { "type": { - "label": ")", - "beforeExpr": false, + "label": ",", + "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 1585, - "end": 1586, + "start": 1501, + "end": 1502, "loc": { "start": { - "line": 60, - "column": 17 - }, - "end": { - "line": 60, - "column": 18 - } - } - }, - { - "type": { - "label": "{", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 1587, - "end": 1588, - "loc": { - "start": { - "line": 60, - "column": 19 - }, - "end": { - "line": 60, - "column": 20 - } - } - }, - { - "type": { - "label": "this", - "keyword": "this", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "this", - "start": 1591, - "end": 1595, - "loc": { - "start": { - "line": 61, - "column": 2 - }, - "end": { - "line": 61, - "column": 6 - } - } - }, - { - "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 1595, - "end": 1596, - "loc": { - "start": { - "line": 61, - "column": 6 - }, - "end": { - "line": 61, - "column": 7 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "add", - "start": 1596, - "end": 1599, - "loc": { - "start": { - "line": 61, - "column": 7 - }, - "end": { - "line": 61, - "column": 10 - } - } - }, - { - "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 1599, - "end": 1600, - "loc": { - "start": { - "line": 61, - "column": 10 - }, - "end": { - "line": 61, - "column": 11 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "entity", - "start": 1600, - "end": 1606, - "loc": { - "start": { - "line": 61, - "column": 11 - }, - "end": { - "line": 61, - "column": 17 - } - } - }, - { - "type": { - "label": ",", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 1606, - "end": 1607, - "loc": { - "start": { - "line": 61, - "column": 17 - }, - "end": { - "line": 61, - "column": 18 - } - } - }, - { - "type": { - "label": "...", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 1608, - "end": 1611, - "loc": { - "start": { - "line": 61, - "column": 19 - }, - "end": { - "line": 61, - "column": 22 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "entity", - "start": 1611, - "end": 1617, - "loc": { - "start": { - "line": 61, - "column": 22 - }, - "end": { - "line": 61, - "column": 28 - } - } - }, - { - "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 1617, - "end": 1618, - "loc": { - "start": { - "line": 61, - "column": 28 - }, - "end": { - "line": 61, - "column": 29 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "components", - "start": 1618, - "end": 1628, - "loc": { - "start": { - "line": 61, - "column": 29 - }, - "end": { - "line": 61, - "column": 39 - } - } - }, - { - "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 1628, - "end": 1629, - "loc": { - "start": { - "line": 61, - "column": 39 - }, - "end": { - "line": 61, - "column": 40 - } - } - }, - { - "type": { - "label": "}", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 1631, - "end": 1632, - "loc": { - "start": { - "line": 62, - "column": 1 - }, - "end": { - "line": 62, - "column": 2 - } - } - }, - { - "type": "CommentLine", - "value": " Remove certain components from the index for an entity", - "start": 1635, - "end": 1692, - "loc": { - "start": { - "line": 64, - "column": 1 - }, - "end": { - "line": 64, - "column": 58 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "remove", - "start": 1694, - "end": 1700, - "loc": { - "start": { - "line": 65, - "column": 1 - }, - "end": { - "line": 65, - "column": 7 - } - } - }, - { - "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 1700, - "end": 1701, - "loc": { - "start": { - "line": 65, - "column": 7 - }, - "end": { - "line": 65, - "column": 8 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "entity", - "start": 1701, - "end": 1707, - "loc": { - "start": { - "line": 65, - "column": 8 - }, - "end": { - "line": 65, - "column": 14 - } - } - }, - { - "type": { - "label": ",", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 1707, - "end": 1708, - "loc": { - "start": { - "line": 65, - "column": 14 - }, - "end": { - "line": 65, - "column": 15 - } - } - }, - { - "type": { - "label": "...", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 1709, - "end": 1712, - "loc": { - "start": { - "line": 65, - "column": 16 - }, - "end": { - "line": 65, - "column": 19 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "componentNames", - "start": 1712, - "end": 1726, - "loc": { - "start": { - "line": 65, - "column": 19 - }, - "end": { - "line": 65, - "column": 33 - } - } - }, - { - "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 1726, - "end": 1727, - "loc": { - "start": { - "line": 65, - "column": 33 - }, - "end": { - "line": 65, - "column": 34 - } - } - }, - { - "type": { - "label": "{", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 1728, - "end": 1729, - "loc": { - "start": { - "line": 65, - "column": 35 - }, - "end": { - "line": 65, - "column": 36 - } - } - }, - { - "type": { - "label": "for", - "keyword": "for", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": true, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "for", - "start": 1732, - "end": 1735, - "loc": { - "start": { - "line": 66, - "column": 2 - }, - "end": { - "line": 66, - "column": 5 - } - } - }, - { - "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 1736, - "end": 1737, - "loc": { - "start": { - "line": 66, - "column": 6 - }, - "end": { - "line": 66, - "column": 7 - } - } - }, - { - "type": { - "label": "let", - "keyword": "let", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "let", - "start": 1737, - "end": 1740, - "loc": { - "start": { - "line": 66, - "column": 7 - }, - "end": { - "line": 66, - "column": 10 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "component", - "start": 1741, - "end": 1750, - "loc": { - "start": { - "line": 66, - "column": 11 - }, - "end": { - "line": 66, - "column": 20 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "of", - "start": 1751, - "end": 1753, - "loc": { - "start": { - "line": 66, - "column": 21 - }, - "end": { - "line": 66, - "column": 23 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "componentNames", - "start": 1754, - "end": 1768, - "loc": { - "start": { - "line": 66, - "column": 24 - }, - "end": { - "line": 66, - "column": 38 - } - } - }, - { - "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 1768, - "end": 1769, - "loc": { - "start": { - "line": 66, - "column": 38 - }, - "end": { - "line": 66, - "column": 39 - } - } - }, - { - "type": { - "label": "{", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 1770, - "end": 1771, - "loc": { - "start": { - "line": 66, - "column": 40 - }, - "end": { - "line": 66, - "column": 41 - } - } - }, - { - "type": { - "label": "this", - "keyword": "this", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "this", - "start": 1775, - "end": 1779, - "loc": { - "start": { - "line": 67, - "column": 3 + "line": 59, + "column": 14 }, "end": { - "line": 67, - "column": 7 + "line": 59, + "column": 15 } } }, { "type": { - "label": ".", - "beforeExpr": false, + "label": "...", + "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, @@ -10926,67 +9485,16 @@ "binop": null, "updateContext": null }, - "start": 1779, - "end": 1780, - "loc": { - "start": { - "line": 67, - "column": 7 - }, - "end": { - "line": 67, - "column": 8 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "access", - "start": 1780, - "end": 1786, - "loc": { - "start": { - "line": 67, - "column": 8 - }, - "end": { - "line": 67, - "column": 14 - } - } - }, - { - "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 1786, - "end": 1787, + "start": 1503, + "end": 1506, "loc": { "start": { - "line": 67, - "column": 14 + "line": 59, + "column": 16 }, "end": { - "line": 67, - "column": 15 + "line": 59, + "column": 19 } } }, @@ -11002,17 +9510,17 @@ "postfix": false, "binop": null }, - "value": "component", - "start": 1787, - "end": 1796, + "value": "componentNames", + "start": 1506, + "end": 1520, "loc": { "start": { - "line": 67, - "column": 15 + "line": 59, + "column": 19 }, "end": { - "line": 67, - "column": 24 + "line": 59, + "column": 33 } } }, @@ -11028,154 +9536,23 @@ "postfix": false, "binop": null }, - "start": 1796, - "end": 1797, - "loc": { - "start": { - "line": 67, - "column": 24 - }, - "end": { - "line": 67, - "column": 25 - } - } - }, - { - "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 1797, - "end": 1798, - "loc": { - "start": { - "line": 67, - "column": 25 - }, - "end": { - "line": 67, - "column": 26 - } - } - }, - { - "type": { - "label": "delete", - "keyword": "delete", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": true, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "delete", - "start": 1798, - "end": 1804, - "loc": { - "start": { - "line": 67, - "column": 26 - }, - "end": { - "line": 67, - "column": 32 - } - } - }, - { - "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 1804, - "end": 1805, - "loc": { - "start": { - "line": 67, - "column": 32 - }, - "end": { - "line": 67, - "column": 33 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "entity", - "start": 1805, - "end": 1811, + "start": 1520, + "end": 1521, "loc": { "start": { - "line": 67, + "line": 59, "column": 33 }, "end": { - "line": 67, - "column": 39 - } - } - }, - { - "type": { - "label": ".", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 1811, - "end": 1812, - "loc": { - "start": { - "line": 67, - "column": 39 - }, - "end": { - "line": 67, - "column": 40 + "line": 59, + "column": 34 } } }, { "type": { - "label": "name", - "beforeExpr": false, + "label": "{", + "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -11184,75 +9561,52 @@ "postfix": false, "binop": null }, - "value": "id", - "start": 1812, - "end": 1814, - "loc": { - "start": { - "line": 67, - "column": 40 - }, - "end": { - "line": 67, - "column": 42 - } - } - }, - { - "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 1814, - "end": 1815, + "start": 1522, + "end": 1523, "loc": { "start": { - "line": 67, - "column": 42 + "line": 59, + "column": 35 }, "end": { - "line": 67, - "column": 43 + "line": 59, + "column": 36 } } }, { "type": { - "label": "}", + "label": "for", + "keyword": "for", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, - "isLoop": false, + "isLoop": true, "isAssign": false, "prefix": false, "postfix": false, - "binop": null + "binop": null, + "updateContext": null }, - "start": 1818, - "end": 1819, + "value": "for", + "start": 1526, + "end": 1529, "loc": { "start": { - "line": 68, + "line": 60, "column": 2 }, "end": { - "line": 68, - "column": 3 + "line": 60, + "column": 5 } } }, { "type": { - "label": "}", - "beforeExpr": false, - "startsExpr": false, + "label": "(", + "beforeExpr": true, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, @@ -11260,32 +9614,44 @@ "postfix": false, "binop": null }, - "start": 1821, - "end": 1822, + "start": 1530, + "end": 1531, "loc": { "start": { - "line": 69, - "column": 1 + "line": 60, + "column": 6 }, "end": { - "line": 69, - "column": 2 + "line": 60, + "column": 7 } } }, { - "type": "CommentLine", - "value": " Remove an entity and all of its components from the index", - "start": 1825, - "end": 1885, + "type": { + "label": "let", + "keyword": "let", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "value": "let", + "start": 1531, + "end": 1534, "loc": { "start": { - "line": 71, - "column": 1 + "line": 60, + "column": 7 }, "end": { - "line": 71, - "column": 61 + "line": 60, + "column": 10 } } }, @@ -11301,24 +9667,24 @@ "postfix": false, "binop": null }, - "value": "removeEntity", - "start": 1887, - "end": 1899, + "value": "component", + "start": 1535, + "end": 1544, "loc": { "start": { - "line": 72, - "column": 1 + "line": 60, + "column": 11 }, "end": { - "line": 72, - "column": 13 + "line": 60, + "column": 20 } } }, { "type": { - "label": "(", - "beforeExpr": true, + "label": "name", + "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, @@ -11327,16 +9693,17 @@ "postfix": false, "binop": null }, - "start": 1899, - "end": 1900, + "value": "of", + "start": 1545, + "end": 1547, "loc": { "start": { - "line": 72, - "column": 13 + "line": 60, + "column": 21 }, "end": { - "line": 72, - "column": 14 + "line": 60, + "column": 23 } } }, @@ -11352,17 +9719,17 @@ "postfix": false, "binop": null }, - "value": "entity", - "start": 1900, - "end": 1906, + "value": "componentNames", + "start": 1548, + "end": 1562, "loc": { "start": { - "line": 72, - "column": 14 + "line": 60, + "column": 24 }, "end": { - "line": 72, - "column": 20 + "line": 60, + "column": 38 } } }, @@ -11378,16 +9745,16 @@ "postfix": false, "binop": null }, - "start": 1906, - "end": 1907, + "start": 1562, + "end": 1563, "loc": { "start": { - "line": 72, - "column": 20 + "line": 60, + "column": 38 }, "end": { - "line": 72, - "column": 21 + "line": 60, + "column": 39 } } }, @@ -11403,16 +9770,16 @@ "postfix": false, "binop": null }, - "start": 1908, - "end": 1909, + "start": 1564, + "end": 1565, "loc": { "start": { - "line": 72, - "column": 22 + "line": 60, + "column": 40 }, "end": { - "line": 72, - "column": 23 + "line": 60, + "column": 41 } } }, @@ -11431,16 +9798,16 @@ "updateContext": null }, "value": "this", - "start": 1912, - "end": 1916, + "start": 1569, + "end": 1573, "loc": { "start": { - "line": 73, - "column": 2 + "line": 61, + "column": 3 }, "end": { - "line": 73, - "column": 6 + "line": 61, + "column": 7 } } }, @@ -11457,16 +9824,16 @@ "binop": null, "updateContext": null }, - "start": 1916, - "end": 1917, + "start": 1573, + "end": 1574, "loc": { "start": { - "line": 73, - "column": 6 + "line": 61, + "column": 7 }, "end": { - "line": 73, - "column": 7 + "line": 61, + "column": 8 } } }, @@ -11482,17 +9849,17 @@ "postfix": false, "binop": null }, - "value": "remove", - "start": 1917, - "end": 1923, + "value": "access", + "start": 1574, + "end": 1580, "loc": { "start": { - "line": 73, - "column": 7 + "line": 61, + "column": 8 }, "end": { - "line": 73, - "column": 13 + "line": 61, + "column": 14 } } }, @@ -11508,16 +9875,16 @@ "postfix": false, "binop": null }, - "start": 1923, - "end": 1924, + "start": 1580, + "end": 1581, "loc": { "start": { - "line": 73, - "column": 13 + "line": 61, + "column": 14 }, "end": { - "line": 73, - "column": 14 + "line": 61, + "column": 15 } } }, @@ -11533,24 +9900,49 @@ "postfix": false, "binop": null }, - "value": "entity", - "start": 1924, - "end": 1930, + "value": "component", + "start": 1581, + "end": 1590, "loc": { "start": { - "line": 73, - "column": 14 + "line": 61, + "column": 15 }, "end": { - "line": 73, - "column": 20 + "line": 61, + "column": 24 } } }, { "type": { - "label": ",", - "beforeExpr": true, + "label": ")", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 1590, + "end": 1591, + "loc": { + "start": { + "line": 61, + "column": 24 + }, + "end": { + "line": 61, + "column": 25 + } + } + }, + { + "type": { + "label": ".", + "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, @@ -11560,42 +9952,69 @@ "binop": null, "updateContext": null }, - "start": 1930, - "end": 1931, + "start": 1591, + "end": 1592, "loc": { "start": { - "line": 73, - "column": 20 + "line": 61, + "column": 25 }, "end": { - "line": 73, - "column": 21 + "line": 61, + "column": 26 } } }, { "type": { - "label": "...", + "label": "delete", + "keyword": "delete", "beforeExpr": true, - "startsExpr": false, + "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, - "prefix": false, + "prefix": true, "postfix": false, "binop": null, "updateContext": null }, - "start": 1932, - "end": 1935, + "value": "delete", + "start": 1592, + "end": 1598, "loc": { "start": { - "line": 73, - "column": 22 + "line": 61, + "column": 26 }, "end": { - "line": 73, - "column": 25 + "line": 61, + "column": 32 + } + } + }, + { + "type": { + "label": "(", + "beforeExpr": true, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 1598, + "end": 1599, + "loc": { + "start": { + "line": 61, + "column": 32 + }, + "end": { + "line": 61, + "column": 33 } } }, @@ -11612,16 +10031,16 @@ "binop": null }, "value": "entity", - "start": 1935, - "end": 1941, + "start": 1599, + "end": 1605, "loc": { "start": { - "line": 73, - "column": 25 + "line": 61, + "column": 33 }, "end": { - "line": 73, - "column": 31 + "line": 61, + "column": 39 } } }, @@ -11638,16 +10057,16 @@ "binop": null, "updateContext": null }, - "start": 1941, - "end": 1942, + "start": 1605, + "end": 1606, "loc": { "start": { - "line": 73, - "column": 31 + "line": 61, + "column": 39 }, "end": { - "line": 73, - "column": 32 + "line": 61, + "column": 40 } } }, @@ -11663,16 +10082,16 @@ "postfix": false, "binop": null }, - "value": "components", - "start": 1942, - "end": 1952, + "value": "id", + "start": 1606, + "end": 1608, "loc": { "start": { - "line": 73, - "column": 32 + "line": 61, + "column": 40 }, "end": { - "line": 73, + "line": 61, "column": 42 } } @@ -11689,15 +10108,15 @@ "postfix": false, "binop": null }, - "start": 1952, - "end": 1953, + "start": 1608, + "end": 1609, "loc": { "start": { - "line": 73, + "line": 61, "column": 42 }, "end": { - "line": 73, + "line": 61, "column": 43 } } @@ -11714,15 +10133,40 @@ "postfix": false, "binop": null }, - "start": 1955, - "end": 1956, + "start": 1612, + "end": 1613, + "loc": { + "start": { + "line": 62, + "column": 2 + }, + "end": { + "line": 62, + "column": 3 + } + } + }, + { + "type": { + "label": "}", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 1615, + "end": 1616, "loc": { "start": { - "line": 74, + "line": 63, "column": 1 }, "end": { - "line": 74, + "line": 63, "column": 2 } } @@ -11739,15 +10183,15 @@ "postfix": false, "binop": null }, - "start": 1957, - "end": 1958, + "start": 1617, + "end": 1618, "loc": { "start": { - "line": 75, + "line": 64, "column": 0 }, "end": { - "line": 75, + "line": 64, "column": 1 } } @@ -11765,15 +10209,15 @@ "binop": null }, "value": "exports", - "start": 1960, - "end": 1967, + "start": 1620, + "end": 1627, "loc": { "start": { - "line": 77, + "line": 66, "column": 0 }, "end": { - "line": 77, + "line": 66, "column": 7 } } @@ -11791,15 +10235,15 @@ "binop": null, "updateContext": null }, - "start": 1967, - "end": 1968, + "start": 1627, + "end": 1628, "loc": { "start": { - "line": 77, + "line": 66, "column": 7 }, "end": { - "line": 77, + "line": 66, "column": 8 } } @@ -11817,15 +10261,15 @@ "binop": null }, "value": "SimpleIndex", - "start": 1968, - "end": 1979, + "start": 1628, + "end": 1639, "loc": { "start": { - "line": 77, + "line": 66, "column": 8 }, "end": { - "line": 77, + "line": 66, "column": 19 } } @@ -11844,15 +10288,15 @@ "updateContext": null }, "value": "=", - "start": 1980, - "end": 1981, + "start": 1640, + "end": 1641, "loc": { "start": { - "line": 77, + "line": 66, "column": 20 }, "end": { - "line": 77, + "line": 66, "column": 21 } } @@ -11870,15 +10314,15 @@ "binop": null }, "value": "SimpleIndex", - "start": 1982, - "end": 1993, + "start": 1642, + "end": 1653, "loc": { "start": { - "line": 77, + "line": 66, "column": 22 }, "end": { - "line": 77, + "line": 66, "column": 33 } } @@ -11896,15 +10340,15 @@ "binop": null, "updateContext": null }, - "start": 1994, - "end": 1994, + "start": 1654, + "end": 1654, "loc": { "start": { - "line": 78, + "line": 67, "column": 0 }, "end": { - "line": 78, + "line": 67, "column": 0 } } diff --git a/docs/badge.svg b/docs/badge.svg index 2a1f501..14fdb24 100644 --- a/docs/badge.svg +++ b/docs/badge.svg @@ -11,7 +11,7 @@ document document - 70% - 70% + 74% + 74% diff --git a/docs/class/src/entity.js~Entity.html b/docs/class/src/entity.js~Entity.html index 26d7c71..31c2e90 100644 --- a/docs/class/src/entity.js~Entity.html +++ b/docs/class/src/entity.js~Entity.html @@ -721,7 +721,7 @@

- source + source

@@ -778,7 +778,7 @@

- source + source

@@ -837,7 +837,7 @@

- source + source

@@ -896,7 +896,7 @@

- source + source

@@ -984,7 +984,7 @@

- source + source

@@ -1054,7 +1054,7 @@

- source + source

@@ -1106,7 +1106,7 @@

- source + source

@@ -1160,7 +1160,7 @@

- source + source

@@ -1242,7 +1242,7 @@

- source + source

@@ -1323,7 +1323,7 @@

- source + source

@@ -1406,7 +1406,7 @@

- source + source

@@ -1489,7 +1489,7 @@

- source + source

@@ -1553,7 +1553,7 @@

- source + source

@@ -1652,7 +1652,7 @@

- source + source

@@ -1717,7 +1717,7 @@

- source + source

@@ -1781,7 +1781,7 @@

- source + source

@@ -1869,7 +1869,7 @@

- source + source

diff --git a/docs/class/src/memoized_query_index.js~MemoizedQueryIndex.html b/docs/class/src/memoized_query_index.js~MemoizedQueryIndex.html index 4218b9c..248ce13 100644 --- a/docs/class/src/memoized_query_index.js~MemoizedQueryIndex.html +++ b/docs/class/src/memoized_query_index.js~MemoizedQueryIndex.html @@ -216,34 +216,6 @@

MemoizedQueryIndex

- - - -
-

- - - - addEntity(entity: *) -

-
-
- - - -
- - - - - - - - - public - - - @@ -376,34 +348,6 @@

MemoizedQueryIndex

- - - - - public - - - - - - -
-

- - - - removeEntity(entity: *) -

-
-
- - - -
- - - - @@ -609,65 +553,6 @@

Params:

- -
-

- public - - - - - - addEntity(entity: *) - - - - source - -

- - - - - - - - -
-

Params:

- - - - - - - - - - - - - -
NameTypeAttributeDescription
entity*
-
-
- - - - - - - - - - - - - - - - -

@@ -931,7 +816,7 @@

- source + source

@@ -983,65 +868,6 @@

Params:

-
-
-

- public - - - - - - removeEntity(entity: *) - - - - source - -

- - - - - - - - -
-

Params:

- - - - - - - - - - - - - -
NameTypeAttributeDescription
entity*
-
-
- - - - - - - - - - - - - - - - -
diff --git a/docs/class/src/simple_index.js~SimpleIndex.html b/docs/class/src/simple_index.js~SimpleIndex.html index 954e752..95e4c50 100644 --- a/docs/class/src/simple_index.js~SimpleIndex.html +++ b/docs/class/src/simple_index.js~SimpleIndex.html @@ -244,34 +244,6 @@

SimpleIndex

- - - -
-

- - - - addEntity(entity: *) -

-
-
- - - -
- - - - - - - - - public - - - @@ -348,34 +320,6 @@

SimpleIndex

- - - - - public - - - - - - -
-

- - - - removeEntity(entity: *) -

-
-
- - - -
- - - - @@ -658,65 +602,6 @@

Params:

- -
-

- public - - - - - - addEntity(entity: *) - - - - source - -

- - - - - - - - -
-

Params:

- - - - - - - - - - - - - -
NameTypeAttributeDescription
entity*
-
-
- - - - - - - - - - - - - - - - -

@@ -832,7 +717,7 @@

- source + source

@@ -884,65 +769,6 @@

Params:

-
-
-

- public - - - - - - removeEntity(entity: *) - - - - source - -

- - - - - - - - -
-

Params:

- - - - - - - - - - - - - -
NameTypeAttributeDescription
entity*
-
-
- - - - - - - - - - - - - - - - -
diff --git a/docs/coverage.json b/docs/coverage.json index 2a19b1f..575fa36 100644 --- a/docs/coverage.json +++ b/docs/coverage.json @@ -1,6 +1,6 @@ { - "coverage": "70%", - "expectCount": 70, + "coverage": "74.24%", + "expectCount": 66, "actualCount": 49, "files": { "src/entity.js": { @@ -9,7 +9,7 @@ "undocumentLines": [] }, "src/memoized_query_index.js": { - "expectCount": 12, + "expectCount": 10, "actualCount": 1, "undocumentLines": [ 8, @@ -20,13 +20,11 @@ 40, 46, 64, - 77, - 82, - 95 + 77 ] }, "src/simple_index.js": { - "expectCount": 12, + "expectCount": 10, "actualCount": 2, "undocumentLines": [ 14, @@ -36,9 +34,7 @@ 25, 30, 52, - 60, - 65, - 72 + 59 ] }, "src/utilities.js": { diff --git a/docs/file/src/entity.js.html b/docs/file/src/entity.js.html index 3d6d08e..82fb7fe 100644 --- a/docs/file/src/entity.js.html +++ b/docs/file/src/entity.js.html @@ -65,11 +65,6 @@ /** @ignore */ this.data = {} - - // Add to the index, to update match all index - if (this.valid()) { - this.world.index.addEntity(this) - } } /** @@ -268,9 +263,6 @@ this.removeAll() if (this.valid()) { - // Remove entity from the index, to update match all index - this.world.index.removeEntity(this) - // Remove from world this.world.entities.delete(this._id) this._id = undefined @@ -372,7 +364,7 @@ this.world = world this._id = this.world.idCounter++ this.world.entities.set(this._id, this) - this.world.index.addEntity(this) + this.world.index.add(this, ...this.components) } } @@ -388,7 +380,7 @@ detach() { if (this.valid()) { // Remove from current world - this.world.index.removeEntity(this) + this.world.index.remove(this, ...this.components) this.world.entities.delete(this._id) this._id = undefined this.world = undefined diff --git a/docs/file/src/memoized_query_index.js.html b/docs/file/src/memoized_query_index.js.html index 9446cb1..a6f959c 100644 --- a/docs/file/src/memoized_query_index.js.html +++ b/docs/file/src/memoized_query_index.js.html @@ -100,7 +100,7 @@ } } - // Must use all component names + // Must use all component names from entity add(entity) { for (let hash in this.index) { const group = this.index[hash] @@ -113,11 +113,6 @@ } } - // Add an entity and all of its components to the index - addEntity(entity) { - this.add(entity) - } - // Remove certain components from the index for an entity remove(entity, ...componentNames) { for (let hash in this.index) { @@ -130,11 +125,6 @@ } } } - - // Remove an entity and all of its components from the index - removeEntity(entity) { - this.remove(entity, ...entity.components) - } } exports.MemoizedQueryIndex = MemoizedQueryIndex diff --git a/docs/file/src/simple_index.js.html b/docs/file/src/simple_index.js.html index 8cbddaa..920251b 100644 --- a/docs/file/src/simple_index.js.html +++ b/docs/file/src/simple_index.js.html @@ -95,23 +95,12 @@ } } - // TODO: Remove these from the index classes, have Entity pass whatever is needed - // Add an entity and all of its components to the index - addEntity(entity) { - this.add(entity, ...entity.components) - } - // Remove certain components from the index for an entity remove(entity, ...componentNames) { for (let component of componentNames) { this.access(component).delete(entity.id) } } - - // Remove an entity and all of its components from the index - removeEntity(entity) { - this.remove(entity, ...entity.components) - } } exports.SimpleIndex = SimpleIndex diff --git a/docs/index.html b/docs/index.html index 220da61..44d2ea8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -57,23 +57,33 @@

About

Pico Entity System for JavaScript (ES6+).

Read up on what an ECS is here: https://en.wikipedia.org/wiki/Entity_component_system

This entity system is designed to be as simple as possible, while still having useful features.

Features

    -
  • High performance, memoized entity queries
      -
    • O(1) average time
    • +
    • High performance indexing options
        +
      • SimpleIndex (Default): O(1) component add/remove, O(m) query time
          +
        • Where m is the smallest size component index
      • -
      • All definitions are optional
          +
        • MemoizedQueryIndex: O(q) component add/remove, O(1) average query time (memoized), O(n) worst query time (initial)
            +
          • Where q is the total number of memoized queries
          • +
          • And n is the total number of entities
          • +
          +
        • +
        • Note: Above time complexities are amortized assuming the number of components used is a known constant
        • +
        • Can also write your own and pass it to the World constructor! Needs clear, add, remove, and query.
        • +
        +
      • +
      • No formal declarations required
        • Can create components and entities in a world and query on them, without needing to define structured systems and components
      • -
      • Strings as component keys
          +
        • Strings as component keys
          • No need to manually track component keys like many libraries
        • -
        • JSON serialization
            +
          • JSON serialization
            • Useful for save data and networked applications
          • -
          • Prototypes
              +
            • Prototypes
              • Allows entity definitions to be data-driven, outside of code
            • diff --git a/docs/index.json b/docs/index.json index 8cfd222..bfee1e3 100644 --- a/docs/index.json +++ b/docs/index.json @@ -567,7 +567,7 @@ "__docId__": 48, "kind": "file", "name": "src/entity.js", - "content": "/** @ignore */\nconst { invoke } = require('./utilities.js')\n\n/**\n * Entity class used for storing components.\n *\n * @class Entity (name)\n */\nclass Entity {\n\t/**\n\t * Do not construct an Entity yourself - use the entity() method in World instead.\n\t * Also, do not shallow/deep copy entity objects, only pass around references.\n\t *\n\t * @private\n\t *\n\t * @param {World} world - The world\n\t * @param {number} id - The identifier\n\t */\n\tconstructor(world, id) {\n\t\t/** @ignore */\n\t\tthis.world = world\n\n\t\t/** @ignore */\n\t\tthis._id = id\n\n\t\t/** @ignore */\n\t\tthis.data = {}\n\n\t\t// Add to the index, to update match all index\n\t\tif (this.valid()) {\n\t\t\tthis.world.index.addEntity(this)\n\t\t}\n\t}\n\n\t/**\n\t * Return the entity ID.\n\t *\n\t * @return {number} Integer entity ID\n\t */\n\tget id() {\n\t\treturn this._id\n\t}\n\n\t/**\n\t * ID is read-only, attempting to set it will throw an error.\n\t *\n\t * @private\n\t *\n\t * @throws {Error} Cannot set entity id\n\t */\n\tset id(id) {\n\t\tthrow new Error('Cannot set entity id')\n\t}\n\n\t/**\n\t * Returns true if the entity has ALL of the specified component names.\n\t * Additional components that the entity has, which are not specified in has(), will be ignored.\n\t * If no component names are specified, this method returns true.\n\t *\n\t * @example\n\t * if (entity.has('position', 'velocity')) {...}\n\t *\n\t * @param {...string} [components] - The component names to check for\n\t *\n\t * @return {boolean} true or false\n\t */\n\thas(...components) {\n\t\treturn components.every(name => name in this.data)\n\t}\n\n\t/**\n\t * Returns a component by name, or undefined if it doesn't exist\n\t *\n\t * @example\n\t * let position = entity.get('position')\n\t *\n\t * @param {string} component - The component name to get\n\t *\n\t * @return {Object} The component if defined, otherwise undefined\n\t */\n\tget(component) {\n\t\treturn this.data[component]\n\t}\n\n\t/**\n\t * Returns a component by name (automatically created if it doesn't exist)\n\t *\n\t * @example\n\t * let position = entity.access('position', 3, 4)\n\t *\n\t * @param {string} component - The component name to create/get\n\t * @param {...Object} [args] - The arguments to forward to create the new component, only if it doesn't exist.\n\t *\n\t * @return {Object} Always returns either the existing component, or the newly created one.\n\t */\n\taccess(component, ...args) {\n\t\tif (!this.has(component)) {\n\t\t\tthis.set(component, ...args)\n\t\t}\n\t\treturn this.data[component]\n\t}\n\n\t/**\n\t * Adds a new component, or re-creates and overwrites an existing component\n\t *\n\t * @example\n\t * entity.set('position', 1, 2)\n\t *\n\t * @example\n\t * entity.set('anonymousComponent', { keys: 'values' })\n\t *\n\t * @example\n\t * entity.set('anotherAnonymousComponent', 'Any type of any value')\n\t *\n\t * @param {string} component - The component name to create. If there is a registered component for this name, then\n\t * its constructor will be called with (entity, ...args) and an object of that type will be created. The onCreate method\n\t * gets called after the component is added to the entity. This method also gets passed the same parameters.\n\t * @param {...Object} [args] - The arguments to forward to the registered component type. If the component type is\n\t * registered, then only the first additional argument will be used as the value of the entire component.\n\t *\n\t * @return {Object} The original entity that set() was called on, so that operations can be chained.\n\t */\n\tset(component, ...args) {\n\t\tif (this.valid() && component in this.world.components) {\n\t\t\t// Create component and store in entity\n\t\t\t// Note: The entity parameter is dangerous to use, since the component hasn't been added to the entity yet\n\t\t\tthis.data[component] = new this.world.components[component](this, ...args)\n\t\t} else if (args.length > 0) {\n\t\t\t// Use first argument as component value\n\t\t\tthis.data[component] = args[0]\n\t\t} else {\n\t\t\t// Make an empty object\n\t\t\tthis.data[component] = {}\n\t\t}\n\n\t\t// Update the index with this new component\n\t\tif (this.valid()) {\n\t\t\tthis.world.index.add(this, component)\n\t\t}\n\n\t\t// Call custom onCreate to initialize component, pass the entity (this), and any additional arguments passed into set()\n\t\tinvoke(this.data[component], 'onCreate', this, ...args)\n\n\t\treturn this\n\t}\n\n\t/**\n\t * Updates component data from an object or other component. Similar to access() with a shallow merge applied after.\n\t *\n\t * @example\n\t * entity.update('position', { x: 1, y: 2 })\n\t *\n\t * @param {string} component - The component name to update\n\t * @param {Object} data - The object or other component to merge into the specified component.\n\t *\n\t * @return {Object} The original entity that update() was called on, so that operations can be chained.\n\t */\n\tupdate(component, data) {\n\t\tlet comp = this.access(component)\n\n\t\t// Shallow set keys of the component\n\t\tfor (let key in data) {\n\t\t\tcomp[key] = data[key]\n\t\t}\n\n\t\treturn this\n\t}\n\n\t/**\n\t * Removes a component from the entity - has no effect when it doesn't exist.\n\t * Can specify an onRemove() method in your component which gets called before it is removed.\n\t * If nothing is specified, then nothing will be removed. Use removeAll() to remove all components.\n\t *\n\t * @example\n\t * entity.remove('position')\n\t *\n\t * @param {...string} [components] - The component names to remove from the entity.\n\t *\n\t * @return {Object} The original entity that remove() was called on, so that operations can be chained.\n\t */\n\tremove(...components) {\n\t\tfor (let component of components) {\n\t\t\tif (component in this.data) {\n\n\t\t\t\t// Call custom onRemove\n\t\t\t\tinvoke(this.data[component], 'onRemove')\n\n\t\t\t\t// Remove from index\n\t\t\t\tif (this.valid()) {\n\t\t\t\t\tthis.world.index.remove(this, component)\n\t\t\t\t}\n\n\t\t\t\t// Remove from entity\n\t\t\t\tdelete this.data[component]\n\t\t\t}\n\t\t}\n\t\treturn this\n\t}\n\n\t// Remove all components\n\n\t/**\n\t * Removes all components from the entity.\n\t *\n\t * @example\n\t * entity.removeAll()\n\t *\n\t * @return {Object} The original entity that removeAll() was called on, so that operations can be chained.\n\t */\n\tremoveAll() {\n\t\tthis.remove(...this.components)\n\n\t\tif (this.components.length > 0) {\n\t\t\tthrow new Error('Failed to remove all components. Components must have been added during the removeAll().')\n\t\t}\n\n\t\treturn this\n\t}\n\n\t/**\n\t * Remove this entity and all of its components from the world. After an entity is destroyed, the object should be discarded,\n\t * and it is recommended to avoid re-using it.\n\t *\n\t * @example\n\t * entity.destroy()\n\t */\n\tdestroy() {\n\t\tthis.removeAll()\n\n\t\tif (this.valid()) {\n\t\t\t// Remove entity from the index, to update match all index\n\t\t\tthis.world.index.removeEntity(this)\n\n\t\t\t// Remove from world\n\t\t\tthis.world.entities.delete(this._id)\n\t\t\tthis._id = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Returns an array of component names this entity currently has.\n\t *\n\t * @return {Array} Array of component names.\n\t */\n\tget components() {\n\t\treturn Object.keys(this.data)\n\t}\n\n\t/** @ignore */\n\tset components(c) {\n\t\tthrow new Error('Cannot set components in this way. See entity.set().')\n\t}\n\n\t/**\n\t * Returns true if this is a valid, existing, and usable entity, which is attached to a world.\n\t *\n\t * @example\n\t * if (entity.valid()) {...}\n\t *\n\t * @return {boolean} true or false\n\t */\n\tvalid() {\n\t\t// Note: No need to actually look in the world for the ID, if entities are only ever copied by reference.\n\t\t// If entities are ever deep/shallow copied, this function will need to check this to be more robust.\n\t\treturn this.world && this._id !== undefined\n\t}\n\n\t/**\n\t * Returns unique entity ID as a string.\n\t *\n\t * @example\n\t * let entityId = entity.toString()\n\t *\n\t * @return {string} String representation of the entity ID.\n\t */\n\ttoString() {\n\t\treturn String(this._id)\n\t}\n\n\t/**\n\t * Serializes entire entity and components to JSON.\n\t * Note: Defining toJSON methods in your components will override the built-in behavior.\n\t *\n\t * @example\n\t * let serializedEntity = entity.toJSON()\n\t *\n\t * @return {string} JSON encoded string\n\t */\n\ttoJSON() {\n\t\treturn JSON.stringify(this.data)\n\t}\n\n\t/**\n\t * Deserializes data from JSON, creating new components and overwriting existing components.\n\t * Note: Defining fromJSON methods in your components will override the built-in behavior.\n\t *\n\t * @example\n\t * entity.fromJSON(serializedEntity)\n\t *\n\t * @param {string} data - A JSON string containing component data to parse, and store in this entity.\n\t *\n\t * @return {Object} The original entity that fromJSON() was called on, so that operations can be chained.\n\t */\n\tfromJSON(data) {\n\t\tlet parsed = JSON.parse(data)\n\t\tfor (let name in parsed) {\n\t\t\tlet comp = this.access(name)\n\n\t\t\t// Either call custom method or copy all properties\n\t\t\tif (typeof comp.fromJSON === 'function') {\n\t\t\t\tcomp.fromJSON(parsed[name])\n\t\t\t} else {\n\t\t\t\tthis.update(name, parsed[name])\n\t\t\t}\n\t\t}\n\t\treturn this\n\t}\n\n\t/**\n\t * Attaches a currently detached entity back to a world.\n\t * Note: Do not use detached entities, get() may be safe, but avoid calling other methods\n\t * Note: The ID will be reassigned, so do not rely on this\n\t *\n\t * @example\n\t * entity.attach(world)\n\t *\n\t * @param {World} world - The world to attach this entity to\n\t */\n\tattach(world) {\n\t\tif (world && !this.valid()) {\n\t\t\t// Assign new id, and reattach to world\n\t\t\tthis.world = world\n\t\t\tthis._id = this.world.idCounter++\n\t\t\tthis.world.entities.set(this._id, this)\n\t\t\tthis.world.index.addEntity(this)\n\t\t}\n\t}\n\n\t/**\n\t * Removes this entity from the current world, without removing any components or data.\n\t * It can be re-attached to another world (or the same world), using the attach() method.\n\t * Note: Do not use detached entities, get() may be safe, but avoid calling other methods\n\t * Note: The ID will be reassigned, so do not rely on this\n\t *\n\t * @example\n\t * entity.detach()\n\t */\n\tdetach() {\n\t\tif (this.valid()) {\n\t\t\t// Remove from current world\n\t\t\tthis.world.index.removeEntity(this)\n\t\t\tthis.world.entities.delete(this._id)\n\t\t\tthis._id = undefined\n\t\t\tthis.world = undefined\n\t\t}\n\t}\n}\n\nexports.Entity = Entity\n", + "content": "/** @ignore */\nconst { invoke } = require('./utilities.js')\n\n/**\n * Entity class used for storing components.\n *\n * @class Entity (name)\n */\nclass Entity {\n\t/**\n\t * Do not construct an Entity yourself - use the entity() method in World instead.\n\t * Also, do not shallow/deep copy entity objects, only pass around references.\n\t *\n\t * @private\n\t *\n\t * @param {World} world - The world\n\t * @param {number} id - The identifier\n\t */\n\tconstructor(world, id) {\n\t\t/** @ignore */\n\t\tthis.world = world\n\n\t\t/** @ignore */\n\t\tthis._id = id\n\n\t\t/** @ignore */\n\t\tthis.data = {}\n\t}\n\n\t/**\n\t * Return the entity ID.\n\t *\n\t * @return {number} Integer entity ID\n\t */\n\tget id() {\n\t\treturn this._id\n\t}\n\n\t/**\n\t * ID is read-only, attempting to set it will throw an error.\n\t *\n\t * @private\n\t *\n\t * @throws {Error} Cannot set entity id\n\t */\n\tset id(id) {\n\t\tthrow new Error('Cannot set entity id')\n\t}\n\n\t/**\n\t * Returns true if the entity has ALL of the specified component names.\n\t * Additional components that the entity has, which are not specified in has(), will be ignored.\n\t * If no component names are specified, this method returns true.\n\t *\n\t * @example\n\t * if (entity.has('position', 'velocity')) {...}\n\t *\n\t * @param {...string} [components] - The component names to check for\n\t *\n\t * @return {boolean} true or false\n\t */\n\thas(...components) {\n\t\treturn components.every(name => name in this.data)\n\t}\n\n\t/**\n\t * Returns a component by name, or undefined if it doesn't exist\n\t *\n\t * @example\n\t * let position = entity.get('position')\n\t *\n\t * @param {string} component - The component name to get\n\t *\n\t * @return {Object} The component if defined, otherwise undefined\n\t */\n\tget(component) {\n\t\treturn this.data[component]\n\t}\n\n\t/**\n\t * Returns a component by name (automatically created if it doesn't exist)\n\t *\n\t * @example\n\t * let position = entity.access('position', 3, 4)\n\t *\n\t * @param {string} component - The component name to create/get\n\t * @param {...Object} [args] - The arguments to forward to create the new component, only if it doesn't exist.\n\t *\n\t * @return {Object} Always returns either the existing component, or the newly created one.\n\t */\n\taccess(component, ...args) {\n\t\tif (!this.has(component)) {\n\t\t\tthis.set(component, ...args)\n\t\t}\n\t\treturn this.data[component]\n\t}\n\n\t/**\n\t * Adds a new component, or re-creates and overwrites an existing component\n\t *\n\t * @example\n\t * entity.set('position', 1, 2)\n\t *\n\t * @example\n\t * entity.set('anonymousComponent', { keys: 'values' })\n\t *\n\t * @example\n\t * entity.set('anotherAnonymousComponent', 'Any type of any value')\n\t *\n\t * @param {string} component - The component name to create. If there is a registered component for this name, then\n\t * its constructor will be called with (entity, ...args) and an object of that type will be created. The onCreate method\n\t * gets called after the component is added to the entity. This method also gets passed the same parameters.\n\t * @param {...Object} [args] - The arguments to forward to the registered component type. If the component type is\n\t * registered, then only the first additional argument will be used as the value of the entire component.\n\t *\n\t * @return {Object} The original entity that set() was called on, so that operations can be chained.\n\t */\n\tset(component, ...args) {\n\t\tif (this.valid() && component in this.world.components) {\n\t\t\t// Create component and store in entity\n\t\t\t// Note: The entity parameter is dangerous to use, since the component hasn't been added to the entity yet\n\t\t\tthis.data[component] = new this.world.components[component](this, ...args)\n\t\t} else if (args.length > 0) {\n\t\t\t// Use first argument as component value\n\t\t\tthis.data[component] = args[0]\n\t\t} else {\n\t\t\t// Make an empty object\n\t\t\tthis.data[component] = {}\n\t\t}\n\n\t\t// Update the index with this new component\n\t\tif (this.valid()) {\n\t\t\tthis.world.index.add(this, component)\n\t\t}\n\n\t\t// Call custom onCreate to initialize component, pass the entity (this), and any additional arguments passed into set()\n\t\tinvoke(this.data[component], 'onCreate', this, ...args)\n\n\t\treturn this\n\t}\n\n\t/**\n\t * Updates component data from an object or other component. Similar to access() with a shallow merge applied after.\n\t *\n\t * @example\n\t * entity.update('position', { x: 1, y: 2 })\n\t *\n\t * @param {string} component - The component name to update\n\t * @param {Object} data - The object or other component to merge into the specified component.\n\t *\n\t * @return {Object} The original entity that update() was called on, so that operations can be chained.\n\t */\n\tupdate(component, data) {\n\t\tlet comp = this.access(component)\n\n\t\t// Shallow set keys of the component\n\t\tfor (let key in data) {\n\t\t\tcomp[key] = data[key]\n\t\t}\n\n\t\treturn this\n\t}\n\n\t/**\n\t * Removes a component from the entity - has no effect when it doesn't exist.\n\t * Can specify an onRemove() method in your component which gets called before it is removed.\n\t * If nothing is specified, then nothing will be removed. Use removeAll() to remove all components.\n\t *\n\t * @example\n\t * entity.remove('position')\n\t *\n\t * @param {...string} [components] - The component names to remove from the entity.\n\t *\n\t * @return {Object} The original entity that remove() was called on, so that operations can be chained.\n\t */\n\tremove(...components) {\n\t\tfor (let component of components) {\n\t\t\tif (component in this.data) {\n\n\t\t\t\t// Call custom onRemove\n\t\t\t\tinvoke(this.data[component], 'onRemove')\n\n\t\t\t\t// Remove from index\n\t\t\t\tif (this.valid()) {\n\t\t\t\t\tthis.world.index.remove(this, component)\n\t\t\t\t}\n\n\t\t\t\t// Remove from entity\n\t\t\t\tdelete this.data[component]\n\t\t\t}\n\t\t}\n\t\treturn this\n\t}\n\n\t// Remove all components\n\n\t/**\n\t * Removes all components from the entity.\n\t *\n\t * @example\n\t * entity.removeAll()\n\t *\n\t * @return {Object} The original entity that removeAll() was called on, so that operations can be chained.\n\t */\n\tremoveAll() {\n\t\tthis.remove(...this.components)\n\n\t\tif (this.components.length > 0) {\n\t\t\tthrow new Error('Failed to remove all components. Components must have been added during the removeAll().')\n\t\t}\n\n\t\treturn this\n\t}\n\n\t/**\n\t * Remove this entity and all of its components from the world. After an entity is destroyed, the object should be discarded,\n\t * and it is recommended to avoid re-using it.\n\t *\n\t * @example\n\t * entity.destroy()\n\t */\n\tdestroy() {\n\t\tthis.removeAll()\n\n\t\tif (this.valid()) {\n\t\t\t// Remove from world\n\t\t\tthis.world.entities.delete(this._id)\n\t\t\tthis._id = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Returns an array of component names this entity currently has.\n\t *\n\t * @return {Array} Array of component names.\n\t */\n\tget components() {\n\t\treturn Object.keys(this.data)\n\t}\n\n\t/** @ignore */\n\tset components(c) {\n\t\tthrow new Error('Cannot set components in this way. See entity.set().')\n\t}\n\n\t/**\n\t * Returns true if this is a valid, existing, and usable entity, which is attached to a world.\n\t *\n\t * @example\n\t * if (entity.valid()) {...}\n\t *\n\t * @return {boolean} true or false\n\t */\n\tvalid() {\n\t\t// Note: No need to actually look in the world for the ID, if entities are only ever copied by reference.\n\t\t// If entities are ever deep/shallow copied, this function will need to check this to be more robust.\n\t\treturn this.world && this._id !== undefined\n\t}\n\n\t/**\n\t * Returns unique entity ID as a string.\n\t *\n\t * @example\n\t * let entityId = entity.toString()\n\t *\n\t * @return {string} String representation of the entity ID.\n\t */\n\ttoString() {\n\t\treturn String(this._id)\n\t}\n\n\t/**\n\t * Serializes entire entity and components to JSON.\n\t * Note: Defining toJSON methods in your components will override the built-in behavior.\n\t *\n\t * @example\n\t * let serializedEntity = entity.toJSON()\n\t *\n\t * @return {string} JSON encoded string\n\t */\n\ttoJSON() {\n\t\treturn JSON.stringify(this.data)\n\t}\n\n\t/**\n\t * Deserializes data from JSON, creating new components and overwriting existing components.\n\t * Note: Defining fromJSON methods in your components will override the built-in behavior.\n\t *\n\t * @example\n\t * entity.fromJSON(serializedEntity)\n\t *\n\t * @param {string} data - A JSON string containing component data to parse, and store in this entity.\n\t *\n\t * @return {Object} The original entity that fromJSON() was called on, so that operations can be chained.\n\t */\n\tfromJSON(data) {\n\t\tlet parsed = JSON.parse(data)\n\t\tfor (let name in parsed) {\n\t\t\tlet comp = this.access(name)\n\n\t\t\t// Either call custom method or copy all properties\n\t\t\tif (typeof comp.fromJSON === 'function') {\n\t\t\t\tcomp.fromJSON(parsed[name])\n\t\t\t} else {\n\t\t\t\tthis.update(name, parsed[name])\n\t\t\t}\n\t\t}\n\t\treturn this\n\t}\n\n\t/**\n\t * Attaches a currently detached entity back to a world.\n\t * Note: Do not use detached entities, get() may be safe, but avoid calling other methods\n\t * Note: The ID will be reassigned, so do not rely on this\n\t *\n\t * @example\n\t * entity.attach(world)\n\t *\n\t * @param {World} world - The world to attach this entity to\n\t */\n\tattach(world) {\n\t\tif (world && !this.valid()) {\n\t\t\t// Assign new id, and reattach to world\n\t\t\tthis.world = world\n\t\t\tthis._id = this.world.idCounter++\n\t\t\tthis.world.entities.set(this._id, this)\n\t\t\tthis.world.index.add(this, ...this.components)\n\t\t}\n\t}\n\n\t/**\n\t * Removes this entity from the current world, without removing any components or data.\n\t * It can be re-attached to another world (or the same world), using the attach() method.\n\t * Note: Do not use detached entities, get() may be safe, but avoid calling other methods\n\t * Note: The ID will be reassigned, so do not rely on this\n\t *\n\t * @example\n\t * entity.detach()\n\t */\n\tdetach() {\n\t\tif (this.valid()) {\n\t\t\t// Remove from current world\n\t\t\tthis.world.index.remove(this, ...this.components)\n\t\t\tthis.world.entities.delete(this._id)\n\t\t\tthis._id = undefined\n\t\t\tthis.world = undefined\n\t\t}\n\t}\n}\n\nexports.Entity = Entity\n", "static": true, "longname": "/srv/http/picoes/src/entity.js", "access": "public", @@ -712,7 +712,7 @@ "longname": "src/entity.js~Entity#id", "access": "public", "description": "Return the entity ID.", - "lineNumber": 40, + "lineNumber": 35, "return": { "nullable": null, "types": [ @@ -738,7 +738,7 @@ "longname": "src/entity.js~Entity#id", "access": "private", "description": "ID is read-only, attempting to set it will throw an error.", - "lineNumber": 51, + "lineNumber": 46, "throws": [ { "types": [ @@ -762,7 +762,7 @@ "examples": [ "if (entity.has('position', 'velocity')) {...}" ], - "lineNumber": 67, + "lineNumber": 62, "params": [ { "nullable": null, @@ -798,7 +798,7 @@ "examples": [ "let position = entity.get('position')" ], - "lineNumber": 81, + "lineNumber": 76, "params": [ { "nullable": null, @@ -834,7 +834,7 @@ "examples": [ "let position = entity.access('position', 3, 4)" ], - "lineNumber": 96, + "lineNumber": 91, "params": [ { "nullable": null, @@ -882,7 +882,7 @@ "entity.set('anonymousComponent', { keys: 'values' })", "entity.set('anotherAnonymousComponent', 'Any type of any value')" ], - "lineNumber": 123, + "lineNumber": 118, "params": [ { "nullable": null, @@ -928,7 +928,7 @@ "examples": [ "entity.update('position', { x: 1, y: 2 })" ], - "lineNumber": 158, + "lineNumber": 153, "params": [ { "nullable": null, @@ -974,7 +974,7 @@ "examples": [ "entity.remove('position')" ], - "lineNumber": 181, + "lineNumber": 176, "params": [ { "nullable": null, @@ -1010,7 +1010,7 @@ "examples": [ "entity.removeAll()" ], - "lineNumber": 210, + "lineNumber": 205, "return": { "nullable": null, "types": [ @@ -1035,7 +1035,7 @@ "examples": [ "entity.destroy()" ], - "lineNumber": 227, + "lineNumber": 222, "params": [], "return": null }, @@ -1050,7 +1050,7 @@ "longname": "src/entity.js~Entity#components", "access": "public", "description": "Returns an array of component names this entity currently has.", - "lineNumber": 245, + "lineNumber": 237, "return": { "nullable": null, "types": [ @@ -1076,7 +1076,7 @@ "longname": "src/entity.js~Entity#components", "access": "public", "description": null, - "lineNumber": 250, + "lineNumber": 242, "ignore": true }, { @@ -1093,7 +1093,7 @@ "examples": [ "if (entity.valid()) {...}" ], - "lineNumber": 262, + "lineNumber": 254, "return": { "nullable": null, "types": [ @@ -1118,7 +1118,7 @@ "examples": [ "let entityId = entity.toString()" ], - "lineNumber": 276, + "lineNumber": 268, "return": { "nullable": null, "types": [ @@ -1143,7 +1143,7 @@ "examples": [ "let serializedEntity = entity.toJSON()" ], - "lineNumber": 289, + "lineNumber": 281, "return": { "nullable": null, "types": [ @@ -1168,7 +1168,7 @@ "examples": [ "entity.fromJSON(serializedEntity)" ], - "lineNumber": 304, + "lineNumber": 296, "params": [ { "nullable": null, @@ -1204,7 +1204,7 @@ "examples": [ "entity.attach(world)" ], - "lineNumber": 329, + "lineNumber": 321, "params": [ { "nullable": null, @@ -1233,7 +1233,7 @@ "examples": [ "entity.detach()" ], - "lineNumber": 348, + "lineNumber": 340, "params": [], "return": null }, @@ -1241,7 +1241,7 @@ "__docId__": 78, "kind": "file", "name": "src/memoized_query_index.js", - "content": "/**\n * An alternative indexer class to SimpleIndex. This has true O(1) queries (when memoized), for the cost\n * of slower component add/remove operations. As more queries are made, the slower add/remove become.\n *\n * @class MemoizedQueryIndex (name)\n */\nclass MemoizedQueryIndex {\n\tconstructor(world) {\n\t\tthis.world = world\n\t\tthis.clear()\n\t}\n\n\t// Removes everything from the index\n\tclear() {\n\t\tthis.index = {}\n\t}\n\n\t// Uses an existing index or builds a new index, to return entities with the specified components\n\t*query(...componentNames) {\n\t\t// Return all entities\n\t\tif (componentNames.length === 0) {\n\t\t\tyield* this.world.entities.values()\n\t\t\treturn\n\t\t}\n\n\t\t// Hash the component list\n\t\tlet hash = this.hashComponents(componentNames)\n\n\t\t// Return already existing index\n\t\tif (hash in this.index) {\n\t\t\tyield* this.index[hash].entities.values()\n\t\t\treturn\n\t\t}\n\n\t\t// Build new index for this component list\n\t\tyield* this.build(hash, componentNames).entities.values()\n\t}\n\n\t// Creates a hash from an array of component names\n\thashComponents(names) {\n\t\treturn JSON.stringify(names.sort())\n\t}\n\n\t// Builds an initial index for a set of components\n\t// These indexes are expected to be updated when doing entity/component operations\n\tbuild(hash, componentNames) {\n\t\tlet matchingEntities = new Map()\n\n\t\tfor (const [entityId, entity] of this.world.entities) {\n\t\t\t// Ensure entity contains all specified components\n\t\t\tif (entity.has(...componentNames)) {\n\t\t\t\t// Add entity to index\n\t\t\t\tmatchingEntities.set(entity.id, entity)\n\t\t\t}\n\t\t}\n\n\t\treturn this.index[hash] = {\n\t\t\tcomponents: new Set(componentNames),\n\t\t\tentities: matchingEntities\n\t\t}\n\t}\n\n\t// Must use all component names\n\tadd(entity) {\n\t\tfor (let hash in this.index) {\n\t\t\tconst group = this.index[hash]\n\n\t\t\t// Check if the entity has all of the components of the index group\n\t\t\tif (entity.has(...group.components)) {\n\t\t\t\t// Add the entity\n\t\t\t\tgroup.entities.set(entity.id, entity)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Add an entity and all of its components to the index\n\taddEntity(entity) {\n\t\tthis.add(entity)\n\t}\n\n\t// Remove certain components from the index for an entity\n\tremove(entity, ...componentNames) {\n\t\tfor (let hash in this.index) {\n\t\t\tconst group = this.index[hash]\n\n\t\t\t// Check if index group has any of the components that the entity has\n\t\t\tif (componentNames.some(name => group.components.has(name))) {\n\t\t\t\t// Remove the entity\n\t\t\t\tgroup.entities.delete(entity.id)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove an entity and all of its components from the index\n\tremoveEntity(entity) {\n\t\tthis.remove(entity, ...entity.components)\n\t}\n}\n\nexports.MemoizedQueryIndex = MemoizedQueryIndex\n", + "content": "/**\n * An alternative indexer class to SimpleIndex. This has true O(1) queries (when memoized), for the cost\n * of slower component add/remove operations. As more queries are made, the slower add/remove become.\n *\n * @class MemoizedQueryIndex (name)\n */\nclass MemoizedQueryIndex {\n\tconstructor(world) {\n\t\tthis.world = world\n\t\tthis.clear()\n\t}\n\n\t// Removes everything from the index\n\tclear() {\n\t\tthis.index = {}\n\t}\n\n\t// Uses an existing index or builds a new index, to return entities with the specified components\n\t*query(...componentNames) {\n\t\t// Return all entities\n\t\tif (componentNames.length === 0) {\n\t\t\tyield* this.world.entities.values()\n\t\t\treturn\n\t\t}\n\n\t\t// Hash the component list\n\t\tlet hash = this.hashComponents(componentNames)\n\n\t\t// Return already existing index\n\t\tif (hash in this.index) {\n\t\t\tyield* this.index[hash].entities.values()\n\t\t\treturn\n\t\t}\n\n\t\t// Build new index for this component list\n\t\tyield* this.build(hash, componentNames).entities.values()\n\t}\n\n\t// Creates a hash from an array of component names\n\thashComponents(names) {\n\t\treturn JSON.stringify(names.sort())\n\t}\n\n\t// Builds an initial index for a set of components\n\t// These indexes are expected to be updated when doing entity/component operations\n\tbuild(hash, componentNames) {\n\t\tlet matchingEntities = new Map()\n\n\t\tfor (const [entityId, entity] of this.world.entities) {\n\t\t\t// Ensure entity contains all specified components\n\t\t\tif (entity.has(...componentNames)) {\n\t\t\t\t// Add entity to index\n\t\t\t\tmatchingEntities.set(entity.id, entity)\n\t\t\t}\n\t\t}\n\n\t\treturn this.index[hash] = {\n\t\t\tcomponents: new Set(componentNames),\n\t\t\tentities: matchingEntities\n\t\t}\n\t}\n\n\t// Must use all component names from entity\n\tadd(entity) {\n\t\tfor (let hash in this.index) {\n\t\t\tconst group = this.index[hash]\n\n\t\t\t// Check if the entity has all of the components of the index group\n\t\t\tif (entity.has(...group.components)) {\n\t\t\t\t// Add the entity\n\t\t\t\tgroup.entities.set(entity.id, entity)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove certain components from the index for an entity\n\tremove(entity, ...componentNames) {\n\t\tfor (let hash in this.index) {\n\t\t\tconst group = this.index[hash]\n\n\t\t\t// Check if index group has any of the components that the entity has\n\t\t\tif (componentNames.some(name => group.components.has(name))) {\n\t\t\t\t// Remove the entity\n\t\t\t\tgroup.entities.delete(entity.id)\n\t\t\t}\n\t\t}\n\t}\n}\n\nexports.MemoizedQueryIndex = MemoizedQueryIndex\n", "static": true, "longname": "/srv/http/picoes/src/memoized_query_index.js", "access": "public", @@ -1443,29 +1443,6 @@ { "__docId__": 88, "kind": "method", - "name": "addEntity", - "memberof": "src/memoized_query_index.js~MemoizedQueryIndex", - "generator": false, - "async": false, - "static": false, - "longname": "src/memoized_query_index.js~MemoizedQueryIndex#addEntity", - "access": "public", - "description": null, - "lineNumber": 77, - "undocument": true, - "params": [ - { - "name": "entity", - "types": [ - "*" - ] - } - ], - "return": null - }, - { - "__docId__": 89, - "kind": "method", "name": "remove", "memberof": "src/memoized_query_index.js~MemoizedQueryIndex", "generator": false, @@ -1474,7 +1451,7 @@ "longname": "src/memoized_query_index.js~MemoizedQueryIndex#remove", "access": "public", "description": null, - "lineNumber": 82, + "lineNumber": 77, "undocument": true, "params": [ { @@ -1494,33 +1471,10 @@ "return": null }, { - "__docId__": 90, - "kind": "method", - "name": "removeEntity", - "memberof": "src/memoized_query_index.js~MemoizedQueryIndex", - "generator": false, - "async": false, - "static": false, - "longname": "src/memoized_query_index.js~MemoizedQueryIndex#removeEntity", - "access": "public", - "description": null, - "lineNumber": 95, - "undocument": true, - "params": [ - { - "name": "entity", - "types": [ - "*" - ] - } - ], - "return": null - }, - { - "__docId__": 91, + "__docId__": 89, "kind": "file", "name": "src/simple_index.js", - "content": "/**\n * @ignore\n * Returns index of smallest element\n */\nconst minIndexReducer = (minIndex, value, index, values) => (value < values[minIndex] ? index : minIndex)\n\n/**\n * The default indexer for World. Extremely fast component adding/removing, for the cost of slightly\n * slower entity querying performance.\n *\n * @class SimpleIndex (name)\n */\nclass SimpleIndex {\n\tconstructor(world) {\n\t\tthis.world = world\n\t\tthis.clear()\n\t}\n\n\t// Removes everything from the index\n\tclear() {\n\t\tthis.index = {}\n\t}\n\n\t// Returns an existing or new index\n\taccess(component) {\n\t\treturn this.index[component] || (this.index[component] = new Map())\n\t}\n\n\t// Uses an existing index or builds a new index, to return entities with the specified components\n\t*query(...componentNames) {\n\t\t// Return all entities\n\t\tif (componentNames.length === 0) {\n\t\t\tyield* this.world.entities.values()\n\t\t\treturn\n\t\t}\n\n\t\t// Get the index name with the least number of entities\n\t\tconst minCompIndex = componentNames\n\t\t\t.map(name => this.access(name).size)\n\t\t\t.reduce(minIndexReducer, 0)\n\t\tconst minComp = componentNames[minCompIndex]\n\n\t\t// Return matching entities\n\t\tfor (let entity of this.index[minComp].values()) {\n\t\t\tif (entity.has(...componentNames)) {\n\t\t\t\tyield entity\n\t\t\t}\n\t\t}\n\t}\n\n\t// Add certain components with an entity to the index\n\tadd(entity, ...componentNames) {\n\t\tfor (let component of componentNames) {\n\t\t\tthis.access(component).set(entity.id, entity)\n\t\t}\n\t}\n\n\t// TODO: Remove these from the index classes, have Entity pass whatever is needed\n\t// Add an entity and all of its components to the index\n\taddEntity(entity) {\n\t\tthis.add(entity, ...entity.components)\n\t}\n\n\t// Remove certain components from the index for an entity\n\tremove(entity, ...componentNames) {\n\t\tfor (let component of componentNames) {\n\t\t\tthis.access(component).delete(entity.id)\n\t\t}\n\t}\n\n\t// Remove an entity and all of its components from the index\n\tremoveEntity(entity) {\n\t\tthis.remove(entity, ...entity.components)\n\t}\n}\n\nexports.SimpleIndex = SimpleIndex\n", + "content": "/**\n * @ignore\n * Returns index of smallest element\n */\nconst minIndexReducer = (minIndex, value, index, values) => (value < values[minIndex] ? index : minIndex)\n\n/**\n * The default indexer for World. Extremely fast component adding/removing, for the cost of slightly\n * slower entity querying performance.\n *\n * @class SimpleIndex (name)\n */\nclass SimpleIndex {\n\tconstructor(world) {\n\t\tthis.world = world\n\t\tthis.clear()\n\t}\n\n\t// Removes everything from the index\n\tclear() {\n\t\tthis.index = {}\n\t}\n\n\t// Returns an existing or new index\n\taccess(component) {\n\t\treturn this.index[component] || (this.index[component] = new Map())\n\t}\n\n\t// Uses an existing index or builds a new index, to return entities with the specified components\n\t*query(...componentNames) {\n\t\t// Return all entities\n\t\tif (componentNames.length === 0) {\n\t\t\tyield* this.world.entities.values()\n\t\t\treturn\n\t\t}\n\n\t\t// Get the index name with the least number of entities\n\t\tconst minCompIndex = componentNames\n\t\t\t.map(name => this.access(name).size)\n\t\t\t.reduce(minIndexReducer, 0)\n\t\tconst minComp = componentNames[minCompIndex]\n\n\t\t// Return matching entities\n\t\tfor (let entity of this.index[minComp].values()) {\n\t\t\tif (entity.has(...componentNames)) {\n\t\t\t\tyield entity\n\t\t\t}\n\t\t}\n\t}\n\n\t// Add certain components with an entity to the index\n\tadd(entity, ...componentNames) {\n\t\tfor (let component of componentNames) {\n\t\t\tthis.access(component).set(entity.id, entity)\n\t\t}\n\t}\n\n\t// Remove certain components from the index for an entity\n\tremove(entity, ...componentNames) {\n\t\tfor (let component of componentNames) {\n\t\t\tthis.access(component).delete(entity.id)\n\t\t}\n\t}\n}\n\nexports.SimpleIndex = SimpleIndex\n", "static": true, "longname": "/srv/http/picoes/src/simple_index.js", "access": "public", @@ -1528,7 +1482,7 @@ "lineNumber": 1 }, { - "__docId__": 92, + "__docId__": 90, "kind": "function", "name": "minIndexReducer", "memberof": "src/simple_index.js", @@ -1572,7 +1526,7 @@ "return": null }, { - "__docId__": 93, + "__docId__": 91, "kind": "class", "name": "SimpleIndex", "memberof": "src/simple_index.js", @@ -1593,7 +1547,7 @@ "interface": false }, { - "__docId__": 94, + "__docId__": 92, "kind": "constructor", "name": "constructor", "memberof": "src/simple_index.js~SimpleIndex", @@ -1607,7 +1561,7 @@ "undocument": true }, { - "__docId__": 95, + "__docId__": 93, "kind": "member", "name": "world", "memberof": "src/simple_index.js~SimpleIndex", @@ -1624,7 +1578,7 @@ } }, { - "__docId__": 96, + "__docId__": 94, "kind": "method", "name": "clear", "memberof": "src/simple_index.js~SimpleIndex", @@ -1640,7 +1594,7 @@ "return": null }, { - "__docId__": 97, + "__docId__": 95, "kind": "member", "name": "index", "memberof": "src/simple_index.js~SimpleIndex", @@ -1657,7 +1611,7 @@ } }, { - "__docId__": 98, + "__docId__": 96, "kind": "method", "name": "access", "memberof": "src/simple_index.js~SimpleIndex", @@ -1684,7 +1638,7 @@ } }, { - "__docId__": 99, + "__docId__": 97, "kind": "method", "name": "query", "memberof": "src/simple_index.js~SimpleIndex", @@ -1708,7 +1662,7 @@ "return": null }, { - "__docId__": 100, + "__docId__": 98, "kind": "method", "name": "add", "memberof": "src/simple_index.js~SimpleIndex", @@ -1738,30 +1692,7 @@ "return": null }, { - "__docId__": 101, - "kind": "method", - "name": "addEntity", - "memberof": "src/simple_index.js~SimpleIndex", - "generator": false, - "async": false, - "static": false, - "longname": "src/simple_index.js~SimpleIndex#addEntity", - "access": "public", - "description": null, - "lineNumber": 60, - "undocument": true, - "params": [ - { - "name": "entity", - "types": [ - "*" - ] - } - ], - "return": null - }, - { - "__docId__": 102, + "__docId__": 99, "kind": "method", "name": "remove", "memberof": "src/simple_index.js~SimpleIndex", @@ -1771,7 +1702,7 @@ "longname": "src/simple_index.js~SimpleIndex#remove", "access": "public", "description": null, - "lineNumber": 65, + "lineNumber": 59, "undocument": true, "params": [ { @@ -1791,30 +1722,7 @@ "return": null }, { - "__docId__": 103, - "kind": "method", - "name": "removeEntity", - "memberof": "src/simple_index.js~SimpleIndex", - "generator": false, - "async": false, - "static": false, - "longname": "src/simple_index.js~SimpleIndex#removeEntity", - "access": "public", - "description": null, - "lineNumber": 72, - "undocument": true, - "params": [ - { - "name": "entity", - "types": [ - "*" - ] - } - ], - "return": null - }, - { - "__docId__": 104, + "__docId__": 100, "kind": "file", "name": "src/utilities.js", "content": "/**\n * Utility function for invoking methods inside objects, binding \"this\" to the object.\n *\n * @ignore\n *\n * @param {Object} object - The object\n * @param {Function} method - The method\n * @param {Array} args - The arguments\n *\n * @return {Object} Returns what the called method returns\n */\nfunction invoke(object, method, ...args) {\n\tif (object && typeof object[method] === 'function') {\n\t\treturn object[method].call(object, ...args)\n\t}\n}\n\n/**\n * Determines if function.\n *\n * @ignore\n */\nfunction isFunction(obj) {\n\treturn typeof obj === 'function'\n}\n\nexports.invoke = invoke\nexports.isFunction = isFunction\n", @@ -1825,7 +1733,7 @@ "lineNumber": 1 }, { - "__docId__": 105, + "__docId__": 101, "kind": "function", "name": "invoke", "memberof": "src/utilities.js", @@ -1882,7 +1790,7 @@ } }, { - "__docId__": 106, + "__docId__": 102, "kind": "function", "name": "isFunction", "memberof": "src/utilities.js", @@ -1912,7 +1820,7 @@ } }, { - "__docId__": 107, + "__docId__": 103, "kind": "file", "name": "src/world.js", "content": "/** @ignore */\nconst { invoke, isFunction } = require('./utilities.js')\n\n/** @ignore */\nconst { Entity } = require('./entity.js')\n\n/** @ignore */\nconst { SimpleIndex } = require('./simple_index.js')\n\n/**\n * Class for world.\n *\n * @class World (name)\n */\nclass World {\n\t/**\n\t * Constructs an instance of the world.\n\t *\n\t * @param {Function} [indexer=SimpleIndex] The indexer to use. Default is SimpleIndex. Can use MemoizedQueryIndex if better querying performance is needed, for increased component creation/removal costs.\n\t */\n\tconstructor(indexer = SimpleIndex) {\n\t\t/** @ignore */\n\t\tthis.systems = []\n\n\t\t/**\n\t\t * Maps entity IDs to entities\n\t\t * @ignore\n\t\t */\n\t\tthis.entities = new Map()\n\n\t\t/** @ignore */\n\t\tthis.components = {}\n\n\t\t/** @ignore */\n\t\tthis.entityTemplates = {}\n\n\t\t/** @ignore */\n\t\tthis.idCounter = 1\n\n\t\t/**\n\t\t * Maps entire queries to arrays of entities\n\t\t * @ignore\n\t\t */\n\t\tthis.index = new indexer(this)\n\t}\n\n\t/**\n\t * Removes all entities from the world.\n\t * Does not affect registered systems, components, or prototypes.\n\t *\n\t * @example\n\t * world.clear()\n\t */\n\tclear() {\n\t\t// Call onRemove on all components of all entities\n\t\tfor (const [entityId, entity] of this.entities) {\n\t\t\tfor (let componentName in entity.data) {\n\t\t\t\t// Get component, and call onRemove if it exists as a function\n\t\t\t\tlet component = entity.data[componentName]\n\t\t\t\tinvoke(component, 'onRemove')\n\t\t\t}\n\t\t}\n\n\t\t// Clear entities\n\t\tthis.entities = new Map()\n\t\tthis.index.clear()\n\t}\n\n\t/**\n\t * Registers a component type to the world. Components must be constructable. If the component has an onCreate(),\n\t * it is passed the entity first, then the rest of the arguments from methods like entity.set(). Also, components\n\t * can have an onRemove() method, which gets called when removing that component from an entity.\n\t *\n\t * @param {string} name - The name\n\t * @param {function} componentClass - The component class, must be a constructable class or function\n\t *\n\t * @example\n\t * world.component('myComponent', class {\n\t * // It is highly recommended to use onCreate() over constructor(), because the component\n\t * // will have already been added to the entity. In the constructor(), it is not safe to use\n\t * // \"entity\" because it does not contain the current component while still in the constructor.\n\t * onCreate(entity, some, args) {\n\t * this.entity = entity\n\t * this.some = some\n\t * this.args = args\n\t * }\n\t * })\n\t * // entity === the new entity object\n\t * // some === 10\n\t * // args === 500\n\t * world.entity().set('myComponent', 10, 500)\n\t *\n\t * @return {string} Registered component name on success, undefined on failure\n\t */\n\tcomponent(name, componentClass) {\n\t\t// Only allow functions and classes to be components\n\t\tif (isFunction(componentClass)) {\n\t\t\tthis.components[name] = componentClass\n\t\t\treturn name\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new entity in the world\n\t *\n\t * @param {string} [name] - The prototype name to use\n\t *\n\t * @example\n\t * world.entity()\n\t *\n\t * @example\n\t * world.entity('Player')\n\t *\n\t * @return {Entity} The new entity created\n\t */\n\tentity(name) {\n\t\tlet entityId = this.idCounter++\n\t\tlet entity = new Entity(this, entityId)\n\n\t\t// Use 'name' to get prototype data (if specified)\n\t\tif (name && name in this.entityTemplates) {\n\t\t\t// Add all components from prototype\n\t\t\tlet template = this.entityTemplates[name]\n\t\t\tfor (let componentName in template) {\n\t\t\t\t// Update component with data from template\n\t\t\t\tlet newComponentData = JSON.parse(template[componentName])\n\t\t\t\tentity.update(componentName, newComponentData)\n\t\t\t}\n\t\t}\n\n\t\tthis.entities.set(entityId, entity)\n\t\treturn entity\n\t}\n\n\t/**\n\t * Registers a system to the world.\n\t * The order the systems get registered, is the order then run in.\n\t *\n\t * @example\n\t * // Movement system\n\t * world.system(['position', 'velocity'], class {\n\t * constructor(context) {\n\t * // This is showing how you can optionally pass parameters to the system's constructor\n\t * this.context = context\n\t * }\n\t * every(position, velocity, entity) {\n\t * position.x += velocity.x\n\t * position.y += velocity.y\n\t * }\n\t * }, context)\n\t *\n\t * @example\n\t * // System that doesn't use every()\n\t * world.system(class {\n\t * constructor(context) {\n\t * this.context = context\n\t * }\n\t * pre() {\n\t * // Handle events or something\n\t * }\n\t * }, context)\n\t *\n\t * @param {...Object} args - Both signatures are accepted: (components, systemClass, ...args) or (systemClass, ...args).\n\t *\n\t * **[components]**: The list of components the system will process in every(). This follows the same logic as entity.has() and world.every().\n\t *\n\t * **{systemClass}**: The system class to instantiate. Can contain the following methods: constructor, initialize, pre, every, post. Pre() and post() get called before and after every(), for each of the independent systems. See world.run() for an example of the call order.\n\t *\n\t * **[...args]**: The arguments to forward to the system's constructors.\n\t *\n\t * @return {number} Unique ID of the system on success or undefined on failure\n\t */\n\tsystem(...args) {\n\t\t// Get components and systemClass from arguments\n\t\tlet components = []\n\t\tlet systemClass, rest\n\t\tif (Array.isArray(args[0])) {\n\t\t\tcomponents = args[0]\n\t\t\tsystemClass = args[1]\n\t\t\trest = args.slice(2)\n\t\t} else {\n\t\t\tsystemClass = args[0]\n\t\t\trest = args.slice(1)\n\t\t}\n\n\t\t// Make sure the system is valid\n\t\tif (isFunction(systemClass)) {\n\t\t\t// Create the system, and set the component array query\n\t\t\tlet newSystem = new systemClass(...rest)\n\t\t\tnewSystem.components = components\n\n\t\t\t// Add the system, return its ID\n\t\t\treturn this.systems.push(newSystem) - 1\n\t\t}\n\t\treturn undefined\n\t}\n\n\t/**\n\t * Calls initialize() on all systems\n\t *\n\t * @example\n\t * world.initialize(renderContext)\n\t *\n\t * @param {...Object} [args] - The arguments to forward to the systems' initialize() methods\n\t */\n\tinitialize(...args) {\n\t\tfor (let system of this.systems) {\n\t\t\tinvoke(system, 'initialize', ...args)\n\t\t}\n\t}\n\n\t/**\n\t * Calls pre(), every(), and post() on all systems\n\t *\n\t * @example\n\t * world.run(deltaTime)\n\t *\n\t * @example\n\t * // Example flow of method call order:\n\t * // Setup systems:\n\t * world.system(systemA)\n\t * world.system(systemB)\n\t * // During world.run():\n\t * // systemA.pre()\n\t * // systemA.every() * number of entities\n\t * // systemA.post()\n\t * // systemB.pre()\n\t * // systemB.every() * number of entities\n\t * // systemB.post()\n\t *\n\t * @param {...Object} [args] - The arguments to forward to the systems' methods\n\t */\n\trun(...args) {\n\t\tfor (let system of this.systems) {\n\t\t\tinvoke(system, 'pre', ...args)\n\n\t\t\t// Run the \"every\" method in the system\n\t\t\tif (isFunction(system.every)) {\n\t\t\t\tthis.every(system.components, system.every.bind(system), ...args)\n\t\t\t}\n\n\t\t\tinvoke(system, 'post', ...args)\n\t\t}\n\t}\n\n\t/**\n\t * Iterate through entities with the specified components\n\t *\n\t * @example\n\t * // Use a callback to process entities one-by-one\n\t * world.every(['comp'], comp => {comp.value = 0})\n\t *\n\t * @example\n\t * // Get an iterator for the entities\n\t * let it = world.every(['comp'])\n\t * for (let entity of it) {...}\n\t *\n\t * @param {Array} componentNames - The component names to match entites with. This checks if the entity\n\t * has ALL of the specified components, but does not check for additional components.\n\t * @param {Function} callback - The callback to call for each entity. Takes (...components, entity, ...args).\n\t * @param {...Object} [args] - Any additional arguments to pass to the callback.\n\t *\n\t * @return {MapIterator} If no callback specified, then a generator to the entities themselves. Otherwise, returns undefined.\n\t */\n\tevery(componentNames, callback, ...args) {\n\t\t// Get indexed map of entities\n\t\tlet entities = this.index.query(...componentNames)\n\n\t\tif (isFunction(callback)) {\n\t\t\t// Go through the map of entities\n\t\t\tfor (let entity of entities) {\n\n\t\t\t\t// Get all components as an array\n\t\t\t\tlet components = componentNames.map(name => entity.get(name))\n\n\t\t\t\t// Pass components, then the main entity, then any additional arguments\n\t\t\t\tlet status = callback(...components, entity, ...args)\n\n\t\t\t\t// Stop the iteration when the callback returns false\n\t\t\t\tif (status === false) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn entities\n\t\t}\n\t}\n\n\t/**\n\t * Returns an array of entities with matching components\n\t * Simplified version of every(), returns an actual array, and only takes component names as arguments.\n\t *\n\t * @example\n\t * world.get('player', 'sprite')\n\t *\n\t * @param {Array} componentNames - The component names to match on. See every() for how this matches.\n\t *\n\t * @return {Array} Array of entities, instead of iterator like every().\n\t */\n\tget(...componentNames) {\n\t\treturn [...this.every(componentNames)]\n\t}\n\n\t/**\n\t * Registers entity prototype(s). Any existing prototype names that are the same will be overwritten\n\t *\n\t * @example\n\t * world.prototype({\n\t * Movable: {\n\t * position: {},\n\t * velocity: {}\n\t * }\n\t * })\n\t *\n\t * @param {Object} data - Object structure to register as a prototype. Should be a dictionary with the top level keys\n\t * being the prototype names. Can also be a JSON formatted string.\n\t *\n\t * @return {number} Number of prototypes added.\n\t */\n\tprototype(data) {\n\t\tlet count = 0\n\n\t\t// Convert to an object when given a string\n\t\tif (typeof data === 'string') {\n\t\t\tdata = JSON.parse(data)\n\t\t}\n\n\t\t// Data must be an object at this point\n\t\tif (typeof data === 'object') {\n\t\t\t// Iterate through prototype names\n\t\t\tfor (let protoName in data) {\n\t\t\t\tlet inputObject = data[protoName]\n\t\t\t\tlet protoObject = {}\n\t\t\t\t// Iterate through component names\n\t\t\t\tfor (let compName in inputObject) {\n\t\t\t\t\t// Store strings of each component\n\t\t\t\t\tprotoObject[compName] = JSON.stringify(inputObject[compName])\n\t\t\t\t}\n\t\t\t\tthis.entityTemplates[protoName] = protoObject\n\t\t\t\t++count\n\t\t\t}\n\t\t}\n\n\t\treturn count\n\t}\n}\n\nexports.World = World\n", @@ -1923,7 +1831,7 @@ "lineNumber": 1 }, { - "__docId__": 108, + "__docId__": 104, "kind": "variable", "name": "invoke", "memberof": "src/world.js", @@ -1943,7 +1851,7 @@ } }, { - "__docId__": 109, + "__docId__": 105, "kind": "variable", "name": "Entity", "memberof": "src/world.js", @@ -1963,7 +1871,7 @@ } }, { - "__docId__": 110, + "__docId__": 106, "kind": "variable", "name": "SimpleIndex", "memberof": "src/world.js", @@ -1983,7 +1891,7 @@ } }, { - "__docId__": 111, + "__docId__": 107, "kind": "class", "name": "World", "memberof": "src/world.js", @@ -2004,7 +1912,7 @@ "interface": false }, { - "__docId__": 112, + "__docId__": 108, "kind": "constructor", "name": "constructor", "memberof": "src/world.js~World", @@ -2031,7 +1939,7 @@ ] }, { - "__docId__": 113, + "__docId__": 109, "kind": "member", "name": "systems", "memberof": "src/world.js~World", @@ -2048,7 +1956,7 @@ } }, { - "__docId__": 114, + "__docId__": 110, "kind": "member", "name": "entities", "memberof": "src/world.js~World", @@ -2065,7 +1973,7 @@ } }, { - "__docId__": 115, + "__docId__": 111, "kind": "member", "name": "components", "memberof": "src/world.js~World", @@ -2082,7 +1990,7 @@ } }, { - "__docId__": 116, + "__docId__": 112, "kind": "member", "name": "entityTemplates", "memberof": "src/world.js~World", @@ -2099,7 +2007,7 @@ } }, { - "__docId__": 117, + "__docId__": 113, "kind": "member", "name": "idCounter", "memberof": "src/world.js~World", @@ -2116,7 +2024,7 @@ } }, { - "__docId__": 118, + "__docId__": 114, "kind": "member", "name": "index", "memberof": "src/world.js~World", @@ -2133,7 +2041,7 @@ } }, { - "__docId__": 119, + "__docId__": 115, "kind": "method", "name": "clear", "memberof": "src/world.js~World", @@ -2151,7 +2059,7 @@ "return": null }, { - "__docId__": 121, + "__docId__": 117, "kind": "method", "name": "component", "memberof": "src/world.js~World", @@ -2197,7 +2105,7 @@ } }, { - "__docId__": 122, + "__docId__": 118, "kind": "method", "name": "entity", "memberof": "src/world.js~World", @@ -2234,7 +2142,7 @@ } }, { - "__docId__": 123, + "__docId__": 119, "kind": "method", "name": "system", "memberof": "src/world.js~World", @@ -2271,7 +2179,7 @@ } }, { - "__docId__": 124, + "__docId__": 120, "kind": "method", "name": "initialize", "memberof": "src/world.js~World", @@ -2300,7 +2208,7 @@ "return": null }, { - "__docId__": 125, + "__docId__": 121, "kind": "method", "name": "run", "memberof": "src/world.js~World", @@ -2330,7 +2238,7 @@ "return": null }, { - "__docId__": 126, + "__docId__": 122, "kind": "method", "name": "every", "memberof": "src/world.js~World", @@ -2387,7 +2295,7 @@ } }, { - "__docId__": 127, + "__docId__": 123, "kind": "method", "name": "get", "memberof": "src/world.js~World", @@ -2423,7 +2331,7 @@ } }, { - "__docId__": 128, + "__docId__": 124, "kind": "method", "name": "prototype", "memberof": "src/world.js~World", @@ -2460,7 +2368,7 @@ }, { "kind": "index", - "content": "# PicoES\n\n[![Build Status](https://travis-ci.org/ayebear/picoes.svg?branch=master)](https://travis-ci.org/ayebear/picoes)\n\n### Table Of Contents\n\n* [About](#about)\n\t* [Features](#features)\n\t* [Terminology](#terminology)\n\t* [License](#license)\n\t* [Author](#author)\n* [Instructions](#instructions)\n\t* [Setup](#setup)\n\t* [Documentation](#documentation)\n\t* [Examples](#examples)\n\n## About\n\nPico Entity System for JavaScript (ES6+).\n\nRead up on what an ECS is here: [https://en.wikipedia.org/wiki/Entity_component_system](https://en.wikipedia.org/wiki/Entity_component_system)\n\nThis entity system is designed to be as simple as possible, while still having useful features.\n\n### Features\n\n* High performance, memoized entity queries\n\t* O(1) average time\n* All definitions are optional\n\t* Can create components and entities in a world and query on them, without needing to define structured systems and components\n* Strings as component keys\n\t* No need to manually track component keys like many libraries\n* JSON serialization\n\t* Useful for save data and networked applications\n* Prototypes\n\t* Allows entity definitions to be data-driven, outside of code\n\n### Terminology\n\n* **Component:** Holds some related data\n\t* Example: Position, Velocity, Health\n* **Entity:** Refers to a collection of components\n\t* Example: Position + Health could represent a player\n* **Prototype:** A template of components used for creating entities\n\t* Example: Player could contain Position, Velocity, and Health\n* **System:** Logic loop that processes entities\n\t* Example: Movement system which handles positions and velocities\n* **World:** Lets you register components, systems, and prototypes in a self-contained object - which avoids the use of singletons. This is also where you can create entities from.\n\n### License\n\nMIT\n\n### Author\n\nEric Hebert\n\n## Instructions\n\n### Setup\n\nYou'll normally want to install PicoES as a dev dependency, and have it transpiled into the build of your application.\n\n```bash\nnpm i -D picoes\n```\n\n### Documentation\n\n[PicoES Documentation](http://ayebear.com/picoes)\n\n### Examples\n\n#### Shorthand anonymous components and systems\n\n```javascript\n// import { World } from 'picoes'\nconst { World } = require('picoes')\n\n// Create a world to store entities in\nlet world = new World()\n\n// Create player with anonymous health component\nlet player = world.entity().set('health', { value: 100 })\n\n// Create enemies\nworld.entity().set('damages', 10)\nworld.entity().set('damages', 30)\n\n// Apply damage\nworld.every(['damages'], amount => {\n\tplayer.get('health').value -= amount\n})\n\n// Player now has reduced health\nconsole.assert(player.get('health').value === 60)\n```\n\n#### Full component and system definitions\n\n```javascript\n// import { World } from 'picoes'\nconst { World } = require('picoes')\n\n// Create a world to store entities in\nlet world = new World()\n\n// Define position and velocity components\nworld.component('position', class {\n\tonCreate(entity, x = 0, y = 0) {\n\t\tthis.x = x\n\t\tthis.y = y\n\t}\n})\n\nworld.component('velocity', class {\n\tonCreate(entity, x = 0, y = 0) {\n\t\tthis.x = x\n\t\tthis.y = y\n\t}\n})\n\n// Create movable prototype\nworld.prototype({\n\tMovable: {\n\t\tposition: {},\n\t\tvelocity: {}\n\t}\n})\n\n// Define movement system\n// Note: All system methods are optional, but they are included here to show the flow\nworld.system(['position', 'velocity'], class {\n\tconstructor() {\n\t\tconsole.log('constructor() called')\n\t}\n\n\tinitialize() {\n\t\tconsole.log('initialize() called')\n\t}\n\n\tpre() {\n\t\tconsole.log('pre() called')\n\t}\n\n\tevery(position, velocity, entity) {\n\t\tconsole.log(`every() called for entity ${entity.id}`)\n\t\tposition.x += velocity.x\n\t\tposition.y += velocity.y\n\t}\n\n\tpost() {\n\t\tconsole.log('post() called')\n\t}\n})\n\n// Create entity without prototype\nlet entityA = world.entity().set('position').set('velocity')\nconsole.assert(entityA.has('position'))\nconsole.assert(entityA.has('velocity'))\n\n// Create entity with prototype (results are the same as above)\nlet entityB = world.entity('Movable')\nconsole.assert(entityB.has('position'))\nconsole.assert(entityB.has('velocity'))\n\n// This will re-create the component using the constructor\nentityB.set('position', 100, 100)\n\n// This set a property in the existing component\nentityA.get('position').x = 100\n\n// Set velocities by using update()\nentityA.update('velocity', { x: 10, y: 10 })\nentityB.update('velocity', { x: -10, y: -10 })\n\n// Initialize systems\nworld.initialize()\n\n// Run systems\nworld.run()\n\n// Since the movement system ran once, the positions changed by the amount of their velocity\nconsole.assert(entityA.get('position').x === 110)\nconsole.assert(entityA.get('position').y === 10)\nconsole.assert(entityB.get('position').x === 90)\nconsole.assert(entityB.get('position').y === 90)\n```\n\nExpected output:\n\n```\nconstructor() called\ninitialize() called\npre() called\nevery() called for entity 1\nevery() called for entity 2\npost() called\n```\n", + "content": "# PicoES\n\n[![Build Status](https://travis-ci.org/ayebear/picoes.svg?branch=master)](https://travis-ci.org/ayebear/picoes)\n\n### Table Of Contents\n\n* [About](#about)\n\t* [Features](#features)\n\t* [Terminology](#terminology)\n\t* [License](#license)\n\t* [Author](#author)\n* [Instructions](#instructions)\n\t* [Setup](#setup)\n\t* [Documentation](#documentation)\n\t* [Examples](#examples)\n\n## About\n\nPico Entity System for JavaScript (ES6+).\n\nRead up on what an ECS is here: [https://en.wikipedia.org/wiki/Entity_component_system](https://en.wikipedia.org/wiki/Entity_component_system)\n\nThis entity system is designed to be as simple as possible, while still having useful features.\n\n### Features\n\n* **High performance indexing options**\n\t* SimpleIndex (Default): O(1) component add/remove, O(m) query time\n\t\t* Where `m` is the smallest size component index\n\t* MemoizedQueryIndex: O(q) component add/remove, O(1) average query time (memoized), O(n) worst query time (initial)\n\t\t* Where `q` is the total number of memoized queries\n\t\t* And `n` is the total number of entities\n\t* *Note: Above time complexities are amortized assuming the number of components used is a known constant*\n\t* Can also write your own and pass it to the World constructor! Needs clear, add, remove, and query.\n* **No formal declarations required**\n\t* Can create components and entities in a world and query on them, without needing to define structured systems and components\n* **Strings as component keys**\n\t* No need to manually track component keys like many libraries\n* **JSON serialization**\n\t* Useful for save data and networked applications\n* **Prototypes**\n\t* Allows entity definitions to be data-driven, outside of code\n\n### Terminology\n\n* **Component:** Holds some related data\n\t* Example: Position, Velocity, Health\n* **Entity:** Refers to a collection of components\n\t* Example: Position + Health could represent a player\n* **Prototype:** A template of components used for creating entities\n\t* Example: Player could contain Position, Velocity, and Health\n* **System:** Logic loop that processes entities\n\t* Example: Movement system which handles positions and velocities\n* **World:** Lets you register components, systems, and prototypes in a self-contained object - which avoids the use of singletons. This is also where you can create entities from.\n\n### License\n\nMIT\n\n### Author\n\nEric Hebert\n\n## Instructions\n\n### Setup\n\nYou'll normally want to install PicoES as a dev dependency, and have it transpiled into the build of your application.\n\n```bash\nnpm i -D picoes\n```\n\n### Documentation\n\n[PicoES Documentation](http://ayebear.com/picoes)\n\n### Examples\n\n#### Shorthand anonymous components and systems\n\n```javascript\n// import { World } from 'picoes'\nconst { World } = require('picoes')\n\n// Create a world to store entities in\nlet world = new World()\n\n// Create player with anonymous health component\nlet player = world.entity().set('health', { value: 100 })\n\n// Create enemies\nworld.entity().set('damages', 10)\nworld.entity().set('damages', 30)\n\n// Apply damage\nworld.every(['damages'], amount => {\n\tplayer.get('health').value -= amount\n})\n\n// Player now has reduced health\nconsole.assert(player.get('health').value === 60)\n```\n\n#### Full component and system definitions\n\n```javascript\n// import { World } from 'picoes'\nconst { World } = require('picoes')\n\n// Create a world to store entities in\nlet world = new World()\n\n// Define position and velocity components\nworld.component('position', class {\n\tonCreate(entity, x = 0, y = 0) {\n\t\tthis.x = x\n\t\tthis.y = y\n\t}\n})\n\nworld.component('velocity', class {\n\tonCreate(entity, x = 0, y = 0) {\n\t\tthis.x = x\n\t\tthis.y = y\n\t}\n})\n\n// Create movable prototype\nworld.prototype({\n\tMovable: {\n\t\tposition: {},\n\t\tvelocity: {}\n\t}\n})\n\n// Define movement system\n// Note: All system methods are optional, but they are included here to show the flow\nworld.system(['position', 'velocity'], class {\n\tconstructor() {\n\t\tconsole.log('constructor() called')\n\t}\n\n\tinitialize() {\n\t\tconsole.log('initialize() called')\n\t}\n\n\tpre() {\n\t\tconsole.log('pre() called')\n\t}\n\n\tevery(position, velocity, entity) {\n\t\tconsole.log(`every() called for entity ${entity.id}`)\n\t\tposition.x += velocity.x\n\t\tposition.y += velocity.y\n\t}\n\n\tpost() {\n\t\tconsole.log('post() called')\n\t}\n})\n\n// Create entity without prototype\nlet entityA = world.entity().set('position').set('velocity')\nconsole.assert(entityA.has('position'))\nconsole.assert(entityA.has('velocity'))\n\n// Create entity with prototype (results are the same as above)\nlet entityB = world.entity('Movable')\nconsole.assert(entityB.has('position'))\nconsole.assert(entityB.has('velocity'))\n\n// This will re-create the component using the constructor\nentityB.set('position', 100, 100)\n\n// This set a property in the existing component\nentityA.get('position').x = 100\n\n// Set velocities by using update()\nentityA.update('velocity', { x: 10, y: 10 })\nentityB.update('velocity', { x: -10, y: -10 })\n\n// Initialize systems\nworld.initialize()\n\n// Run systems\nworld.run()\n\n// Since the movement system ran once, the positions changed by the amount of their velocity\nconsole.assert(entityA.get('position').x === 110)\nconsole.assert(entityA.get('position').y === 10)\nconsole.assert(entityB.get('position').x === 90)\nconsole.assert(entityB.get('position').y === 90)\n```\n\nExpected output:\n\n```\nconstructor() called\ninitialize() called\npre() called\nevery() called for entity 1\nevery() called for entity 2\npost() called\n```\n", "longname": "/srv/http/picoes/README.md", "name": "./README.md", "static": true, diff --git a/docs/script/search_index.js b/docs/script/search_index.js index 4b0286f..2845a4f 100644 --- a/docs/script/search_index.js +++ b/docs/script/search_index.js @@ -367,13 +367,13 @@ window.esdocSearchIndex = [ ], [ "src/entity.js~entity#id", - "class/src/entity.js~Entity.html#instance-set-id", + "class/src/entity.js~Entity.html#instance-get-id", "src/entity.js~Entity#id", "member" ], [ "src/entity.js~entity#id", - "class/src/entity.js~Entity.html#instance-get-id", + "class/src/entity.js~Entity.html#instance-set-id", "src/entity.js~Entity#id", "member" ], @@ -431,12 +431,6 @@ window.esdocSearchIndex = [ "src/memoized_query_index.js~MemoizedQueryIndex#add", "method" ], - [ - "src/memoized_query_index.js~memoizedqueryindex#addentity", - "class/src/memoized_query_index.js~MemoizedQueryIndex.html#instance-method-addEntity", - "src/memoized_query_index.js~MemoizedQueryIndex#addEntity", - "method" - ], [ "src/memoized_query_index.js~memoizedqueryindex#build", "class/src/memoized_query_index.js~MemoizedQueryIndex.html#instance-method-build", @@ -479,12 +473,6 @@ window.esdocSearchIndex = [ "src/memoized_query_index.js~MemoizedQueryIndex#remove", "method" ], - [ - "src/memoized_query_index.js~memoizedqueryindex#removeentity", - "class/src/memoized_query_index.js~MemoizedQueryIndex.html#instance-method-removeEntity", - "src/memoized_query_index.js~MemoizedQueryIndex#removeEntity", - "method" - ], [ "src/memoized_query_index.js~memoizedqueryindex#world", "class/src/memoized_query_index.js~MemoizedQueryIndex.html#instance-member-world", @@ -509,12 +497,6 @@ window.esdocSearchIndex = [ "src/simple_index.js~SimpleIndex#add", "method" ], - [ - "src/simple_index.js~simpleindex#addentity", - "class/src/simple_index.js~SimpleIndex.html#instance-method-addEntity", - "src/simple_index.js~SimpleIndex#addEntity", - "method" - ], [ "src/simple_index.js~simpleindex#clear", "class/src/simple_index.js~SimpleIndex.html#instance-method-clear", @@ -545,12 +527,6 @@ window.esdocSearchIndex = [ "src/simple_index.js~SimpleIndex#remove", "method" ], - [ - "src/simple_index.js~simpleindex#removeentity", - "class/src/simple_index.js~SimpleIndex.html#instance-method-removeEntity", - "src/simple_index.js~SimpleIndex#removeEntity", - "method" - ], [ "src/simple_index.js~simpleindex#world", "class/src/simple_index.js~SimpleIndex.html#instance-member-world", diff --git a/docs/source.html b/docs/source.html index d656b41..fbdad14 100644 --- a/docs/source.html +++ b/docs/source.html @@ -37,7 +37,7 @@ -

              Source 49/70

              +

              Source 49/66

              @@ -56,25 +56,25 @@ - - - + + + - + - - - - + + + + - + - - - - + + + + diff --git a/src/entity.js b/src/entity.js index b3c7d5b..26c9fb8 100644 --- a/src/entity.js +++ b/src/entity.js @@ -25,11 +25,6 @@ class Entity { /** @ignore */ this.data = {} - - // Add to the index, to update match all index - if (this.valid()) { - this.world.index.addEntity(this) - } } /** @@ -228,9 +223,6 @@ class Entity { this.removeAll() if (this.valid()) { - // Remove entity from the index, to update match all index - this.world.index.removeEntity(this) - // Remove from world this.world.entities.delete(this._id) this._id = undefined @@ -332,7 +324,7 @@ class Entity { this.world = world this._id = this.world.idCounter++ this.world.entities.set(this._id, this) - this.world.index.addEntity(this) + this.world.index.add(this, ...this.components) } } @@ -348,7 +340,7 @@ class Entity { detach() { if (this.valid()) { // Remove from current world - this.world.index.removeEntity(this) + this.world.index.remove(this, ...this.components) this.world.entities.delete(this._id) this._id = undefined this.world = undefined diff --git a/src/memoized_query_index.js b/src/memoized_query_index.js index 9ff0a66..0ad676e 100644 --- a/src/memoized_query_index.js +++ b/src/memoized_query_index.js @@ -60,7 +60,7 @@ class MemoizedQueryIndex { } } - // Must use all component names + // Must use all component names from entity add(entity) { for (let hash in this.index) { const group = this.index[hash] @@ -73,11 +73,6 @@ class MemoizedQueryIndex { } } - // Add an entity and all of its components to the index - addEntity(entity) { - this.add(entity) - } - // Remove certain components from the index for an entity remove(entity, ...componentNames) { for (let hash in this.index) { @@ -90,11 +85,6 @@ class MemoizedQueryIndex { } } } - - // Remove an entity and all of its components from the index - removeEntity(entity) { - this.remove(entity, ...entity.components) - } } exports.MemoizedQueryIndex = MemoizedQueryIndex diff --git a/src/simple_index.js b/src/simple_index.js index aafb1ec..c93f16d 100644 --- a/src/simple_index.js +++ b/src/simple_index.js @@ -55,23 +55,12 @@ class SimpleIndex { } } - // TODO: Remove these from the index classes, have Entity pass whatever is needed - // Add an entity and all of its components to the index - addEntity(entity) { - this.add(entity, ...entity.components) - } - // Remove certain components from the index for an entity remove(entity, ...componentNames) { for (let component of componentNames) { this.access(component).delete(entity.id) } } - - // Remove an entity and all of its components from the index - removeEntity(entity) { - this.remove(entity, ...entity.components) - } } exports.SimpleIndex = SimpleIndex
              src/entity.js Entity 100 %24/249906 byte3592018-04-01 23:19:36 (UTC)9720 byte3512018-04-03 00:20:44 (UTC)
              src/memoized_query_index.jssrc/memoized_query_index.js MemoizedQueryIndex8 %1/122606 byte1002018-04-02 02:59:12 (UTC)10 %1/102383 byte902018-04-03 00:23:38 (UTC)
              src/simple_index.jssrc/simple_index.js SimpleIndex16 %2/121994 byte772018-04-02 02:59:51 (UTC)20 %2/101654 byte662018-04-03 00:20:55 (UTC)
              src/utilities.js