@woosh/meep-engine 2.126.58 → 2.126.60
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.
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"description": "Pure JavaScript game engine. Fully featured and production ready.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": "Alexander Goldring",
|
|
8
|
-
"version": "2.126.
|
|
8
|
+
"version": "2.126.60",
|
|
9
9
|
"main": "build/meep.module.js",
|
|
10
10
|
"module": "build/meep.module.js",
|
|
11
11
|
"exports": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BinaryBuffer.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/BinaryBuffer.js"],"names":[],"mappings":"AA+BA;;;;;;;;;;;;;;;;;;GAkBG;AACH;
|
|
1
|
+
{"version":3,"file":"BinaryBuffer.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/BinaryBuffer.js"],"names":[],"mappings":"AA+BA;;;;;;;;;;;;;;;;;;GAkBG;AACH;IA8pCI;;;;OAIG;IACH,4BAHW,UAAU,GACT,YAAY,CAUvB;IAED;;;;OAIG;IACH,0BAHW,WAAW,GACV,YAAY,CAQvB;IAED;;;;;OAKG;IACH,8BAJW,YAAY,UACZ,YAAY,GACV,MAAM,CAQlB;IAED;;;;;OAKG;IACH,2BAJW,YAAY,UACZ,YAAY,GACV,MAAM,CAQlB;IAED;;;;;OAKG;IACH,yBAJW,YAAY,UACZ,YAAY,GACV,MAAM,CAQlB;IAED;;;;;OAKG;IACH,0BAJW,YAAY,UACZ,YAAY,GACV,MAAM,CAQlB;IAED;;;;;OAKG;IACH,0BAJW,YAAY,UACZ,YAAY,GACV,MAAM,CAQlB;IAED;;;;;OAKG;IACH,2BAJW,YAAY,UACZ,YAAY,GACV,MAAM,CAQlB;IAED;;;;;OAKG;IACH,2BAJW,YAAY,UACZ,YAAY,GACV,MAAM,CAQlB;IAED;;;;;;O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* @param {number} min_capacity
|
|
209
209
|
*/
|
|
210
210
|
ensureCapacity(min_capacity) {
|
|
211
|
+
assert.isNumber(min_capacity, 'min_capacity');
|
|
212
|
+
assert.greaterThanOrEqual(min_capacity, 0, 'min_capacity');
|
|
213
|
+
assert.notNaN(min_capacity, 'min_capacity');
|
|
214
|
+
|
|
211
215
|
const existing_capacity = this.capacity;
|
|
212
216
|
|
|
213
217
|
if (existing_capacity >= min_capacity) {
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
export default LineBuilder;
|
|
2
2
|
/**
|
|
3
|
-
* Useful for
|
|
3
|
+
* Useful for generating formatted snippets of code.
|
|
4
|
+
* @example
|
|
5
|
+
* const b = new LineBuilder();
|
|
6
|
+
* b.add("function hello(){");
|
|
7
|
+
* b.indent();
|
|
8
|
+
* b.add("return \"hello world\";");
|
|
9
|
+
* b.dedent();
|
|
10
|
+
* b.add("}");
|
|
11
|
+
* b.build();
|
|
12
|
+
* // function hello(){
|
|
13
|
+
* // return "hello world";
|
|
14
|
+
* // }
|
|
4
15
|
*/
|
|
5
16
|
declare class LineBuilder {
|
|
6
17
|
/**
|
|
@@ -17,9 +28,10 @@ declare class LineBuilder {
|
|
|
17
28
|
get indentation(): number;
|
|
18
29
|
/**
|
|
19
30
|
* TODO replace with indent string, that is tab, space or any combination or something else entirely
|
|
31
|
+
* @private
|
|
20
32
|
* @type {number}
|
|
21
33
|
*/
|
|
22
|
-
indentSpaces
|
|
34
|
+
private indentSpaces;
|
|
23
35
|
/**
|
|
24
36
|
* Number of lines
|
|
25
37
|
* @return {number}
|
|
@@ -42,17 +54,25 @@ declare class LineBuilder {
|
|
|
42
54
|
*/
|
|
43
55
|
dedent(): LineBuilder;
|
|
44
56
|
/**
|
|
45
|
-
* Adds an entire new line
|
|
57
|
+
* Adds an entire new line with a given text.
|
|
58
|
+
* Inherits the current indentation level.
|
|
46
59
|
* @param {string} line_text
|
|
47
60
|
* @returns {LineBuilder}
|
|
48
61
|
*/
|
|
49
62
|
add(line_text: string): LineBuilder;
|
|
50
63
|
/**
|
|
51
|
-
* Appends text to the last line
|
|
64
|
+
* Appends text to the last line.
|
|
65
|
+
*
|
|
66
|
+
* @param {string} text
|
|
67
|
+
* @returns {void}
|
|
68
|
+
* @example
|
|
69
|
+
* const b = new LineBuilder();
|
|
70
|
+
* b.add("hello");
|
|
71
|
+
* b.extend(" world");
|
|
72
|
+
* b.build(); // "hello world"
|
|
52
73
|
*
|
|
53
|
-
* @param text
|
|
54
74
|
*/
|
|
55
|
-
|
|
75
|
+
extend(text: string): void;
|
|
56
76
|
/**
|
|
57
77
|
*
|
|
58
78
|
* @param {LineBuilder} lines
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/codegen/LineBuilder.js"],"names":[],"mappings":";AAgCA
|
|
1
|
+
{"version":3,"file":"LineBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/codegen/LineBuilder.js"],"names":[],"mappings":";AAgCA;;;;;;;;;;;;;GAaG;AACH;IAkLI;;;;OAIG;IACH,sBAJW,MAAM,mBACN,MAAM,GACJ,WAAW,CAuBvB;IA9LD;;;;OAIG;IACH,0BAEC;IAED;;;;OAIG;IACH,qBAAqC;IAErC;;;OAGG;IACH,oBAEC;IAED;;;;OAIG;IACH,wBAFW,MAAM,GADL,OAAO,CAoBlB;IAED;;;OAGG;IACH,UAFa,WAAW,CAKvB;IAED;;;OAGG;IACH,UAFa,WAAW,CAQvB;IAED;;;;;OAKG;IACH,eAHW,MAAM,GACJ,WAAW,CASvB;IAED;;;;;;;;;;;OAWG;IACH,aATW,MAAM,GACJ,IAAI,CAmBhB;IAED;;;OAGG;IACH,gBAFW,WAAW,QAiBrB;IAED,cAGC;IAED;;;OAGG;IACH,SAFa,MAAM,CAyBlB;IA8BD,mBAEC;;CACJ"}
|
|
@@ -31,7 +31,18 @@ class Line {
|
|
|
31
31
|
const DEFAULT_INDENT_SPACES = 4;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* Useful for
|
|
34
|
+
* Useful for generating formatted snippets of code.
|
|
35
|
+
* @example
|
|
36
|
+
* const b = new LineBuilder();
|
|
37
|
+
* b.add("function hello(){");
|
|
38
|
+
* b.indent();
|
|
39
|
+
* b.add("return \"hello world\";");
|
|
40
|
+
* b.dedent();
|
|
41
|
+
* b.add("}");
|
|
42
|
+
* b.build();
|
|
43
|
+
* // function hello(){
|
|
44
|
+
* // return "hello world";
|
|
45
|
+
* // }
|
|
35
46
|
*/
|
|
36
47
|
class LineBuilder {
|
|
37
48
|
|
|
@@ -58,6 +69,7 @@ class LineBuilder {
|
|
|
58
69
|
|
|
59
70
|
/**
|
|
60
71
|
* TODO replace with indent string, that is tab, space or any combination or something else entirely
|
|
72
|
+
* @private
|
|
61
73
|
* @type {number}
|
|
62
74
|
*/
|
|
63
75
|
indentSpaces = DEFAULT_INDENT_SPACES;
|
|
@@ -116,7 +128,8 @@ class LineBuilder {
|
|
|
116
128
|
}
|
|
117
129
|
|
|
118
130
|
/**
|
|
119
|
-
* Adds an entire new line
|
|
131
|
+
* Adds an entire new line with a given text.
|
|
132
|
+
* Inherits the current indentation level.
|
|
120
133
|
* @param {string} line_text
|
|
121
134
|
* @returns {LineBuilder}
|
|
122
135
|
*/
|
|
@@ -130,19 +143,28 @@ class LineBuilder {
|
|
|
130
143
|
}
|
|
131
144
|
|
|
132
145
|
/**
|
|
133
|
-
* Appends text to the last line
|
|
146
|
+
* Appends text to the last line.
|
|
147
|
+
*
|
|
148
|
+
* @param {string} text
|
|
149
|
+
* @returns {void}
|
|
150
|
+
* @example
|
|
151
|
+
* const b = new LineBuilder();
|
|
152
|
+
* b.add("hello");
|
|
153
|
+
* b.extend(" world");
|
|
154
|
+
* b.build(); // "hello world"
|
|
134
155
|
*
|
|
135
|
-
* @param text
|
|
136
156
|
*/
|
|
137
|
-
|
|
157
|
+
extend(text) {
|
|
158
|
+
assert.isString(text, 'text');
|
|
159
|
+
|
|
138
160
|
const lines = this.#lines;
|
|
139
|
-
const
|
|
161
|
+
const last_index = lines.length - 1;
|
|
140
162
|
|
|
141
|
-
if (
|
|
163
|
+
if (last_index < 0) {
|
|
142
164
|
throw new Error("No lines to append to");
|
|
143
165
|
}
|
|
144
166
|
|
|
145
|
-
lines[
|
|
167
|
+
lines[last_index].text += text;
|
|
146
168
|
}
|
|
147
169
|
|
|
148
170
|
/**
|