UNPKG

oxygen-core

Version:

Oxygen game engine (Xenon Core for browsers)

1,415 lines 270 kB
{ "type": "File", "start": 0, "end": 1596, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 79, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 1596, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 79, "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 * Set of ossets list asset loader.\r\n ", "start": 53, "end": 98, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 5, "column": 3 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 100, "end": 1594, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 78, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 115, "end": 1594, "loc": { "start": { "line": 6, "column": 15 }, "end": { "line": 78, "column": 1 } }, "id": { "type": "Identifier", "start": 121, "end": 129, "loc": { "start": { "line": 6, "column": 21 }, "end": { "line": 6, "column": 29 }, "identifierName": "SetAsset" }, "name": "SetAsset", "leadingComments": null }, "superClass": { "type": "Identifier", "start": 138, "end": 143, "loc": { "start": { "line": 6, "column": 38 }, "end": { "line": 6, "column": 43 }, "identifierName": "Asset" }, "name": "Asset" }, "body": { "type": "ClassBody", "start": 144, "end": 1594, "loc": { "start": { "line": 6, "column": 44 }, "end": { "line": 78, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 360, "end": 425, "loc": { "start": { "line": 18, "column": 2 }, "end": { "line": 20, "column": 3 } }, "static": true, "computed": false, "key": { "type": "Identifier", "start": 367, "end": 374, "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": 375, "end": 382, "loc": { "start": { "line": 18, "column": 17 }, "end": { "line": 18, "column": 24 } }, "argument": { "type": "Identifier", "start": 378, "end": 382, "loc": { "start": { "line": 18, "column": 20 }, "end": { "line": 18, "column": 24 }, "identifierName": "args" }, "name": "args" } } ], "body": { "type": "BlockStatement", "start": 384, "end": 425, "loc": { "start": { "line": 18, "column": 26 }, "end": { "line": 20, "column": 3 } }, "body": [ { "type": "ReturnStatement", "start": 391, "end": 420, "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 19, "column": 33 } }, "argument": { "type": "NewExpression", "start": 398, "end": 419, "loc": { "start": { "line": 19, "column": 11 }, "end": { "line": 19, "column": 32 } }, "callee": { "type": "Identifier", "start": 402, "end": 410, "loc": { "start": { "line": 19, "column": 15 }, "end": { "line": 19, "column": 23 }, "identifierName": "SetAsset" }, "name": "SetAsset" }, "arguments": [ { "type": "SpreadElement", "start": 411, "end": 418, "loc": { "start": { "line": 19, "column": 24 }, "end": { "line": 19, "column": 31 } }, "argument": { "type": "Identifier", "start": 414, "end": 418, "loc": { "start": { "line": 19, "column": 27 }, "end": { "line": 19, "column": 31 }, "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 {SetAsset} Asset instance.\r\n *\r\n * @example\r\n * system.registerProtocol('set', SetAsset.factory);\r\n ", "start": 151, "end": 356, "loc": { "start": { "line": 8, "column": 2 }, "end": { "line": 17, "column": 5 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\r\n * @override\r\n ", "start": 431, "end": 457, "loc": { "start": { "line": 22, "column": 2 }, "end": { "line": 24, "column": 5 } } } ] }, { "type": "ClassMethod", "start": 461, "end": 575, "loc": { "start": { "line": 25, "column": 2 }, "end": { "line": 30, "column": 3 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 461, "end": 472, "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": 473, "end": 480, "loc": { "start": { "line": 25, "column": 14 }, "end": { "line": 25, "column": 21 } }, "argument": { "type": "Identifier", "start": 476, "end": 480, "loc": { "start": { "line": 25, "column": 17 }, "end": { "line": 25, "column": 21 }, "identifierName": "args" }, "name": "args" } } ], "body": { "type": "BlockStatement", "start": 482, "end": 575, "loc": { "start": { "line": 25, "column": 23 }, "end": { "line": 30, "column": 3 } }, "body": [ { "type": "ExpressionStatement", "start": 489, "end": 504, "loc": { "start": { "line": 26, "column": 4 }, "end": { "line": 26, "column": 19 } }, "expression": { "type": "CallExpression", "start": 489, "end": 503, "loc": { "start": { "line": 26, "column": 4 }, "end": { "line": 26, "column": 18 } }, "callee": { "type": "Super", "start": 489, "end": 494, "loc": { "start": { "line": 26, "column": 4 }, "end": { "line": 26, "column": 9 } } }, "arguments": [ { "type": "SpreadElement", "start": 495, "end": 502, "loc": { "start": { "line": 26, "column": 10 }, "end": { "line": 26, "column": 17 } }, "argument": { "type": "Identifier", "start": 498, "end": 502, "loc": { "start": { "line": 26, "column": 13 }, "end": { "line": 26, "column": 17 }, "identifierName": "args" }, "name": "args" } } ] } }, { "type": "ExpressionStatement", "start": 512, "end": 541, "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 28, "column": 33 } }, "expression": { "type": "AssignmentExpression", "start": 512, "end": 540, "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 28, "column": 32 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 512, "end": 533, "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 28, "column": 25 } }, "object": { "type": "ThisExpression", "start": 512, "end": 516, "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 28, "column": 8 } } }, "property": { "type": "Identifier", "start": 517, "end": 533, "loc": { "start": { "line": 28, "column": 9 }, "end": { "line": 28, "column": 25 }, "identifierName": "_descriptorAsset" }, "name": "_descriptorAsset" }, "computed": false }, "right": { "type": "NullLiteral", "start": 536, "end": 540, "loc": { "start": { "line": 28, "column": 28 }, "end": { "line": 28, "column": 32 } } } } }, { "type": "ExpressionStatement", "start": 547, "end": 570, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 27 } }, "expression": { "type": "AssignmentExpression", "start": 547, "end": 569, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 26 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 547, "end": 562, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 19 } }, "object": { "type": "ThisExpression", "start": 547, "end": 551, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 8 } } }, "property": { "type": "Identifier", "start": 552, "end": 562, "loc": { "start": { "line": 29, "column": 9 }, "end": { "line": 29, "column": 19 }, "identifierName": "_assetList" }, "name": "_assetList" }, "computed": false }, "right": { "type": "NullLiteral", "start": 565, "end": 569, "loc": { "start": { "line": 29, "column": 22 }, "end": { "line": 29, "column": 26 } } } } } ], "directives": [], "trailingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "*\r\n * @override\r\n ", "start": 431, "end": 457, "loc": { "start": { "line": 22, "column": 2 }, "end": { "line": 24, "column": 5 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\r\n * @override\r\n ", "start": 581, "end": 607, "loc": { "start": { "line": 32, "column": 2 }, "end": { "line": 34, "column": 5 } } } ] }, { "type": "ClassMethod", "start": 611, "end": 977, "loc": { "start": { "line": 35, "column": 2 }, "end": { "line": 51, "column": 3 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 611, "end": 618, "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": 621, "end": 977, "loc": { "start": { "line": 35, "column": 12 }, "end": { "line": 51, "column": 3 } }, "body": [ { "type": "ExpressionStatement", "start": 628, "end": 644, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 20 } }, "expression": { "type": "CallExpression", "start": 628, "end": 643, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 19 } }, "callee": { "type": "MemberExpression", "start": 628, "end": 641, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 17 } }, "object": { "type": "Super", "start": 628, "end": 633, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 9 } } }, "property": { "type": "Identifier", "start": 634, "end": 641, "loc": { "start": { "line": 36, "column": 10 }, "end": { "line": 36, "column": 17 }, "identifierName": "dispose" }, "name": "dispose" }, "computed": false }, "arguments": [] } }, { "type": "VariableDeclaration", "start": 652, "end": 698, "loc": { "start": { "line": 38, "column": 4 }, "end": { "line": 38, "column": 50 } }, "declarations": [ { "type": "VariableDeclarator", "start": 658, "end": 697, "loc": { "start": { "line": 38, "column": 10 }, "end": { "line": 38, "column": 49 } }, "id": { "type": "ObjectPattern", "start": 658, "end": 690, "loc": { "start": { "line": 38, "column": 10 }, "end": { "line": 38, "column": 42 } }, "properties": [ { "type": "ObjectProperty", "start": 660, "end": 676, "loc": { "start": { "line": 38, "column": 12 }, "end": { "line": 38, "column": 28 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 660, "end": 676, "loc": { "start": { "line": 38, "column": 12 }, "end": { "line": 38, "column": 28 }, "identifierName": "_descriptorAsset" }, "name": "_descriptorAsset" }, "value": { "type": "Identifier", "start": 660, "end": 676, "loc": { "start": { "line": 38, "column": 12 }, "end": { "line": 38, "column": 28 }, "identifierName": "_descriptorAsset" }, "name": "_descriptorAsset" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 678, "end": 688, "loc": { "start": { "line": 38, "column": 30 }, "end": { "line": 38, "column": 40 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 678, "end": 688, "loc": { "start": { "line": 38, "column": 30 }, "end": { "line": 38, "column": 40 }, "identifierName": "_assetList" }, "name": "_assetList" }, "value": { "type": "Identifier", "start": 678, "end": 688, "loc": { "start": { "line": 38, "column": 30 }, "end": { "line": 38, "column": 40 }, "identifierName": "_assetList" }, "name": "_assetList" }, "extra": { "shorthand": true } } ] }, "init": { "type": "ThisExpression", "start": 693, "end": 697, "loc": { "start": { "line": 38, "column": 45 }, "end": { "line": 38, "column": 49 } } } } ], "kind": "const" }, { "type": "IfStatement", "start": 706, "end": 773, "loc": { "start": { "line": 40, "column": 4 }, "end": { "line": 42, "column": 5 } }, "test": { "type": "UnaryExpression", "start": 710, "end": 728, "loc": { "start": { "line": 40, "column": 8 }, "end": { "line": 40, "column": 26 } }, "operator": "!", "prefix": true, "argument": { "type": "UnaryExpression", "start": 711, "end": 728, "loc": { "start": { "line": 40, "column": 9 }, "end": { "line": 40, "column": 26 } }, "operator": "!", "prefix": true, "argument": { "type": "Identifier", "start": 712, "end": 728, "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": 730, "end": 773, "loc": { "start": { "line": 40, "column": 28 }, "end": { "line": 42, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 739, "end": 766, "loc": { "start": { "line": 41, "column": 6 }, "end": { "line": 41, "column": 33 } }, "expression": { "type": "CallExpression", "start": 739, "end": 765, "loc": { "start": { "line": 41, "column": 6 }, "end": { "line": 41, "column": 32 } }, "callee": { "type": "MemberExpression", "start": 739, "end": 763, "loc": { "start": { "line": 41, "column": 6 }, "end": { "line": 41, "column": 30 } }, "object": { "type": "Identifier", "start": 739, "end": 755, "loc": { "start": { "line": 41, "column": 6 }, "end": { "line": 41, "column": 22 }, "identifierName": "_descriptorAsset" }, "name": "_descriptorAsset" }, "property": { "type": "Identifier", "start": 756, "end": 763, "loc": { "start": { "line": 41, "column": 23 }, "end": { "line": 41, "column": 30 }, "identifierName": "dispose" }, "name": "dispose" }, "computed": false }, "arguments": [] } } ], "directives": [] }, "alternate": null }, { "type": "IfStatement", "start": 779, "end": 906, "loc": { "start": { "line": 43, "column": 4 }, "end": { "line": 47, "column": 5 } }, "test": { "type": "LogicalExpression", "start": 783, "end": 820, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 45 } }, "left": { "type": "UnaryExpression", "start": 783, "end": 795, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 20 } }, "operator": "!", "prefix": true, "argument": { "type": "UnaryExpression", "start": 784, "end": 795, "loc": { "start": { "line": 43, "column": 9 }, "end": { "line": 43, "column": 20 } }, "operator": "!", "prefix": true, "argument": { "type": "Identifier", "start": 785, "end": 795, "loc": { "start": { "line": 43, "column": 10 }, "end": { "line": 43, "column": 20 }, "identifierName": "_assetList" }, "name": "_assetList" }, "extra": { "parenthesizedArgument": false } }, "extra": { "parenthesizedArgument": false } }, "operator": "&&", "right": { "type": "BinaryExpression", "start": 799, "end": 820, "loc": { "start": { "line": 43, "column": 24 }, "end": { "line": 43, "column": 45 } }, "left": { "type": "MemberExpression", "start": 799, "end": 816, "loc": { "start": { "line": 43, "column": 24 }, "end": { "line": 43, "column": 41 } }, "object": { "type": "Identifier", "start": 799, "end": 809, "loc": { "start": { "line": 43, "column": 24 }, "end": { "line": 43, "column": 34 }, "identifierName": "_assetList" }, "name": "_assetList" }, "property": { "type": "Identifier", "start