UNPKG

dirtybomb

Version:
1,662 lines (1,661 loc) 765 kB
{ "type": "Program", "body": [ { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportDefaultSpecifier", "local": { "type": "Identifier", "name": "Source", "range": [ 49, 55 ], "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 13 } } }, "range": [ 49, 55 ], "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 13 } } } ], "source": { "type": "Literal", "value": "./Dispersion/Source", "raw": "'./Dispersion/Source'", "range": [ 61, 82 ], "loc": { "start": { "line": 5, "column": 19 }, "end": { "line": 5, "column": 40 } } }, "range": [ 42, 83 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 41 } }, "leadingComments": [ { "type": "Block", "value": "*\n * Created by austin on 6/17/16.\n ", "range": [ 0, 40 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 3, "column": 3 } } } ] }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportDefaultSpecifier", "local": { "type": "Identifier", "name": "Atmosphere", "range": [ 91, 101 ], "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 17 } } }, "range": [ 91, 101 ], "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 17 } } } ], "source": { "type": "Literal", "value": "./Dispersion/Atmosphere", "raw": "'./Dispersion/Atmosphere'", "range": [ 107, 132 ], "loc": { "start": { "line": 6, "column": 23 }, "end": { "line": 6, "column": 48 } } }, "range": [ 84, 133 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 49 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportDefaultSpecifier", "local": { "type": "Identifier", "name": "GaussianPuff", "range": [ 141, 153 ], "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 19 } } }, "range": [ 141, 153 ], "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 19 } } } ], "source": { "type": "Literal", "value": "./Dispersion/GaussianPuff", "raw": "'./Dispersion/GaussianPuff'", "range": [ 159, 186 ], "loc": { "start": { "line": 7, "column": 25 }, "end": { "line": 7, "column": 52 } } }, "range": [ 134, 187 ], "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 53 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportDefaultSpecifier", "local": { "type": "Identifier", "name": "DynamicGaussianPuff", "range": [ 195, 214 ], "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 26 } } }, "range": [ 195, 214 ], "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 26 } } } ], "source": { "type": "Literal", "value": "./Dispersion/DynamicGaussianDecayPuff", "raw": "'./Dispersion/DynamicGaussianDecayPuff'", "range": [ 220, 259 ], "loc": { "start": { "line": 8, "column": 32 }, "end": { "line": 8, "column": 71 } } }, "range": [ 188, 260 ], "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 72 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "SourceType", "range": [ 269, 279 ], "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 18 } } }, "imported": { "type": "Identifier", "name": "SourceType", "range": [ 269, 279 ], "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 18 } } }, "range": [ 269, 279 ], "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 18 } } } ], "source": { "type": "Literal", "value": "./Dispersion/Source", "raw": "'./Dispersion/Source'", "range": [ 286, 307 ], "loc": { "start": { "line": 9, "column": 25 }, "end": { "line": 9, "column": 46 } } }, "range": [ 261, 308 ], "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 47 } }, "trailingComments": [ { "type": "Line", "value": " For some reason importing Atmosphere makes Rollup unhappy", "range": [ 310, 370 ], "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 60 } } }, { "type": "Block", "value": "*\n * Explosive energy of tnt\n * MJ/kg\n * @type {number}\n * @see https://en.wikipedia.org/wiki/TNT_equivalent\n ", "range": [ 372, 486 ], "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 18, "column": 3 } } } ] }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Q_TNT", "range": [ 493, 498 ], "loc": { "start": { "line": 19, "column": 6 }, "end": { "line": 19, "column": 11 } } }, "init": { "type": "Literal", "value": 4.184, "raw": "4.184", "range": [ 501, 506 ], "loc": { "start": { "line": 19, "column": 14 }, "end": { "line": 19, "column": 19 } } }, "range": [ 493, 506 ], "loc": { "start": { "line": 19, "column": 6 }, "end": { "line": 19, "column": 19 } } } ], "kind": "const", "range": [ 487, 507 ], "loc": { "start": { "line": 19, "column": 0 }, "end": { "line": 19, "column": 20 } }, "leadingComments": [ { "type": "Line", "value": " For some reason importing Atmosphere makes Rollup unhappy", "range": [ 310, 370 ], "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 60 } } }, { "type": "Block", "value": "*\n * Explosive energy of tnt\n * MJ/kg\n * @type {number}\n * @see https://en.wikipedia.org/wiki/TNT_equivalent\n ", "range": [ 372, 486 ], "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 18, "column": 3 } } } ], "trailingComments": [ { "type": "Line", "value": " One Megaton of TNT == 4.184 Petajoules", "range": [ 511, 552 ], "loc": { "start": { "line": 19, "column": 24 }, "end": { "line": 19, "column": 65 } } }, { "type": "Block", "value": "*\n * A simple bomb \n ", "range": [ 554, 579 ], "loc": { "start": { "line": 21, "column": 0 }, "end": { "line": 23, "column": 3 } } } ] }, { "type": "Identifier", "id": { "type": "Identifier", "name": "Bomb", "range": [ 586, 590 ], "loc": { "start": { "line": 24, "column": 6 }, "end": { "line": 24, "column": 10 } } }, "superClass": null, "body": { "type": "ClassBody", "body": [ { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "constructor", "range": [ 833, 844 ], "loc": { "start": { "line": 31, "column": 4 }, "end": { "line": 31, "column": 15 } } }, "value": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "tntEqvMass", "range": [ 845, 855 ], "loc": { "start": { "line": 31, "column": 16 }, "end": { "line": 31, "column": 26 } } }, { "type": "AssignmentPattern", "left": { "type": "Identifier", "name": "atmosphere", "range": [ 857, 867 ], "loc": { "start": { "line": 31, "column": 28 }, "end": { "line": 31, "column": 38 } } }, "right": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Bomb", "range": [ 870, 874 ], "loc": { "start": { "line": 31, "column": 41 }, "end": { "line": 31, "column": 45 } } }, "property": { "type": "Identifier", "name": "STANDARD_ATM", "range": [ 875, 887 ], "loc": { "start": { "line": 31, "column": 46 }, "end": { "line": 31, "column": 58 } } }, "range": [ 870, 887 ], "loc": { "start": { "line": 31, "column": 41 }, "end": { "line": 31, "column": 58 } } }, "range": [ 857, 887 ], "loc": { "start": { "line": 31, "column": 28 }, "end": { "line": 31, "column": 58 } } }, { "type": "AssignmentPattern", "left": { "type": "Identifier", "name": "isStatic", "range": [ 889, 897 ], "loc": { "start": { "line": 31, "column": 60 }, "end": { "line": 31, "column": 68 } } }, "right": { "type": "Literal", "value": true, "raw": "true", "range": [ 900, 904 ], "loc": { "start": { "line": 31, "column": 71 }, "end": { "line": 31, "column": 75 } } }, "range": [ 889, 904 ], "loc": { "start": { "line": 31, "column": 60 }, "end": { "line": 31, "column": 75 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 997, 1001 ], "loc": { "start": { "line": 37, "column": 8 }, "end": { "line": 37, "column": 12 } } }, "property": { "type": "Identifier", "name": "_mass", "range": [ 1002, 1007 ], "loc": { "start": { "line": 37, "column": 13 }, "end": { "line": 37, "column": 18 } } }, "range": [ 997, 1007 ], "loc": { "start": { "line": 37, "column": 8 }, "end": { "line": 37, "column": 18 } } }, "right": { "type": "Identifier", "name": "tntEqvMass", "range": [ 1010, 1020 ], "loc": { "start": { "line": 37, "column": 21 }, "end": { "line": 37, "column": 31 } } }, "range": [ 997, 1020 ], "loc": { "start": { "line": 37, "column": 8 }, "end": { "line": 37, "column": 31 } } }, "range": [ 997, 1021 ], "loc": { "start": { "line": 37, "column": 8 }, "end": { "line": 37, "column": 32 } }, "leadingComments": [ { "type": "Block", "value": "*\n *\n * @type {number}\n * @private\n ", "range": [ 916, 988 ], "loc": { "start": { "line": 32, "column": 8 }, "end": { "line": 36, "column": 11 } } } ], "trailingComments": [ { "type": "Block", "value": "*\n * A standardized measure for weapon strength\n * @type {number}\n * @private\n ", "range": [ 1030, 1145 ], "loc": { "start": { "line": 38, "column": 8 }, "end": { "line": 42, "column": 11 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1154, 1158 ], "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 12 } } }, "property": { "type": "Identifier", "name": "_weaponYield", "range": [ 1159, 1171 ], "loc": { "start": { "line": 43, "column": 13 }, "end": { "line": 43, "column": 25 } } }, "range": [ 1154, 1171 ], "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 25 } } }, "right": { "type": "BinaryExpression", "operator": "/", "left": { "type": "Identifier", "name": "tntEqvMass", "range": [ 1174, 1184 ], "loc": { "start": { "line": 43, "column": 28 }, "end": { "line": 43, "column": 38 } } }, "right": { "type": "Literal", "value": 1000000, "raw": "1000000", "range": [ 1187, 1194 ], "loc": { "start": { "line": 43, "column": 41 }, "end": { "line": 43, "column": 48 } } }, "range": [ 1174, 1194 ], "loc": { "start": { "line": 43, "column": 28 }, "end": { "line": 43, "column": 48 } } }, "range": [ 1154, 1194 ], "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 48 } } }, "range": [ 1154, 1195 ], "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 49 } }, "leadingComments": [ { "type": "Block", "value": "*\n * A standardized measure for weapon strength\n * @type {number}\n * @private\n ", "range": [ 1030, 1145 ], "loc": { "start": { "line": 38, "column": 8 }, "end": { "line": 42, "column": 11 } } } ], "trailingComments": [ { "type": "Block", "value": "*\n *\n * @type {Atmosphere}\n * @private\n ", "range": [ 1204, 1280 ], "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 48, "column": 11 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1289, 1293 ], "loc": { "start": { "line": 49, "column": 8 }, "end": { "line": 49, "column": 12 } } }, "property": { "type": "Identifier", "name": "_atm", "range": [ 1294, 1298 ], "loc": { "start": { "line": 49, "column": 13 }, "end": { "line": 49, "column": 17 } } }, "range": [ 1289, 1298 ], "loc": { "start": { "line": 49, "column": 8 }, "end": { "line": 49, "column": 17 } } }, "right": { "type": "Identifier", "name": "atmosphere", "range": [ 1301, 1311 ], "loc": { "start": { "line": 49, "column": 20 }, "end": { "line": 49, "column": 30 } } }, "range": [ 1289, 1311 ], "loc": { "start": { "line": 49, "column": 8 }, "end": { "line": 49, "column": 30 } } }, "range": [ 1289, 1312 ], "loc": { "start": { "line": 49, "column": 8 }, "end": { "line": 49, "column": 31 } }, "leadingComments": [ { "type": "Block", "value": "*\n *\n * @type {Atmosphere}\n * @private\n ", "range": [ 1204, 1280 ], "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 48, "column": 11 } } } ], "trailingComments": [ { "type": "Block", "value": "*\n * \n * @type {Source}\n * @private\n ", "range": [ 1322, 1395 ], "loc": { "start": { "line": 51, "column": 8 }, "end": { "line": 55, "column": 11 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1404, 1408 ], "loc": { "start": { "line": 56, "column": 8 }, "end": { "line": 56, "column": 12 } } }, "property": { "type": "Identifier", "name": "_source", "range": [ 1409, 1416 ], "loc": { "start": { "line": 56, "column": 13 }, "end": { "line": 56, "column": 20 } } }, "range": [ 1404, 1416 ], "loc": { "start": { "line": 56, "column": 8 }, "end": { "line": 56, "column": 20 } } }, "right": { "type": "NewExpression", "callee": { "type": "Identifier", "name": "Source", "range": [ 1423, 1429 ], "loc": { "start": { "line": 56, "column": 27 }, "end": { "line": 56, "column": 33 } } }, "arguments": [ { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "SourceType", "range": [ 1443, 1453 ], "loc": { "start": { "line": 57, "column": 12 }, "end": { "line": 57, "column": 22 } } }, "property": { "type": "Identifier", "name": "POINT", "range": [ 1454, 1459 ], "loc": { "start": { "line": 57, "column": 23 }, "end": { "line": 57, "column": 28 } } }, "range": [ 1443, 1459 ], "loc": { "start": { "line": 57, "column": 12 }, "end": { "line": 57, "column": 28 } } }, { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Math", "range": [ 1473, 1477 ], "loc": { "start": { "line": 58, "column": 12 }, "end": { "line": 58, "column": 16 } } }, "property": { "type": "Identifier", "name": "POSITIVE_INFINITY", "range": [ 1478, 1495 ], "loc": { "start": { "line": 58, "column": 17 }, "end": { "line": 58, "column": 34 } } }, "range": [ 1473, 1495 ], "loc": { "start": { "line": 58, "column": 12 }, "end": { "line": 58, "column": 34 } } }, { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1548, 1552 ], "loc": { "start": { "line": 59, "column": 12 }, "end": { "line": 59, "column": 16 } } }, "property": { "type": "Identifier", "name": "cloudHeight", "range": [ 1553, 1564 ], "loc": { "start": { "line": 59, "column": 17 }, "end": { "line": 59, "column": 28 } } }, "range": [ 1548, 1564 ], "loc": { "start": { "line": 59, "column": 12 }, "end": { "line": 59, "column": 28 } }, "leadingComments": [ { "type": "Line", "value": " Emission rate, arb for puffs. TODO!", "range": [ 1497, 1535 ], "loc": { "start": { "line": 58, "column": 36 }, "end": { "line": 58, "column": 74 } } } ] }, { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1578, 1582 ], "loc": { "start": { "line": 60, "column": 12 }, "end": { "line": 60, "column": 16 } } }, "property": { "type": "Identifier", "name": "cloudRadius", "range": [ 1583, 1594 ], "loc": { "start": { "line": 60, "column": 17 }, "end": { "line": 60, "column": 28 } } }, "range": [ 1578, 1594 ], "loc": { "start": { "line": 60, "column": 12 }, "end": { "line": 60, "column": 28 } } }, { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1608, 1612 ], "loc": { "start": { "line": 61, "column": 12 }, "end": { "line": 61, "column": 16 } } }, "property": { "type": "Identifier", "name": "getGasTemp", "range": [ 1613, 1623 ], "loc": { "start": { "line": 61, "column": 17 }, "end": { "line": 61, "column": 27 } } }, "range": [ 1608, 1623 ], "loc": { "start": { "line": 61, "column": 12 }, "end": { "line": 61, "column": 27 } } }, "arguments": [ { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1624, 1628 ], "loc": {