mlogjs 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +68 -18
  3. package/build/Compiler.d.ts +18 -18
  4. package/build/Compiler.js +99 -119
  5. package/build/Compiler.js.map +1 -1
  6. package/build/Scope.d.ts +26 -26
  7. package/build/Scope.js +60 -60
  8. package/build/Scope.js.map +1 -1
  9. package/build/bin.d.ts +2 -2
  10. package/build/bin.js +60 -41
  11. package/build/bin.js.map +1 -1
  12. package/build/handlers/BlockStatement.d.ts +2 -2
  13. package/build/handlers/BlockStatement.js +13 -13
  14. package/build/handlers/CallExpression.d.ts +3 -3
  15. package/build/handlers/CallExpression.js +19 -19
  16. package/build/handlers/ForStatement.d.ts +2 -2
  17. package/build/handlers/ForStatement.js +31 -31
  18. package/build/handlers/Function.d.ts +4 -4
  19. package/build/handlers/Function.js +35 -35
  20. package/build/handlers/Identifier.d.ts +2 -2
  21. package/build/handlers/Identifier.js +7 -7
  22. package/build/handlers/IfStatement.d.ts +2 -2
  23. package/build/handlers/IfStatement.js +24 -24
  24. package/build/handlers/Literal.d.ts +2 -2
  25. package/build/handlers/Literal.js +17 -17
  26. package/build/handlers/Object.d.ts +4 -4
  27. package/build/handlers/Object.js +43 -43
  28. package/build/handlers/OperationExpressions.d.ts +7 -7
  29. package/build/handlers/OperationExpressions.js +32 -32
  30. package/build/handlers/Program.d.ts +2 -2
  31. package/build/handlers/Program.js +8 -8
  32. package/build/handlers/Program.js.map +1 -1
  33. package/build/handlers/Statements.d.ts +5 -5
  34. package/build/handlers/Statements.js +29 -29
  35. package/build/handlers/TemplateExpression.d.ts +2 -2
  36. package/build/handlers/TemplateExpression.js +17 -17
  37. package/build/handlers/VariableDeclaration.d.ts +3 -3
  38. package/build/handlers/VariableDeclaration.js +55 -55
  39. package/build/handlers/WhileStatement.d.ts +2 -2
  40. package/build/handlers/WhileStatement.js +22 -22
  41. package/build/handlers/index.d.ts +14 -14
  42. package/build/handlers/index.js +30 -30
  43. package/build/index.d.ts +1 -1
  44. package/build/index.js +7 -7
  45. package/build/initScope.d.ts +2 -0
  46. package/build/initScope.js +40 -0
  47. package/build/initScope.js.map +1 -0
  48. package/build/instructions/AddressResolver.d.ts +12 -12
  49. package/build/instructions/AddressResolver.js +30 -30
  50. package/build/instructions/ControlInstructions.d.ts +11 -11
  51. package/build/instructions/ControlInstructions.js +22 -22
  52. package/build/instructions/EndInstruction.d.ts +4 -4
  53. package/build/instructions/EndInstruction.js +10 -10
  54. package/build/instructions/InstructionBase.d.ts +10 -10
  55. package/build/instructions/InstructionBase.js +20 -20
  56. package/build/instructions/JumpInstruction.d.ts +15 -15
  57. package/build/instructions/JumpInstruction.js +21 -21
  58. package/build/instructions/OperationInstruction.d.ts +5 -5
  59. package/build/instructions/OperationInstruction.js +10 -10
  60. package/build/instructions/SetCounterInstruction.d.ts +5 -5
  61. package/build/instructions/SetCounterInstruction.js +10 -10
  62. package/build/instructions/SetInstruction.d.ts +5 -5
  63. package/build/instructions/SetInstruction.js +10 -10
  64. package/build/instructions/ZeroSpaceInstruction.d.ts +4 -4
  65. package/build/instructions/ZeroSpaceInstruction.js +10 -10
  66. package/build/instructions/index.d.ts +9 -9
  67. package/build/instructions/index.js +25 -25
  68. package/build/macros/Building.d.ts +11 -11
  69. package/build/macros/Building.js +80 -80
  70. package/build/macros/Function.d.ts +12 -12
  71. package/build/macros/Function.js +19 -19
  72. package/build/macros/Math.d.ts +5 -5
  73. package/build/macros/Math.js +56 -56
  74. package/build/macros/Math.js.map +1 -1
  75. package/build/macros/Memory.d.ts +5 -5
  76. package/build/macros/Memory.js +60 -60
  77. package/build/macros/Namespace.d.ts +21 -21
  78. package/build/macros/Namespace.js +97 -97
  79. package/build/macros/Other.d.ts +5 -5
  80. package/build/macros/Other.js +19 -19
  81. package/build/macros/RawValue.d.ts +5 -5
  82. package/build/macros/RawValue.js +15 -15
  83. package/build/macros/commands/{control.d.ts → Control.d.ts} +5 -5
  84. package/build/macros/commands/{control.js → Control.js} +24 -24
  85. package/build/macros/commands/{control.js.map → Control.js.map} +0 -0
  86. package/build/macros/commands/Draw.d.ts +5 -5
  87. package/build/macros/commands/Draw.js +38 -38
  88. package/build/macros/commands/DrawFlush.d.ts +5 -5
  89. package/build/macros/commands/DrawFlush.js +16 -16
  90. package/build/macros/commands/GetLink.d.ts +5 -5
  91. package/build/macros/commands/GetLink.js +20 -20
  92. package/build/macros/commands/Lookup.d.ts +5 -5
  93. package/build/macros/commands/Lookup.js +23 -23
  94. package/build/macros/commands/Print.d.ts +5 -5
  95. package/build/macros/commands/Print.js +13 -13
  96. package/build/macros/commands/PrintFlush.d.ts +5 -5
  97. package/build/macros/commands/PrintFlush.js +16 -16
  98. package/build/macros/commands/Radar.d.ts +7 -7
  99. package/build/macros/commands/Radar.js +60 -60
  100. package/build/macros/commands/Sensor.d.ts +5 -5
  101. package/build/macros/commands/Sensor.js +19 -19
  102. package/build/macros/commands/UnitBind.d.ts +5 -5
  103. package/build/macros/commands/UnitBind.js +16 -16
  104. package/build/macros/commands/UnitControl.d.ts +5 -5
  105. package/build/macros/commands/UnitControl.js +67 -67
  106. package/build/macros/commands/UnitLocate.d.ts +5 -5
  107. package/build/macros/commands/UnitLocate.js +54 -54
  108. package/build/macros/commands/UnitRadar.d.ts +5 -5
  109. package/build/macros/commands/UnitRadar.js +40 -40
  110. package/build/macros/commands/Wait.d.ts +5 -5
  111. package/build/macros/commands/Wait.js +17 -17
  112. package/build/macros/commands/index.d.ts +14 -14
  113. package/build/macros/commands/index.js +32 -32
  114. package/build/macros/index.d.ts +7 -7
  115. package/build/macros/index.js +39 -39
  116. package/build/operators.d.ts +25 -25
  117. package/build/operators.js +101 -101
  118. package/build/types.d.ts +49 -49
  119. package/build/types.js +27 -27
  120. package/build/utils.d.ts +3 -3
  121. package/build/utils.js +12 -12
  122. package/build/values/BaseValue.d.ts +5 -5
  123. package/build/values/BaseValue.js +111 -111
  124. package/build/values/FunctionValue.d.ts +34 -34
  125. package/build/values/FunctionValue.js +103 -103
  126. package/build/values/LiteralValue.d.ts +12 -12
  127. package/build/values/LiteralValue.js +87 -87
  128. package/build/values/LiteralValue.js.map +1 -1
  129. package/build/values/ObjectValue.d.ts +17 -17
  130. package/build/values/ObjectValue.js +49 -49
  131. package/build/values/StoreValue.d.ts +11 -11
  132. package/build/values/StoreValue.js +30 -30
  133. package/build/values/TempValue.d.ts +12 -12
  134. package/build/values/TempValue.js +66 -66
  135. package/build/values/TempValue.js.map +1 -1
  136. package/build/values/VoidValue.d.ts +11 -11
  137. package/build/values/VoidValue.js +30 -30
  138. package/build/values/index.d.ts +6 -6
  139. package/build/values/index.js +22 -22
  140. package/dist/mlogjs.es.js +6366 -0
  141. package/dist/mlogjs.umd.js +8 -0
  142. package/lib/commands.d.ts +326 -326
  143. package/lib/eslib/index.d.ts +3 -3
  144. package/lib/eslib/lib.d.ts +9 -9
  145. package/lib/eslib/lib.es2015.collection.d.ts +89 -89
  146. package/lib/eslib/lib.es2015.core.d.ts +16 -16
  147. package/lib/eslib/lib.es2015.d.ts +30 -30
  148. package/lib/eslib/lib.es2015.generator.d.ts +79 -79
  149. package/lib/eslib/lib.es2015.iterable.d.ts +70 -70
  150. package/lib/eslib/lib.es5.d.ts +295 -295
  151. package/lib/eslib/lib.es6.d.ts +18 -18
  152. package/lib/globals.d.ts +328 -328
  153. package/lib/helpers.d.ts +23 -23
  154. package/lib/index.d.ts +7 -7
  155. package/lib/kinds.d.ts +36 -36
  156. package/lib/memory.d.ts +17 -17
  157. package/lib/traits.d.ts +121 -121
  158. package/lib/util.d.ts +32 -32
  159. package/package.json +73 -48
  160. package/build/macros/Blocks.d.ts +0 -5
  161. package/build/macros/Blocks.js +0 -143
  162. package/build/macros/Blocks.js.map +0 -1
  163. package/build/macros/Draw.d.ts +0 -5
  164. package/build/macros/Draw.js +0 -39
  165. package/build/macros/Draw.js.map +0 -1
  166. package/build/macros/Items.d.ts +0 -5
  167. package/build/macros/Items.js +0 -20
  168. package/build/macros/Items.js.map +0 -1
  169. package/build/macros/Liquids.d.ts +0 -5
  170. package/build/macros/Liquids.js +0 -18
  171. package/build/macros/Liquids.js.map +0 -1
  172. package/build/macros/Symbol.d.ts +0 -0
  173. package/build/macros/Symbol.js +0 -1
  174. package/build/macros/Symbol.js.map +0 -1
  175. package/build/macros/SymbolNamespace.d.ts +0 -0
  176. package/build/macros/SymbolNamespace.js +0 -1
  177. package/build/macros/SymbolNamespace.js.map +0 -1
  178. package/build/macros/TypeFactory.d.ts +0 -8
  179. package/build/macros/TypeFactory.js +0 -22
  180. package/build/macros/TypeFactory.js.map +0 -1
  181. package/build/macros/Units.d.ts +0 -5
  182. package/build/macros/Units.js +0 -18
  183. package/build/macros/Units.js.map +0 -1
  184. package/build/macros/Vars.d.ts +0 -5
  185. package/build/macros/Vars.js +0 -18
  186. package/build/macros/Vars.js.map +0 -1
  187. package/build/macros/commands/Asm.d.ts +0 -5
  188. package/build/macros/commands/Asm.js +0 -21
  189. package/build/macros/commands/Asm.js.map +0 -1
  190. package/build/macros/commands/io.d.ts +0 -8
  191. package/build/macros/commands/io.js +0 -47
  192. package/build/macros/commands/io.js.map +0 -1
  193. package/build/macros/helpers/GetBuilding.d.ts +0 -5
  194. package/build/macros/helpers/GetBuilding.js +0 -16
  195. package/build/macros/helpers/GetBuilding.js.map +0 -1
  196. package/build/macros/helpers/GetVar.d.ts +0 -5
  197. package/build/macros/helpers/GetVar.js +0 -16
  198. package/build/macros/helpers/GetVar.js.map +0 -1
  199. package/build/macros/helpers/index.d.ts +0 -2
  200. package/build/macros/helpers/index.js +0 -15
  201. package/build/macros/helpers/index.js.map +0 -1
  202. package/dist/bundle.js +0 -1
@@ -1,17 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnitBind = void 0;
4
- const instructions_1 = require("../../instructions");
5
- const __1 = require("..");
6
- const values_1 = require("../../values");
7
- class UnitBind extends __1.MacroFunction {
8
- constructor(scope) {
9
- super(scope, type => {
10
- if (!(type instanceof values_1.StoreValue))
11
- throw new Error("The unitBind type must be a store");
12
- return [null, [new instructions_1.InstructionBase("ubind", type)]];
13
- });
14
- }
15
- }
16
- exports.UnitBind = UnitBind;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UnitBind = void 0;
4
+ const instructions_1 = require("../../instructions");
5
+ const __1 = require("..");
6
+ const values_1 = require("../../values");
7
+ class UnitBind extends __1.MacroFunction {
8
+ constructor(scope) {
9
+ super(scope, type => {
10
+ if (!(type instanceof values_1.StoreValue))
11
+ throw new Error("The unitBind type must be a store");
12
+ return [null, [new instructions_1.InstructionBase("ubind", type)]];
13
+ });
14
+ }
15
+ }
16
+ exports.UnitBind = UnitBind;
17
17
  //# sourceMappingURL=UnitBind.js.map
@@ -1,5 +1,5 @@
1
- import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
- export declare class UnitControl extends MacroFunction {
4
- constructor(scope: IScope);
5
- }
1
+ import { MacroFunction } from "..";
2
+ import { IScope } from "../../types";
3
+ export declare class UnitControl extends MacroFunction {
4
+ constructor(scope: IScope);
5
+ }
@@ -1,68 +1,68 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnitControl = void 0;
4
- const instructions_1 = require("../../instructions");
5
- const __1 = require("..");
6
- const values_1 = require("../../values");
7
- const Building_1 = require("../Building");
8
- const validModes = [
9
- "idle",
10
- "stop",
11
- "move",
12
- "approach",
13
- "boost",
14
- "pathfind",
15
- "target",
16
- "targetp",
17
- "itemDrop",
18
- "itemTake",
19
- "payDrop",
20
- "payTake",
21
- "payEnter",
22
- "mine",
23
- "flag",
24
- "build",
25
- "getBlock",
26
- "within",
27
- ];
28
- class UnitControl extends __1.MacroFunction {
29
- constructor(scope) {
30
- super(scope, (mode, ...args) => {
31
- if (!(mode instanceof values_1.LiteralValue) || typeof mode.data !== "string")
32
- throw new Error("The unitControl mode must be a string literal");
33
- if (!validModes.includes(mode.data))
34
- throw new Error("Invalid unitControl mode");
35
- if (args.some(value => !(value instanceof values_1.StoreValue ||
36
- value instanceof values_1.LiteralValue ||
37
- value instanceof values_1.ObjectValue)))
38
- throw new Error("The others arguments of unitControl must be literals or stores");
39
- let result = null;
40
- let extraArgs = [];
41
- switch (mode.data) {
42
- case "getBlock": {
43
- const outType = new values_1.TempValue(scope);
44
- const outBuilding = new values_1.TempValue(scope);
45
- result = new values_1.ObjectValue(scope, {
46
- 0: outType,
47
- 1: new Building_1.Building(scope, outBuilding.name),
48
- length: new values_1.LiteralValue(scope, 2),
49
- });
50
- extraArgs = [outType, outBuilding, new values_1.LiteralValue(scope, 0)];
51
- break;
52
- }
53
- case "within": {
54
- const temp = new values_1.TempValue(scope);
55
- result = temp;
56
- extraArgs = [temp, 0];
57
- break;
58
- }
59
- }
60
- return [
61
- result,
62
- [new instructions_1.InstructionBase("ucontrol", mode.data, ...args, ...extraArgs)],
63
- ];
64
- });
65
- }
66
- }
67
- exports.UnitControl = UnitControl;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UnitControl = void 0;
4
+ const instructions_1 = require("../../instructions");
5
+ const __1 = require("..");
6
+ const values_1 = require("../../values");
7
+ const Building_1 = require("../Building");
8
+ const validModes = [
9
+ "idle",
10
+ "stop",
11
+ "move",
12
+ "approach",
13
+ "boost",
14
+ "pathfind",
15
+ "target",
16
+ "targetp",
17
+ "itemDrop",
18
+ "itemTake",
19
+ "payDrop",
20
+ "payTake",
21
+ "payEnter",
22
+ "mine",
23
+ "flag",
24
+ "build",
25
+ "getBlock",
26
+ "within",
27
+ ];
28
+ class UnitControl extends __1.MacroFunction {
29
+ constructor(scope) {
30
+ super(scope, (mode, ...args) => {
31
+ if (!(mode instanceof values_1.LiteralValue) || typeof mode.data !== "string")
32
+ throw new Error("The unitControl mode must be a string literal");
33
+ if (!validModes.includes(mode.data))
34
+ throw new Error("Invalid unitControl mode");
35
+ if (args.some(value => !(value instanceof values_1.StoreValue ||
36
+ value instanceof values_1.LiteralValue ||
37
+ value instanceof values_1.ObjectValue)))
38
+ throw new Error("The others arguments of unitControl must be literals or stores");
39
+ let result = null;
40
+ let extraArgs = [];
41
+ switch (mode.data) {
42
+ case "getBlock": {
43
+ const outType = new values_1.TempValue(scope);
44
+ const outBuilding = new values_1.TempValue(scope);
45
+ result = new values_1.ObjectValue(scope, {
46
+ 0: outType,
47
+ 1: new Building_1.Building(scope, outBuilding.name),
48
+ length: new values_1.LiteralValue(scope, 2),
49
+ });
50
+ extraArgs = [outType, outBuilding, new values_1.LiteralValue(scope, 0)];
51
+ break;
52
+ }
53
+ case "within": {
54
+ const temp = new values_1.TempValue(scope);
55
+ result = temp;
56
+ extraArgs = [temp, 0];
57
+ break;
58
+ }
59
+ }
60
+ return [
61
+ result,
62
+ [new instructions_1.InstructionBase("ucontrol", mode.data, ...args, ...extraArgs)],
63
+ ];
64
+ });
65
+ }
66
+ }
67
+ exports.UnitControl = UnitControl;
68
68
  //# sourceMappingURL=UnitControl.js.map
@@ -1,5 +1,5 @@
1
- import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
- export declare class UnitLocate extends MacroFunction {
4
- constructor(scope: IScope);
5
- }
1
+ import { MacroFunction } from "..";
2
+ import { IScope } from "../../types";
3
+ export declare class UnitLocate extends MacroFunction {
4
+ constructor(scope: IScope);
5
+ }
@@ -1,55 +1,55 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnitLocate = void 0;
4
- const instructions_1 = require("../../instructions");
5
- const __1 = require("..");
6
- const values_1 = require("../../values");
7
- const Building_1 = require("../Building");
8
- const validFinds = ["ore", "building", "spawn", "damaged"];
9
- class UnitLocate extends __1.MacroFunction {
10
- constructor(scope) {
11
- super(scope, (find, ...args) => {
12
- if (!(find instanceof values_1.LiteralValue && typeof find.data === "string"))
13
- throw new Error("The unitLocate find must be a string literal");
14
- if (!validFinds.includes(find.data))
15
- throw new Error("Invalid find value");
16
- if (args.some(value => !(value instanceof values_1.StoreValue || value instanceof values_1.LiteralValue)))
17
- throw new Error("The others arguments of unitLocate must be literals or stores");
18
- const outFound = new values_1.TempValue(scope);
19
- const outX = new values_1.TempValue(scope);
20
- const outY = new values_1.TempValue(scope);
21
- const outBuilding = new values_1.TempValue(scope);
22
- const outArgs = [outX, outY, outFound, outBuilding];
23
- let inputArgs = [];
24
- switch (find.data) {
25
- case "ore": {
26
- const [ore] = args;
27
- inputArgs = [find.data, "core", "true", ore];
28
- break;
29
- }
30
- case "building": {
31
- const [group, enemy] = args;
32
- inputArgs = [find.data, group.data, enemy, "@copper"];
33
- break;
34
- }
35
- case "spawn":
36
- case "damaged": {
37
- inputArgs = [find.data, "core", "true", "@copper"];
38
- break;
39
- }
40
- }
41
- return [
42
- new values_1.ObjectValue(scope, {
43
- 0: outFound,
44
- 1: outX,
45
- 2: outY,
46
- 3: new Building_1.Building(scope, outBuilding.name),
47
- length: new values_1.LiteralValue(scope, find.data === "ore" ? 3 : 4),
48
- }),
49
- [new instructions_1.InstructionBase("ulocate", ...inputArgs, ...outArgs)],
50
- ];
51
- });
52
- }
53
- }
54
- exports.UnitLocate = UnitLocate;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UnitLocate = void 0;
4
+ const instructions_1 = require("../../instructions");
5
+ const __1 = require("..");
6
+ const values_1 = require("../../values");
7
+ const Building_1 = require("../Building");
8
+ const validFinds = ["ore", "building", "spawn", "damaged"];
9
+ class UnitLocate extends __1.MacroFunction {
10
+ constructor(scope) {
11
+ super(scope, (find, ...args) => {
12
+ if (!(find instanceof values_1.LiteralValue && typeof find.data === "string"))
13
+ throw new Error("The unitLocate find must be a string literal");
14
+ if (!validFinds.includes(find.data))
15
+ throw new Error("Invalid find value");
16
+ if (args.some(value => !(value instanceof values_1.StoreValue || value instanceof values_1.LiteralValue)))
17
+ throw new Error("The others arguments of unitLocate must be literals or stores");
18
+ const outFound = new values_1.TempValue(scope);
19
+ const outX = new values_1.TempValue(scope);
20
+ const outY = new values_1.TempValue(scope);
21
+ const outBuilding = new values_1.TempValue(scope);
22
+ const outArgs = [outX, outY, outFound, outBuilding];
23
+ let inputArgs = [];
24
+ switch (find.data) {
25
+ case "ore": {
26
+ const [ore] = args;
27
+ inputArgs = [find.data, "core", "true", ore];
28
+ break;
29
+ }
30
+ case "building": {
31
+ const [group, enemy] = args;
32
+ inputArgs = [find.data, group.data, enemy, "@copper"];
33
+ break;
34
+ }
35
+ case "spawn":
36
+ case "damaged": {
37
+ inputArgs = [find.data, "core", "true", "@copper"];
38
+ break;
39
+ }
40
+ }
41
+ return [
42
+ new values_1.ObjectValue(scope, {
43
+ 0: outFound,
44
+ 1: outX,
45
+ 2: outY,
46
+ 3: new Building_1.Building(scope, outBuilding.name),
47
+ length: new values_1.LiteralValue(scope, find.data === "ore" ? 3 : 4),
48
+ }),
49
+ [new instructions_1.InstructionBase("ulocate", ...inputArgs, ...outArgs)],
50
+ ];
51
+ });
52
+ }
53
+ }
54
+ exports.UnitLocate = UnitLocate;
55
55
  //# sourceMappingURL=UnitLocate.js.map
@@ -1,5 +1,5 @@
1
- import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
- export declare class UnitRadar extends MacroFunction {
4
- constructor(scope: IScope);
5
- }
1
+ import { MacroFunction } from "..";
2
+ import { IScope } from "../../types";
3
+ export declare class UnitRadar extends MacroFunction {
4
+ constructor(scope: IScope);
5
+ }
@@ -1,41 +1,41 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnitRadar = void 0;
4
- const instructions_1 = require("../../instructions");
5
- const __1 = require("..");
6
- const values_1 = require("../../values");
7
- const Radar_1 = require("./Radar");
8
- class UnitRadar extends __1.MacroFunction {
9
- constructor(scope) {
10
- super(scope, (filter1, filter2, filter3, order, sort) => {
11
- if (!(filter1 instanceof values_1.LiteralValue) ||
12
- typeof filter1.data !== "string" ||
13
- !(filter2 instanceof values_1.LiteralValue) ||
14
- typeof filter2.data !== "string" ||
15
- !(filter3 instanceof values_1.LiteralValue) ||
16
- typeof filter3.data !== "string")
17
- throw new Error("The filters must be string literals");
18
- if (!Radar_1.validRadarFilters.includes(filter1.data))
19
- throw new Error("Invalid value for filter1");
20
- if (!Radar_1.validRadarFilters.includes(filter2.data))
21
- throw new Error("Invalid value for filter2");
22
- if (!Radar_1.validRadarFilters.includes(filter3.data))
23
- throw new Error("Invalid value for filter3");
24
- if (!(order instanceof values_1.LiteralValue || order instanceof values_1.StoreValue))
25
- throw new Error("The radar order must be a literal or a store");
26
- if (!(sort instanceof values_1.LiteralValue) || typeof sort.data !== "string")
27
- throw new Error("The radar sort must be a string literal");
28
- if (!Radar_1.validRadarSorts.includes(sort.data))
29
- throw new Error("Invalid sort value");
30
- const temp = new values_1.TempValue(scope);
31
- return [
32
- temp,
33
- [
34
- new instructions_1.InstructionBase("uradar", filter1.data, filter2.data, filter3.data, order, sort.data, temp),
35
- ],
36
- ];
37
- });
38
- }
39
- }
40
- exports.UnitRadar = UnitRadar;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UnitRadar = void 0;
4
+ const instructions_1 = require("../../instructions");
5
+ const __1 = require("..");
6
+ const values_1 = require("../../values");
7
+ const Radar_1 = require("./Radar");
8
+ class UnitRadar extends __1.MacroFunction {
9
+ constructor(scope) {
10
+ super(scope, (filter1, filter2, filter3, order, sort) => {
11
+ if (!(filter1 instanceof values_1.LiteralValue) ||
12
+ typeof filter1.data !== "string" ||
13
+ !(filter2 instanceof values_1.LiteralValue) ||
14
+ typeof filter2.data !== "string" ||
15
+ !(filter3 instanceof values_1.LiteralValue) ||
16
+ typeof filter3.data !== "string")
17
+ throw new Error("The filters must be string literals");
18
+ if (!Radar_1.validRadarFilters.includes(filter1.data))
19
+ throw new Error("Invalid value for filter1");
20
+ if (!Radar_1.validRadarFilters.includes(filter2.data))
21
+ throw new Error("Invalid value for filter2");
22
+ if (!Radar_1.validRadarFilters.includes(filter3.data))
23
+ throw new Error("Invalid value for filter3");
24
+ if (!(order instanceof values_1.LiteralValue || order instanceof values_1.StoreValue))
25
+ throw new Error("The radar order must be a literal or a store");
26
+ if (!(sort instanceof values_1.LiteralValue) || typeof sort.data !== "string")
27
+ throw new Error("The radar sort must be a string literal");
28
+ if (!Radar_1.validRadarSorts.includes(sort.data))
29
+ throw new Error("Invalid sort value");
30
+ const temp = new values_1.TempValue(scope);
31
+ return [
32
+ temp,
33
+ [
34
+ new instructions_1.InstructionBase("uradar", filter1.data, filter2.data, filter3.data, order, sort.data, temp),
35
+ ],
36
+ ];
37
+ });
38
+ }
39
+ }
40
+ exports.UnitRadar = UnitRadar;
41
41
  //# sourceMappingURL=UnitRadar.js.map
@@ -1,5 +1,5 @@
1
- import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
- export declare class Wait extends MacroFunction {
4
- constructor(scope: IScope);
5
- }
1
+ import { MacroFunction } from "..";
2
+ import { IScope } from "../../types";
3
+ export declare class Wait extends MacroFunction {
4
+ constructor(scope: IScope);
5
+ }
@@ -1,18 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Wait = void 0;
4
- const instructions_1 = require("../../instructions");
5
- const __1 = require("..");
6
- const values_1 = require("../../values");
7
- class Wait extends __1.MacroFunction {
8
- constructor(scope) {
9
- super(scope, seconds => {
10
- if (!(seconds instanceof values_1.StoreValue) &&
11
- !(seconds instanceof values_1.LiteralValue && typeof seconds.data === "number"))
12
- throw new Error("The wait seconds must be either a number literal or a store");
13
- return [null, [new instructions_1.InstructionBase("wait", seconds)]];
14
- });
15
- }
16
- }
17
- exports.Wait = Wait;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Wait = void 0;
4
+ const instructions_1 = require("../../instructions");
5
+ const __1 = require("..");
6
+ const values_1 = require("../../values");
7
+ class Wait extends __1.MacroFunction {
8
+ constructor(scope) {
9
+ super(scope, seconds => {
10
+ if (!(seconds instanceof values_1.StoreValue) &&
11
+ !(seconds instanceof values_1.LiteralValue && typeof seconds.data === "number"))
12
+ throw new Error("The wait seconds must be either a number literal or a store");
13
+ return [null, [new instructions_1.InstructionBase("wait", seconds)]];
14
+ });
15
+ }
16
+ }
17
+ exports.Wait = Wait;
18
18
  //# sourceMappingURL=Wait.js.map
@@ -1,14 +1,14 @@
1
- export * from "./Draw";
2
- export * from "./Print";
3
- export * from "./PrintFlush";
4
- export * from "./DrawFlush";
5
- export * from "./GetLink";
6
- export * from "./Control";
7
- export { Radar } from "./Radar";
8
- export * from "./Sensor";
9
- export * from "./Wait";
10
- export * from "./Lookup";
11
- export * from "./UnitBind";
12
- export * from "./UnitControl";
13
- export * from "./UnitRadar";
14
- export * from "./UnitLocate";
1
+ export * from "./Draw";
2
+ export * from "./Print";
3
+ export * from "./PrintFlush";
4
+ export * from "./DrawFlush";
5
+ export * from "./GetLink";
6
+ export * from "./Control";
7
+ export { Radar } from "./Radar";
8
+ export * from "./Sensor";
9
+ export * from "./Wait";
10
+ export * from "./Lookup";
11
+ export * from "./UnitBind";
12
+ export * from "./UnitControl";
13
+ export * from "./UnitRadar";
14
+ export * from "./UnitLocate";
@@ -1,33 +1,33 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.Radar = void 0;
18
- __exportStar(require("./Draw"), exports);
19
- __exportStar(require("./Print"), exports);
20
- __exportStar(require("./PrintFlush"), exports);
21
- __exportStar(require("./DrawFlush"), exports);
22
- __exportStar(require("./GetLink"), exports);
23
- __exportStar(require("./Control"), exports);
24
- var Radar_1 = require("./Radar");
25
- Object.defineProperty(exports, "Radar", { enumerable: true, get: function () { return Radar_1.Radar; } });
26
- __exportStar(require("./Sensor"), exports);
27
- __exportStar(require("./Wait"), exports);
28
- __exportStar(require("./Lookup"), exports);
29
- __exportStar(require("./UnitBind"), exports);
30
- __exportStar(require("./UnitControl"), exports);
31
- __exportStar(require("./UnitRadar"), exports);
32
- __exportStar(require("./UnitLocate"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Radar = void 0;
18
+ __exportStar(require("./Draw"), exports);
19
+ __exportStar(require("./Print"), exports);
20
+ __exportStar(require("./PrintFlush"), exports);
21
+ __exportStar(require("./DrawFlush"), exports);
22
+ __exportStar(require("./GetLink"), exports);
23
+ __exportStar(require("./Control"), exports);
24
+ var Radar_1 = require("./Radar");
25
+ Object.defineProperty(exports, "Radar", { enumerable: true, get: function () { return Radar_1.Radar; } });
26
+ __exportStar(require("./Sensor"), exports);
27
+ __exportStar(require("./Wait"), exports);
28
+ __exportStar(require("./Lookup"), exports);
29
+ __exportStar(require("./UnitBind"), exports);
30
+ __exportStar(require("./UnitControl"), exports);
31
+ __exportStar(require("./UnitRadar"), exports);
32
+ __exportStar(require("./UnitLocate"), exports);
33
33
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
- export * from "./Function";
2
- export * from "./Math";
3
- export * from "./Other";
4
- export * as commands from "./commands";
5
- export * from "./Memory";
6
- export { BuildingBuilder } from "./Building";
7
- export { NamespaceMacro, VarsNamespace } from "./Namespace";
1
+ export * from "./Function";
2
+ export * from "./Math";
3
+ export * from "./Other";
4
+ export * as commands from "./commands";
5
+ export * from "./Memory";
6
+ export { BuildingBuilder } from "./Building";
7
+ export { NamespaceMacro, VarsNamespace } from "./Namespace";
@@ -1,40 +1,40 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
- };
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.VarsNamespace = exports.NamespaceMacro = exports.BuildingBuilder = exports.commands = void 0;
30
- __exportStar(require("./Function"), exports);
31
- __exportStar(require("./Math"), exports);
32
- __exportStar(require("./Other"), exports);
33
- exports.commands = __importStar(require("./commands"));
34
- __exportStar(require("./Memory"), exports);
35
- var Building_1 = require("./Building");
36
- Object.defineProperty(exports, "BuildingBuilder", { enumerable: true, get: function () { return Building_1.BuildingBuilder; } });
37
- var Namespace_1 = require("./Namespace");
38
- Object.defineProperty(exports, "NamespaceMacro", { enumerable: true, get: function () { return Namespace_1.NamespaceMacro; } });
39
- Object.defineProperty(exports, "VarsNamespace", { enumerable: true, get: function () { return Namespace_1.VarsNamespace; } });
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.VarsNamespace = exports.NamespaceMacro = exports.BuildingBuilder = exports.commands = void 0;
30
+ __exportStar(require("./Function"), exports);
31
+ __exportStar(require("./Math"), exports);
32
+ __exportStar(require("./Other"), exports);
33
+ exports.commands = __importStar(require("./commands"));
34
+ __exportStar(require("./Memory"), exports);
35
+ var Building_1 = require("./Building");
36
+ Object.defineProperty(exports, "BuildingBuilder", { enumerable: true, get: function () { return Building_1.BuildingBuilder; } });
37
+ var Namespace_1 = require("./Namespace");
38
+ Object.defineProperty(exports, "NamespaceMacro", { enumerable: true, get: function () { return Namespace_1.NamespaceMacro; } });
39
+ Object.defineProperty(exports, "VarsNamespace", { enumerable: true, get: function () { return Namespace_1.VarsNamespace; } });
40
40
  //# sourceMappingURL=index.js.map