oxygen-core
Version:
Oxygen game engine (Xenon Core for browsers)
1,540 lines (1,539 loc) • 962 kB
JSON
{
"type": "File",
"start": 0,
"end": 4698,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 218,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 4698,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 218,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 58,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 58
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 16
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 16
},
"identifierName": "Component"
},
"name": "Component"
}
}
],
"source": {
"type": "StringLiteral",
"start": 22,
"end": 57,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 57
}
},
"extra": {
"rawValue": "../systems/EntitySystem/Component",
"raw": "'../systems/EntitySystem/Component'"
},
"value": "../systems/EntitySystem/Component"
}
},
{
"type": "ImportDeclaration",
"start": 60,
"end": 92,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 32
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 69,
"end": 73,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 13
}
},
"imported": {
"type": "Identifier",
"start": 69,
"end": 73,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 13
},
"identifierName": "vec2"
},
"name": "vec2"
},
"local": {
"type": "Identifier",
"start": 69,
"end": 73,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 13
},
"identifierName": "vec2"
},
"name": "vec2"
}
}
],
"source": {
"type": "StringLiteral",
"start": 81,
"end": 91,
"loc": {
"start": {
"line": 2,
"column": 21
},
"end": {
"line": 2,
"column": 31
}
},
"extra": {
"rawValue": "../utils",
"raw": "'../utils'"
},
"value": "../utils"
}
},
{
"type": "VariableDeclaration",
"start": 96,
"end": 130,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 34
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 102,
"end": 129,
"loc": {
"start": {
"line": 4,
"column": 6
},
"end": {
"line": 4,
"column": 33
}
},
"id": {
"type": "Identifier",
"start": 102,
"end": 113,
"loc": {
"start": {
"line": 4,
"column": 6
},
"end": {
"line": 4,
"column": 17
},
"identifierName": "cachedTemp1"
},
"name": "cachedTemp1"
},
"init": {
"type": "CallExpression",
"start": 116,
"end": 129,
"loc": {
"start": {
"line": 4,
"column": 20
},
"end": {
"line": 4,
"column": 33
}
},
"callee": {
"type": "MemberExpression",
"start": 116,
"end": 127,
"loc": {
"start": {
"line": 4,
"column": 20
},
"end": {
"line": 4,
"column": 31
}
},
"object": {
"type": "Identifier",
"start": 116,
"end": 120,
"loc": {
"start": {
"line": 4,
"column": 20
},
"end": {
"line": 4,
"column": 24
},
"identifierName": "vec2"
},
"name": "vec2"
},
"property": {
"type": "Identifier",
"start": 121,
"end": 127,
"loc": {
"start": {
"line": 4,
"column": 25
},
"end": {
"line": 4,
"column": 31
},
"identifierName": "create"
},
"name": "create"
},
"computed": false
},
"arguments": []
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 132,
"end": 166,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 34
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 138,
"end": 165,
"loc": {
"start": {
"line": 5,
"column": 6
},
"end": {
"line": 5,
"column": 33
}
},
"id": {
"type": "Identifier",
"start": 138,
"end": 149,
"loc": {
"start": {
"line": 5,
"column": 6
},
"end": {
"line": 5,
"column": 17
},
"identifierName": "cachedTemp2"
},
"name": "cachedTemp2"
},
"init": {
"type": "CallExpression",
"start": 152,
"end": 165,
"loc": {
"start": {
"line": 5,
"column": 20
},
"end": {
"line": 5,
"column": 33
}
},
"callee": {
"type": "MemberExpression",
"start": 152,
"end": 163,
"loc": {
"start": {
"line": 5,
"column": 20
},
"end": {
"line": 5,
"column": 31
}
},
"object": {
"type": "Identifier",
"start": 152,
"end": 156,
"loc": {
"start": {
"line": 5,
"column": 20
},
"end": {
"line": 5,
"column": 24
},
"identifierName": "vec2"
},
"name": "vec2"
},
"property": {
"type": "Identifier",
"start": 157,
"end": 163,
"loc": {
"start": {
"line": 5,
"column": 25
},
"end": {
"line": 5,
"column": 31
},
"identifierName": "create"
},
"name": "create"
},
"computed": false
},
"arguments": []
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 168,
"end": 202,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 34
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 174,
"end": 201,
"loc": {
"start": {
"line": 6,
"column": 6
},
"end": {
"line": 6,
"column": 33
}
},
"id": {
"type": "Identifier",
"start": 174,
"end": 185,
"loc": {
"start": {
"line": 6,
"column": 6
},
"end": {
"line": 6,
"column": 17
},
"identifierName": "cachedTemp3"
},
"name": "cachedTemp3"
},
"init": {
"type": "CallExpression",
"start": 188,
"end": 201,
"loc": {
"start": {
"line": 6,
"column": 20
},
"end": {
"line": 6,
"column": 33
}
},
"callee": {
"type": "MemberExpression",
"start": 188,
"end": 199,
"loc": {
"start": {
"line": 6,
"column": 20
},
"end": {
"line": 6,
"column": 31
}
},
"object": {
"type": "Identifier",
"start": 188,
"end": 192,
"loc": {
"start": {
"line": 6,
"column": 20
},
"end": {
"line": 6,
"column": 24
},
"identifierName": "vec2"
},
"name": "vec2"
},
"property": {
"type": "Identifier",
"start": 193,
"end": 199,
"loc": {
"start": {
"line": 6,
"column": 25
},
"end": {
"line": 6,
"column": 31
},
"identifierName": "create"
},
"name": "create"
},
"computed": false
},
"arguments": []
}
}
],
"kind": "const"
},
{
"type": "ExportDefaultDeclaration",
"start": 206,
"end": 4696,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 217,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 221,
"end": 4696,
"loc": {
"start": {
"line": 8,
"column": 15
},
"end": {
"line": 217,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 227,
"end": 235,
"loc": {
"start": {
"line": 8,
"column": 21
},
"end": {
"line": 8,
"column": 29
},
"identifierName": "UiLayout"
},
"name": "UiLayout"
},
"superClass": {
"type": "Identifier",
"start": 244,
"end": 253,
"loc": {
"start": {
"line": 8,
"column": 38
},
"end": {
"line": 8,
"column": 47
},
"identifierName": "Component"
},
"name": "Component"
},
"body": {
"type": "ClassBody",
"start": 254,
"end": 4696,
"loc": {
"start": {
"line": 8,
"column": 48
},
"end": {
"line": 217,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 261,
"end": 312,
"loc": {
"start": {
"line": 10,
"column": 2
},
"end": {
"line": 12,
"column": 3
}
},
"static": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 268,
"end": 275,
"loc": {
"start": {
"line": 10,
"column": 9
},
"end": {
"line": 10,
"column": 16
},
"identifierName": "factory"
},
"name": "factory"
},
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 278,
"end": 312,
"loc": {
"start": {
"line": 10,
"column": 19
},
"end": {
"line": 12,
"column": 3
}
},
"body": [
{
"type": "ReturnStatement",
"start": 285,
"end": 307,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 26
}
},
"argument": {
"type": "NewExpression",
"start": 292,
"end": 306,
"loc": {
"start": {
"line": 11,
"column": 11
},
"end": {
"line": 11,
"column": 25
}
},
"callee": {
"type": "Identifier",
"start": 296,
"end": 304,
"loc": {
"start": {
"line": 11,
"column": 15
},
"end": {
"line": 11,
"column": 23
},
"identifierName": "UiLayout"
},
"name": "UiLayout"
},
"arguments": []
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 318,
"end": 503,
"loc": {
"start": {
"line": 14,
"column": 2
},
"end": {
"line": 22,
"column": 3
}
},
"static": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 329,
"end": 339,
"loc": {
"start": {
"line": 14,
"column": 13
},
"end": {
"line": 14,
"column": 23
},
"identifierName": "propsTypes"
},
"name": "propsTypes"
},
"kind": "get",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 342,
"end": 503,
"loc": {
"start": {
"line": 14,
"column": 26
},
"end": {
"line": 22,
"column": 3
}
},
"body": [
{
"type": "ReturnStatement",
"start": 349,
"end": 498,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 21,
"column": 6
}
},
"argument": {
"type": "ObjectExpression",
"start": 356,
"end": 497,
"loc": {
"start": {
"line": 15,
"column": 11
},
"end": {
"line": 21,
"column": 5
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 365,
"end": 386,
"loc": {
"start": {
"line": 16,
"column": 6
},
"end": {
"line": 16,
"column": 27
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 365,
"end": 371,
"loc": {
"start": {
"line": 16,
"column": 6
},
"end": {
"line": 16,
"column": 12
},
"identifierName": "camera"
},
"name": "camera"
},
"value": {
"type": "StringLiteral",
"start": 373,
"end": 386,
"loc": {
"start": {
"line": 16,
"column": 14
},
"end": {
"line": 16,
"column": 27
}
},
"extra": {
"rawValue": "string_null",
"raw": "'string_null'"
},
"value": "string_null"
}
},
{
"type": "ObjectProperty",
"start": 395,
"end": 412,
"loc": {
"start": {
"line": 17,
"column": 6
},
"end": {
"line": 17,
"column": 23
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 395,
"end": 402,
"loc": {
"start": {
"line": 17,
"column": 6
},
"end": {
"line": 17,
"column": 13
},
"identifierName": "xAnchor"
},
"name": "xAnchor"
},
"value": {
"type": "StringLiteral",
"start": 404,
"end": 412,
"loc": {
"start": {
"line": 17,
"column": 15
},
"end": {
"line": 17,
"column": 23
}
},
"extra": {
"rawValue": "number",
"raw": "'number'"
},
"value": "number"
}
},
{
"type": "ObjectProperty",
"start": 421,
"end": 438,
"loc": {
"start": {
"line": 18,
"column": 6
},
"end": {
"line": 18,
"column": 23
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 421,
"end": 428,
"loc": {
"start": {
"line": 18,
"column": 6
},
"end": {
"line": 18,
"column": 13
},
"identifierName": "yAnchor"
},
"name": "yAnchor"
},
"value": {
"type": "StringLiteral",
"start": 430,
"end": 438,
"loc": {
"start": {
"line": 18,
"column": 15
},
"end": {
"line": 18,
"column": 23
}
},
"extra": {
"rawValue": "number",
"raw": "'number'"
},
"value": "number"
}
},
{
"type": "ObjectProperty",
"start": 447,
"end": 464,
"loc": {
"start": {
"line": 19,
"column": 6
},
"end": {
"line": 19,
"column": 23
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 447,
"end": 454,
"loc": {
"start": {
"line": 19,
"column": 6
},
"end": {
"line": 19,
"column": 13
},
"identifierName": "xOffset"
},
"name": "xOffset"
},
"value": {
"type": "StringLiteral",
"start": 456,
"end": 464,
"loc": {
"start": {
"line": 19,
"column": 15
},
"end": {
"line": 19,
"column": 23
}
},
"extra": {
"rawValue": "number",
"raw": "'number'"
},
"value": "number"
}
},
{
"type": "ObjectProperty",
"start": 473,
"end": 490,
"loc": {
"start": {
"line": 20,
"column": 6
},
"end": {
"line": 20,
"column": 23
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 473,
"end": 480,
"loc": {
"start": {
"line": 20,
"column": 6
},
"end": {
"line": 20,
"column": 13
},
"identifierName": "yOffset"
},
"name": "yOffset"
},
"value": {
"type": "StringLiteral",
"start": 482,
"end": 490,
"loc": {
"start": {
"line": 20,
"column": 15
},
"end": {
"line": 20,
"column": 23
}
},
"extra": {
"rawValue": "number",
"raw": "'number'"
},
"value": "number"
}
}
]
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 509,
"end": 554,
"loc": {
"start": {
"line": 24,
"column": 2
},
"end": {
"line": 26,
"column": 3
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 513,
"end": 519,
"loc": {
"start": {
"line": 24,
"column": 6
},
"end": {
"line": 24,
"column": 12
},
"identifierName": "camera"
},
"name": "camera"
},
"kind": "get",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 522,
"end": 554,
"loc": {
"start": {
"line": 24,
"column": 15
},
"end": {
"line": 26,
"column": 3
}
},
"body": [
{
"type": "ReturnStatement",
"start": 529,
"end": 549,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 25,
"column": 24
}
},
"argument": {
"type": "MemberExpression",
"start": 536,
"end": 548,
"loc": {
"start": {
"line": 25,
"column": 11
},
"end": {
"line": 25,
"column": 23
}
},
"object": {
"type": "ThisExpression",
"start": 536,
"end": 540,
"loc": {
"start": {
"line": 25,
"column": 11
},
"end": {
"line": 25,
"column": 15
}
}
},
"property": {
"type": "Identifier",
"start": 541,
"end": 548,
"loc": {
"start": {
"line": 25,
"column": 16
},
"end": {
"line": 25,
"column": 23
},
"identifierName": "_camera"
},
"name": "_camera"
},
"computed": false
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 560,
"end": 1346,
"loc": {
"start": {
"line": 28,
"column": 2
},
"end": {
"line": 59,
"column": 3
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 564,
"end": 570,
"loc": {
"start": {
"line": 28,
"column": 6
},
"end": {
"line": 28,
"column": 12
},
"identifierName": "camera"
},
"name": "camera"
},
"kind": "set",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 571,
"end": 576,
"loc": {
"start": {
"line": 28,
"column": 13
},
"end": {
"line": 28,
"column": 18
},
"identifierName": "value"
},
"name": "value"
}
],
"body": {
"type": "BlockStatement",
"start": 578,
"end": 1346,
"loc": {
"start": {
"line": 28,
"column": 20
},
"end": {
"line": 59,
"column": 3
}
},
"body": [
{
"type": "IfStatement",
"start": 585,
"end": 719,
"loc": {
"start": {
"line": 29,
"column": 4
},
"end": {
"line": 34,
"column": 5
}
},
"test": {
"type": "UnaryExpression",
"start": 589,
"end": 595,
"loc": {
"start": {
"line": 29,
"column": 8
},
"end": {
"line": 29,
"column": 14
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 590,
"end": 595,
"loc": {
"start": {
"line": 29,
"column": 9
},
"end": {
"line": 29,
"column": 14
},
"identifierName": "value"
},
"name": "value"
},
"extra": {
"parenthesizedArgument": false
}
},
"consequent": {
"type": "BlockStatement",
"start": 597,
"end": 719,
"loc": {
"start": {
"line": 29,
"column": 16
},
"end": {
"line": 34,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 606,
"end": 626,
"loc": {
"start": {
"line": 30,
"column": 6
},
"end": {
"line": 30,
"column": 26
}
},
"expression": {
"type": "AssignmentExpression",
"start": 606,
"end": 625,
"loc": {
"start": {
"line": 30,
"column": 6
},
"end": {
"line": 30,
"column": 25
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 606,
"end": 618,
"loc": {
"start": {
"line": 30,
"column": 6
},
"end": {
"line": 30,
"column": 18
}
},
"object": {
"type": "ThisExpression",
"start": 606,
"end": 610,
"loc": {
"start": {
"line": 30,
"column": 6
},
"end": {
"line": 30,
"column": 10
}
}
},
"property": {
"type": "Identifier",
"start": 611,
"end": 618,
"loc": {
"start": {
"line": 30,
"column": 11
},
"end": {
"line": 30,
"column": 18
},
"identifierName": "_camera"
},
"name": "_camera"
},
"computed": false
},
"right": {
"type": "NullLiteral",
"start": 621,
"end": 625,
"loc": {
"start": {
"line": 30,
"column": 21
},
"end": {
"line": 30,
"column": 25
}
}
}
}
},
{
"type": "ExpressionStatement",
"start": 634,
"end": 660,
"loc": {
"start": {
"line": 31,
"column": 6
},
"end": {
"line": 31,
"column": 32
}
},
"expression": {
"type": "AssignmentExpression",
"start": 634,
"end": 659,
"loc": {
"start": {
"line": 31,
"column": 6
},
"end": {
"line": 31,
"column": 31
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 634,
"end": 652,
"loc": {
"start": {
"line": 31,
"column": 6
},
"end": {
"line": 31,
"column": 24
}
},
"object": {
"type": "ThisExpression",
"start": 634,
"end": 638,
"loc": {
"start": {
"line": 31,
"column": 6
},
"end": {
"line": 31,
"column": 10
}
}
},
"property": {
"type": "Identifier",
"start": 639,
"end": 652,
"loc": {
"start": {
"line": 31,
"column": 11
},
"end": {
"line": 31,
"column": 24
},
"identifierName": "_cameraEntity"
},
"name": "_cameraEntity"
},
"computed": false
},
"right": {
"type": "NullLiteral",
"start": 655,
"end": 659,
"loc": {
"start": {
"line": 31,
"column": 27
},
"end": {
"line": 31,
"column": 31
}
}
}
}
},
{
"type": "ExpressionStatement",
"start": 668,
"end": 697,
"loc": {
"start": {
"line": 32,
"column": 6
},
"end": {
"line": 32,