UNPKG

oxygen-core

Version:

Oxygen game engine (Xenon Core for browsers)

1,416 lines (1,415 loc) 324 kB
{ "type": "File", "start": 0, "end": 1815, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 87, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 1815, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 87, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 49, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 49 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 12, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 12 } }, "local": { "type": "Identifier", "start": 7, "end": 12, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 12 }, "identifierName": "Asset" }, "name": "Asset" } } ], "source": { "type": "StringLiteral", "start": 18, "end": 48, "loc": { "start": { "line": 1, "column": 18 }, "end": { "line": 1, "column": 48 } }, "extra": { "rawValue": "../systems/AssetSystem/Asset", "raw": "'../systems/AssetSystem/Asset'" }, "value": "../systems/AssetSystem/Asset" }, "trailingComments": [ { "type": "CommentBlock", "value": "*\r\n * Atlas asset loader.\r\n ", "start": 53, "end": 85, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 5, "column": 3 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 87, "end": 1813, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 86, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 102, "end": 1813, "loc": { "start": { "line": 6, "column": 15 }, "end": { "line": 86, "column": 1 } }, "id": { "type": "Identifier", "start": 108, "end": 118, "loc": { "start": { "line": 6, "column": 21 }, "end": { "line": 6, "column": 31 }, "identifierName": "AtlasAsset" }, "name": "AtlasAsset", "leadingComments": null }, "superClass": { "type": "Identifier", "start": 127, "end": 132, "loc": { "start": { "line": 6, "column": 40 }, "end": { "line": 6, "column": 45 }, "identifierName": "Asset" }, "name": "Asset" }, "body": { "type": "ClassBody", "start": 133, "end": 1813, "loc": { "start": { "line": 6, "column": 46 }, "end": { "line": 86, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 355, "end": 422, "loc": { "start": { "line": 18, "column": 2 }, "end": { "line": 20, "column": 3 } }, "static": true, "computed": false, "key": { "type": "Identifier", "start": 362, "end": 369, "loc": { "start": { "line": 18, "column": 9 }, "end": { "line": 18, "column": 16 }, "identifierName": "factory" }, "name": "factory" }, "kind": "method", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "RestElement", "start": 370, "end": 377, "loc": { "start": { "line": 18, "column": 17 }, "end": { "line": 18, "column": 24 } }, "argument": { "type": "Identifier", "start": 373, "end": 377, "loc": { "start": { "line": 18, "column": 20 }, "end": { "line": 18, "column": 24 }, "identifierName": "args" }, "name": "args" } } ], "body": { "type": "BlockStatement", "start": 379, "end": 422, "loc": { "start": { "line": 18, "column": 26 }, "end": { "line": 20, "column": 3 } }, "body": [ { "type": "ReturnStatement", "start": 386, "end": 417, "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 19, "column": 35 } }, "argument": { "type": "NewExpression", "start": 393, "end": 416, "loc": { "start": { "line": 19, "column": 11 }, "end": { "line": 19, "column": 34 } }, "callee": { "type": "Identifier", "start": 397, "end": 407, "loc": { "start": { "line": 19, "column": 15 }, "end": { "line": 19, "column": 25 }, "identifierName": "AtlasAsset" }, "name": "AtlasAsset" }, "arguments": [ { "type": "SpreadElement", "start": 408, "end": 415, "loc": { "start": { "line": 19, "column": 26 }, "end": { "line": 19, "column": 33 } }, "argument": { "type": "Identifier", "start": 411, "end": 415, "loc": { "start": { "line": 19, "column": 29 }, "end": { "line": 19, "column": 33 }, "identifierName": "args" }, "name": "args" } } ] } } ], "directives": [], "trailingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "*\r\n * Asset factory.\r\n *\r\n * @param {*}\targs - Factory parameters.\r\n *\r\n * @return {AtlasAsset} Asset instance.\r\n *\r\n * @example\r\n * system.registerProtocol('atlas', AtlasAsset.factory);\r\n ", "start": 140, "end": 351, "loc": { "start": { "line": 8, "column": 2 }, "end": { "line": 17, "column": 5 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\r\n * @override\r\n ", "start": 428, "end": 454, "loc": { "start": { "line": 22, "column": 2 }, "end": { "line": 24, "column": 5 } } } ] }, { "type": "ClassMethod", "start": 458, "end": 573, "loc": { "start": { "line": 25, "column": 2 }, "end": { "line": 30, "column": 3 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 458, "end": 469, "loc": { "start": { "line": 25, "column": 2 }, "end": { "line": 25, "column": 13 }, "identifierName": "constructor" }, "name": "constructor", "leadingComments": null }, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "RestElement", "start": 470, "end": 477, "loc": { "start": { "line": 25, "column": 14 }, "end": { "line": 25, "column": 21 } }, "argument": { "type": "Identifier", "start": 473, "end": 477, "loc": { "start": { "line": 25, "column": 17 }, "end": { "line": 25, "column": 21 }, "identifierName": "args" }, "name": "args" } } ], "body": { "type": "BlockStatement", "start": 479, "end": 573, "loc": { "start": { "line": 25, "column": 23 }, "end": { "line": 30, "column": 3 } }, "body": [ { "type": "ExpressionStatement", "start": 486, "end": 501, "loc": { "start": { "line": 26, "column": 4 }, "end": { "line": 26, "column": 19 } }, "expression": { "type": "CallExpression", "start": 486, "end": 500, "loc": { "start": { "line": 26, "column": 4 }, "end": { "line": 26, "column": 18 } }, "callee": { "type": "Super", "start": 486, "end": 491, "loc": { "start": { "line": 26, "column": 4 }, "end": { "line": 26, "column": 9 } } }, "arguments": [ { "type": "SpreadElement", "start": 492, "end": 499, "loc": { "start": { "line": 26, "column": 10 }, "end": { "line": 26, "column": 17 } }, "argument": { "type": "Identifier", "start": 495, "end": 499, "loc": { "start": { "line": 26, "column": 13 }, "end": { "line": 26, "column": 17 }, "identifierName": "args" }, "name": "args" } } ] } }, { "type": "ExpressionStatement", "start": 509, "end": 538, "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 28, "column": 33 } }, "expression": { "type": "AssignmentExpression", "start": 509, "end": 537, "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 28, "column": 32 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 509, "end": 530, "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 28, "column": 25 } }, "object": { "type": "ThisExpression", "start": 509, "end": 513, "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 28, "column": 8 } } }, "property": { "type": "Identifier", "start": 514, "end": 530, "loc": { "start": { "line": 28, "column": 9 }, "end": { "line": 28, "column": 25 }, "identifierName": "_descriptorAsset" }, "name": "_descriptorAsset" }, "computed": false }, "right": { "type": "NullLiteral", "start": 533, "end": 537, "loc": { "start": { "line": 28, "column": 28 }, "end": { "line": 28, "column": 32 } } } } }, { "type": "ExpressionStatement", "start": 544, "end": 568, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 28 } }, "expression": { "type": "AssignmentExpression", "start": 544, "end": 567, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 27 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 544, "end": 560, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 20 } }, "object": { "type": "ThisExpression", "start": 544, "end": 548, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 8 } } }, "property": { "type": "Identifier", "start": 549, "end": 560, "loc": { "start": { "line": 29, "column": 9 }, "end": { "line": 29, "column": 20 }, "identifierName": "_imageAsset" }, "name": "_imageAsset" }, "computed": false }, "right": { "type": "NullLiteral", "start": 563, "end": 567, "loc": { "start": { "line": 29, "column": 23 }, "end": { "line": 29, "column": 27 } } } } } ], "directives": [], "trailingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "*\r\n * @override\r\n ", "start": 428, "end": 454, "loc": { "start": { "line": 22, "column": 2 }, "end": { "line": 24, "column": 5 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\r\n * @override\r\n ", "start": 579, "end": 605, "loc": { "start": { "line": 32, "column": 2 }, "end": { "line": 34, "column": 5 } } } ] }, { "type": "ClassMethod", "start": 609, "end": 907, "loc": { "start": { "line": 35, "column": 2 }, "end": { "line": 49, "column": 3 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 609, "end": 616, "loc": { "start": { "line": 35, "column": 2 }, "end": { "line": 35, "column": 9 }, "identifierName": "dispose" }, "name": "dispose", "leadingComments": null }, "kind": "method", "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 619, "end": 907, "loc": { "start": { "line": 35, "column": 12 }, "end": { "line": 49, "column": 3 } }, "body": [ { "type": "ExpressionStatement", "start": 626, "end": 642, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 20 } }, "expression": { "type": "CallExpression", "start": 626, "end": 641, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 19 } }, "callee": { "type": "MemberExpression", "start": 626, "end": 639, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 17 } }, "object": { "type": "Super", "start": 626, "end": 631, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 9 } } }, "property": { "type": "Identifier", "start": 632, "end": 639, "loc": { "start": { "line": 36, "column": 10 }, "end": { "line": 36, "column": 17 }, "identifierName": "dispose" }, "name": "dispose" }, "computed": false }, "arguments": [] } }, { "type": "VariableDeclaration", "start": 650, "end": 697, "loc": { "start": { "line": 38, "column": 4 }, "end": { "line": 38, "column": 51 } }, "declarations": [ { "type": "VariableDeclarator", "start": 656, "end": 696, "loc": { "start": { "line": 38, "column": 10 }, "end": { "line": 38, "column": 50 } }, "id": { "type": "ObjectPattern", "start": 656, "end": 689, "loc": { "start": { "line": 38, "column": 10 }, "end": { "line": 38, "column": 43 } }, "properties": [ { "type": "ObjectProperty", "start": 658, "end": 674, "loc": { "start": { "line": 38, "column": 12 }, "end": { "line": 38, "column": 28 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 658, "end": 674, "loc": { "start": { "line": 38, "column": 12 }, "end": { "line": 38, "column": 28 }, "identifierName": "_descriptorAsset" }, "name": "_descriptorAsset" }, "value": { "type": "Identifier", "start": 658, "end": 674, "loc": { "start": { "line": 38, "column": 12 }, "end": { "line": 38, "column": 28 }, "identifierName": "_descriptorAsset" }, "name": "_descriptorAsset" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 676, "end": 687, "loc": { "start": { "line": 38, "column": 30 }, "end": { "line": 38, "column": 41 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 676, "end": 687, "loc": { "start": { "line": 38, "column": 30 }, "end": { "line": 38, "column": 41 }, "identifierName": "_imageAsset" }, "name": "_imageAsset" }, "value": { "type": "Identifier", "start": 676, "end": 687, "loc": { "start": { "line": 38, "column": 30 }, "end": { "line": 38, "column": 41 }, "identifierName": "_imageAsset" }, "name": "_imageAsset" }, "extra": { "shorthand": true } } ] }, "init": { "type": "ThisExpression", "start": 692, "end": 696, "loc": { "start": { "line": 38, "column": 46 }, "end": { "line": 38, "column": 50 } } } } ], "kind": "const" }, { "type": "IfStatement", "start": 705, "end": 772, "loc": { "start": { "line": 40, "column": 4 }, "end": { "line": 42, "column": 5 } }, "test": { "type": "UnaryExpression", "start": 709, "end": 727, "loc": { "start": { "line": 40, "column": 8 }, "end": { "line": 40, "column": 26 } }, "operator": "!", "prefix": true, "argument": { "type": "UnaryExpression", "start": 710, "end": 727, "loc": { "start": { "line": 40, "column": 9 }, "end": { "line": 40, "column": 26 } }, "operator": "!", "prefix": true, "argument": { "type": "Identifier", "start": 711, "end": 727, "loc": { "start": { "line": 40, "column": 10 }, "end": { "line": 40, "column": 26 }, "identifierName": "_descriptorAsset" }, "name": "_descriptorAsset" }, "extra": { "parenthesizedArgument": false } }, "extra": { "parenthesizedArgument": false } }, "consequent": { "type": "BlockStatement", "start": 729, "end": 772, "loc": { "start": { "line": 40, "column": 28 }, "end": { "line": 42, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 738, "end": 765, "loc": { "start": { "line": 41, "column": 6 }, "end": { "line": 41, "column": 33 } }, "expression": { "type": "CallExpression", "start": 738, "end": 764, "loc": { "start": { "line": 41, "column": 6 }, "end": { "line": 41, "column": 32 } }, "callee": { "type": "MemberExpression", "start": 738, "end": 762, "loc": { "start": { "line": 41, "column": 6 }, "end": { "line": 41, "column": 30 } }, "object": { "type": "Identifier", "start": 738, "end": 754, "loc": { "start": { "line": 41, "column": 6 }, "end": { "line": 41, "column": 22 }, "identifierName": "_descriptorAsset" }, "name": "_descriptorAsset" }, "property": { "type": "Identifier", "start": 755, "end": 762, "loc": { "start": { "line": 41, "column": 23 }, "end": { "line": 41, "column": 30 }, "identifierName": "dispose" }, "name": "dispose" }, "computed": false }, "arguments": [] } } ], "directives": [] }, "alternate": null }, { "type": "IfStatement", "start": 778, "end": 835, "loc": { "start": { "line": 43, "column": 4 }, "end": { "line": 45, "column": 5 } }, "test": { "type": "UnaryExpression", "start": 782, "end": 795, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 21 } }, "operator": "!", "prefix": true, "argument": { "type": "UnaryExpression", "start": 783, "end": 795, "loc": { "start": { "line": 43, "column": 9 }, "end": { "line": 43, "column": 21 } }, "operator": "!", "prefix": true, "argument": { "type": "Identifier", "start": 784, "end": 795, "loc": { "start": { "line": 43, "column": 10 }, "end": { "line": 43, "column": 21 }, "identifierName": "_imageAsset" }, "name": "_imageAsset" }, "extra": { "parenthesizedArgument": false } }, "extra": { "parenthesizedArgument": false } }, "consequent": { "type": "BlockStatement", "start": 797, "end": 835, "loc": { "start": { "line": 43, "column": 23 }, "end": { "line": 45, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 806, "end": 828, "loc": { "start": { "line": 44, "column": 6 }, "end": { "line": 44, "column": 28 } }, "expression": { "type": "CallExpression", "start": 806, "end": 827, "loc": { "start": { "line": 44, "column": 6 }, "end": { "line": 44, "column": 27 } }, "callee": { "type": "MemberExpression", "start": 806, "end": 825, "loc": { "start": { "line": 44, "column": 6 }, "end": { "line": 44, "column": 25 } }, "object": { "type": "Identifier", "start": 806, "end": 817, "loc": { "start": {