bard-legends-framework 0.9.6 → 0.10.0
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/dist/_interfaces/index.d.ts +2 -2
- package/dist/_interfaces/index.js +2 -3
- package/dist/game-entities/attachable/attachable.d.ts +6 -6
- package/dist/game-entities/attachable/attachable.js +28 -30
- package/dist/game-entities/attachable/attachable.spec.js +129 -128
- package/dist/game-entities/attachable/attachable.store.d.ts +5 -5
- package/dist/game-entities/attachable/attachable.store.js +34 -32
- package/dist/game-entities/attachable/attachable.test.js +132 -131
- package/dist/game-entities/attachable/destroyable.d.ts +13 -13
- package/dist/game-entities/attachable/destroyable.js +64 -69
- package/dist/game-entities/attachable/helpers/decorate-actions-lib.d.ts +15 -15
- package/dist/game-entities/attachable/helpers/decorate-actions-lib.js +125 -116
- package/dist/game-entities/attachable/helpers/referance-variable.d.ts +15 -15
- package/dist/game-entities/attachable/helpers/referance-variable.js +47 -48
- package/dist/game-entities/attachable/interfaces.d.ts +6 -6
- package/dist/game-entities/attachable/interfaces.js +2 -3
- package/dist/game-entities/base/helpers/decorate-actions-lib.js +0 -1
- package/dist/game-entities/controller/controller.js +0 -1
- package/dist/game-entities/controller/controller.spec.js +128 -125
- package/dist/game-entities/entity/entity.d.ts +4 -1
- package/dist/game-entities/entity/entity.js +5 -5
- package/dist/game-entities/entity/entity.spec.js +263 -293
- package/dist/game-entities/entity/helpers/view-creation.helper.d.ts +7 -7
- package/dist/game-entities/entity/helpers/view-creation.helper.js +48 -48
- package/dist/game-entities/scene/scene.spec.js +219 -223
- package/dist/game-entities/service/service.js +0 -4
- package/dist/game-entities/service/service.spec.js +265 -237
- package/dist/game-entities/service/service.test.js +4 -2
- package/dist/game-entities/update-loop.d.ts +18 -18
- package/dist/game-entities/update-loop.js +46 -28
- package/dist/game-entities/view/view.spec.js +490 -506
- package/dist/game-entities/view/view.test.js +1 -1
- package/dist/lib/animator/animations.d.ts +13 -13
- package/dist/lib/animator/animations.js +43 -40
- package/dist/lib/animator/animator.d.ts +41 -41
- package/dist/lib/animator/animator.js +194 -197
- package/dist/lib/animator/animator.spec.js +699 -612
- package/dist/lib/animator/index.js +24 -19
- package/dist/lib/libraries/animator/animations.d.ts +13 -13
- package/dist/lib/libraries/animator/animations.js +43 -40
- package/dist/lib/libraries/animator/animator.d.ts +41 -41
- package/dist/lib/libraries/animator/animator.js +194 -197
- package/dist/lib/libraries/animator/animator.spec.js +699 -612
- package/dist/lib/libraries/animator/index.js +24 -19
- package/dist/lib/libraries/path-finder/path-finder.d.ts +2 -2
- package/dist/lib/libraries/path-finder/path-finder.js +19 -20
- package/dist/lib/path-finder/path-finder.d.ts +2 -2
- package/dist/lib/path-finder/path-finder.js +19 -20
- package/dist/lib/services/keyboard/keyboard.d.ts +4 -4
- package/dist/lib/services/keyboard/keyboard.js +39 -31
- package/dist/lib/services/mouse/mouse.service.d.ts +8 -8
- package/dist/lib/services/mouse/mouse.service.js +65 -53
- package/dist/lib/services/mouse/mouser-target-focus.service.d.ts +11 -11
- package/dist/lib/services/mouse/mouser-target-focus.service.js +83 -81
- package/dist/lib/update-loop.d.ts +10 -10
- package/dist/lib/update-loop.js +35 -27
- package/dist/physics/entitity-types/immovable-physics-entity.d.ts +6 -6
- package/dist/physics/entitity-types/immovable-physics-entity.js +23 -24
- package/dist/physics/entitity-types/movable-entity.d.ts +6 -6
- package/dist/physics/entitity-types/movable-entity.js +21 -22
- package/dist/physics/entitity-types/movable-physics-entity.d.ts +14 -14
- package/dist/physics/entitity-types/movable-physics-entity.js +83 -88
- package/dist/physics/entitity-types/physics-entity.d.ts +23 -23
- package/dist/physics/entitity-types/physics-entity.js +97 -88
- package/dist/physics/helpers/closest-available-space.helper.d.ts +16 -16
- package/dist/physics/helpers/closest-available-space.helper.js +98 -96
- package/dist/physics/helpers/closest-available-space.helper.spec.js +115 -68
- package/dist/physics/helpers/p2js.helper.d.ts +3 -3
- package/dist/physics/helpers/p2js.helper.js +21 -22
- package/dist/physics/helpers/shape-factory.d.ts +9 -4
- package/dist/physics/helpers/shape-factory.js +99 -75
- package/dist/physics/libs/p2js.helper.js +1 -1
- package/dist/physics/libs/position-to-grid-position-converter.d.ts +3 -3
- package/dist/physics/libs/position-to-grid-position-converter.js +15 -13
- package/dist/physics/module//360/237/223/220services/availability-grid.service.d.ts +10 -5
- package/dist/physics/module//360/237/223/220services/availability-grid.service.js +77 -57
- package/dist/physics/module//360/237/223/220services/border.service.d.ts +2 -2
- package/dist/physics/module//360/237/223/220services/border.service.js +57 -37
- package/dist/physics/module//360/237/223/220services/collision/physics-body-group.service.js +1 -1
- package/dist/physics/module//360/237/223/220services/collisions.service.d.ts +7 -7
- package/dist/physics/module//360/237/223/220services/collisions.service.js +110 -98
- package/dist/physics/module//360/237/223/220services/debug-visuals.service.d.ts +28 -6
- package/dist/physics/module//360/237/223/220services/debug-visuals.service.js +121 -89
- package/dist/physics/module//360/237/223/220services/eliptic-explosion.service.d.ts +15 -7
- package/dist/physics/module//360/237/223/220services/eliptic-explosion.service.js +117 -93
- package/dist/physics/module//360/237/223/220services/explosion.service.d.ts +14 -7
- package/dist/physics/module//360/237/223/220services/explosion.service.js +102 -77
- package/dist/physics/module//360/237/223/220services/explosions/eliptic-explosion.service.d.ts +15 -7
- package/dist/physics/module//360/237/223/220services/explosions/eliptic-explosion.service.js +117 -93
- package/dist/physics/module//360/237/223/220services/explosions/explosion.service.d.ts +14 -7
- package/dist/physics/module//360/237/223/220services/explosions/explosion.service.js +102 -77
- package/dist/physics/module//360/237/223/220services/explosions/helpers/ray-cast-hit-converter.d.ts +3 -3
- package/dist/physics/module//360/237/223/220services/explosions/helpers/ray-cast-hit-converter.js +71 -67
- package/dist/physics/module//360/237/223/220services/helpers/ray-cast-hit-converter.d.ts +3 -3
- package/dist/physics/module//360/237/223/220services/helpers/ray-cast-hit-converter.js +71 -67
- package/dist/physics/module//360/237/223/220services/impact/eliptic-explosion.service.js +1 -1
- package/dist/physics/module//360/237/223/220services/materials.service.d.ts +16 -11
- package/dist/physics/module//360/237/223/220services/materials.service.js +118 -108
- package/dist/physics/module//360/237/223/220services/path-finder.service.d.ts +19 -8
- package/dist/physics/module//360/237/223/220services/path-finder.service.js +121 -82
- package/dist/physics/module//360/237/223/220services/physics-world.service.d.ts +30 -15
- package/dist/physics/module//360/237/223/220services/physics-world.service.js +122 -100
- package/dist/physics/module//360/237/223/220services/ray-casting.service.d.ts +3 -3
- package/dist/physics/module//360/237/223/220services/ray-casting.service.js +87 -86
- package/dist/physics/module//360/237/223/220services/shape-creation.service.d.ts +9 -4
- package/dist/physics/module//360/237/223/220services/shape-creation.service.js +113 -84
- package/dist/physics/module//360/237/223/220services/test-visuals/test-visuals.service.js +2 -1
- package/dist/physics/module//360/237/247/212entities/data-structures/availability-grid-cache.d.ts +8 -8
- package/dist/physics/module//360/237/247/212entities/data-structures/availability-grid-cache.js +32 -33
- package/dist/physics/physics-world.d.ts +50 -34
- package/dist/physics/physics-world.js +142 -133
- package/dist/physics/sub-elements/available-spaces/helpers/availability-grid.helper.d.ts +3 -3
- package/dist/physics/sub-elements/available-spaces/helpers/availability-grid.helper.js +15 -13
- package/dist/physics/sub-elements/available-spaces/physics-availability-grid.d.ts +9 -9
- package/dist/physics/sub-elements/available-spaces/physics-availability-grid.js +82 -77
- package/dist/physics/sub-elements/available-spaces/physics-available-spaces.d.ts +18 -14
- package/dist/physics/sub-elements/available-spaces/physics-available-spaces.js +91 -79
- package/dist/physics/sub-elements/collisions/contact-equation-orginiser.d.ts +11 -11
- package/dist/physics/sub-elements/collisions/contact-equation-orginiser.js +84 -76
- package/dist/physics/sub-elements/collisions/physics-collision.d.ts +7 -7
- package/dist/physics/sub-elements/collisions/physics-collision.js +43 -44
- package/dist/physics/sub-elements/elements/physics-body-groups.d.ts +11 -11
- package/dist/physics/sub-elements/elements/physics-body-groups.js +54 -54
- package/dist/physics/sub-elements/elements/physics-materials.d.ts +15 -10
- package/dist/physics/sub-elements/elements/physics-materials.js +101 -100
- package/dist/physics/sub-elements/elements/physics-world-borders.d.ts +3 -3
- package/dist/physics/sub-elements/elements/physics-world-borders.js +69 -45
- package/dist/physics/sub-elements/physics-body-groups.d.ts +8 -8
- package/dist/physics/sub-elements/physics-body-groups.js +41 -42
- package/dist/physics/sub-elements/physics-collision.d.ts +16 -16
- package/dist/physics/sub-elements/physics-collision.js +141 -121
- package/dist/physics/sub-elements/physics-materials.d.ts +15 -10
- package/dist/physics/sub-elements/physics-materials.js +101 -100
- package/dist/physics/sub-elements/physics-world-borders.d.ts +2 -2
- package/dist/physics/sub-elements/physics-world-borders.js +25 -26
- package/dist/physics/sub-elements/raycasting/physics-body-explosion-hit.d.ts +15 -11
- package/dist/physics/sub-elements/raycasting/physics-body-explosion-hit.js +59 -59
- package/dist/physics/sub-elements/raycasting/physics-explosion.d.ts +13 -6
- package/dist/physics/sub-elements/raycasting/physics-explosion.js +108 -73
- package/dist/physics/sub-elements/raycasting/ray-cast.d.ts +19 -19
- package/dist/physics/sub-elements/raycasting/ray-cast.js +93 -98
- package/dist/pixi/display-object/components/filters.d.ts +18 -18
- package/dist/pixi/display-object/components/filters.js +106 -81
- package/dist/pixi/display-object/components/glow-effect.d.ts +8 -8
- package/dist/pixi/display-object/components/glow-effect.js +33 -36
- package/dist/pixi/display-object/components/glow-filter.d.ts +8 -8
- package/dist/pixi/display-object/components/glow-filter.js +33 -36
- package/dist/pixi/display-object/container-attributes.js +1 -1
- package/dist/pixi/display-object/display-object-attributes.d.ts +41 -41
- package/dist/pixi/display-object/display-object-attributes.js +148 -150
- package/dist/pixi/display-object/display-object.d.ts +17 -17
- package/dist/pixi/display-object/display-object.js +79 -75
- package/dist/pixi/display-object/filters/base-filters/alpha-primer-color.filter.d.ts +9 -4
- package/dist/pixi/display-object/filters/base-filters/alpha-primer-color.filter.js +89 -77
- package/dist/pixi/display-object/filters/base-filters/blur.filter.js +30 -30
- package/dist/pixi/display-object/filters/base-filters/contrast-filter.d.ts +9 -4
- package/dist/pixi/display-object/filters/base-filters/contrast-filter.js +62 -53
- package/dist/pixi/display-object/filters/base-filters/expand-with-alpha-color.d.ts +10 -5
- package/dist/pixi/display-object/filters/base-filters/expand-with-alpha-color.js +93 -81
- package/dist/pixi/display-object/filters/base-filters/expand-with-color-gradient.d.ts +12 -7
- package/dist/pixi/display-object/filters/base-filters/expand-with-color-gradient.js +120 -109
- package/dist/pixi/display-object/filters/base-filters/expand-with-color.d.ts +10 -5
- package/dist/pixi/display-object/filters/base-filters/expand-with-color.filter.js +32 -32
- package/dist/pixi/display-object/filters/base-filters/expand-with-color.js +92 -85
- package/dist/pixi/display-object/filters/templates/checking-neighbors.template.js +28 -28
- package/dist/pixi/display-object/filters/templates/plane.template.js +20 -20
- package/dist/pixi/display-object/filters.js +20 -4
- package/dist/pixi/display-object/objects/components/filters.d.ts +18 -18
- package/dist/pixi/display-object/objects/components/filters.js +106 -81
- package/dist/pixi/display-object/objects/container.d.ts +2 -2
- package/dist/pixi/display-object/objects/container.js +39 -30
- package/dist/pixi/display-object/objects/graphics.d.ts +28 -28
- package/dist/pixi/display-object/objects/graphics.js +218 -202
- package/dist/pixi/display-object/objects/helpers/filters.d.ts +25 -25
- package/dist/pixi/display-object/objects/helpers/filters.js +150 -124
- package/dist/pixi/display-object/objects/helpers/glow-sprite-generator.d.ts +7 -7
- package/dist/pixi/display-object/objects/helpers/glow-sprite-generator.js +114 -95
- package/dist/pixi/display-object/objects/premade-objects/sprite-with-glowing-shapes.d.ts +5 -5
- package/dist/pixi/display-object/objects/premade-objects/sprite-with-glowing-shapes.js +81 -57
- package/dist/pixi/display-object/objects/sprite.d.ts +43 -43
- package/dist/pixi/display-object/objects/sprite.js +248 -233
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.js +1 -1
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.test.js +9 -9
- package/dist/pixi/display-object/objects/text/helpers/rich-text-to-plane-text.d.ts +1 -1
- package/dist/pixi/display-object/objects/text.d.ts +25 -25
- package/dist/pixi/display-object/objects/text.js +111 -102
- package/dist/pixi/display-object/premade-objects/sprite-with-glowing-shapes.d.ts +13 -9
- package/dist/pixi/display-object/premade-objects/sprite-with-glowing-shapes.js +96 -67
- package/dist/pixi/game.d.ts +1 -1
- package/dist/pixi/game.js +2 -2
- package/dist/pixi/helpers/glow-sprite-generator.d.ts +6 -6
- package/dist/pixi/helpers/glow-sprite-generator.js +99 -84
- package/dist/pixi/helpers/pixi-container.helper.d.ts +1 -1
- package/dist/pixi/helpers/pixi-container.helper.js +10 -8
- package/dist/pixi/helpers/screen-position-to-stage.helper.d.ts +1 -1
- package/dist/pixi/helpers/screen-position-to-stage.helper.js +12 -12
- package/dist/pixi/helpers/screen-position-to-stage.helper.test.js +174 -79
- package/dist/pixi/modules/CAMERA/index.d.ts +1 -1
- package/dist/pixi/modules/CAMERA/index.js +3 -3
- package/dist/pixi/modules/CAMERA//360/237/247/212entities/camera.entity.js +1 -1
- package/dist/services/keyboard/keyboard.d.ts +4 -4
- package/dist/services/keyboard/keyboard.js +39 -31
- package/dist/services/mouse/mouse.service.d.ts +8 -8
- package/dist/services/mouse/mouse.service.js +65 -53
- package/dist/services/mouse/mouser-target-focus.service.d.ts +11 -11
- package/dist/services/mouse/mouser-target-focus.service.js +83 -81
- package/dist/utilities/libraries/animator/animating-content/state-animation.d.ts +29 -26
- package/dist/utilities/libraries/animator/animating-content/state-animation.js +159 -165
- package/dist/utilities/libraries/animator/animating-content/state-animation.test.js +386 -375
- package/dist/utilities/libraries/animator/animator.spec.js +765 -656
- package/dist/utilities/libraries/binary-heap/binary-heap.d.ts +11 -11
- package/dist/utilities/libraries/binary-heap/binary-heap.js +79 -81
- package/dist/utilities/libraries/data-structures/binary-heap/binary-heap.d.ts +11 -11
- package/dist/utilities/libraries/data-structures/binary-heap/binary-heap.js +79 -81
- package/dist/utilities/libraries/data-structures/grid/grid.d.ts +35 -31
- package/dist/utilities/libraries/data-structures/grid/grid.js +128 -117
- package/dist/utilities/libraries/data-structures/grid/grid.spec.js +176 -138
- package/dist/utilities/libraries/data-structures/grid/grid.test.js +218 -141
- package/dist/utilities/libraries/data-structures/grid/position-to-grid-position-converter.d.ts +3 -3
- package/dist/utilities/libraries/data-structures/grid/position-to-grid-position-converter.js +15 -13
- package/dist/utilities/libraries/data-structures/queue/queue.d.ts +21 -21
- package/dist/utilities/libraries/data-structures/queue/queue.js +63 -66
- package/dist/utilities/libraries/data-structures/queue/queue.test.js +54 -55
- package/dist/utilities/libraries/grid-algorithms/closest-available-space/closest-available-space.helper.spec.js +122 -68
- package/dist/utilities/libraries/grid-algorithms/path-finder/path-finder.spec.js +140 -135
- package/dist/utilities/libraries/grid-algorithms/vector-field-path-finder/vector-field-path-finder.spec.js +293 -229
- package/dist/utilities/libraries/path-finder/path-finder.d.ts +7 -7
- package/dist/utilities/libraries/path-finder/path-finder.js +113 -109
- package/dist/utilities/libraries/path-finder/path-finder.spec.js +131 -106
- package/dist/utilities/services/keyboard/keyboard.d.ts +4 -4
- package/dist/utilities/services/keyboard/keyboard.js +42 -34
- package/dist/utilities/services/mouse/helpers/mouse-position.helper.d.ts +1 -1
- package/dist/utilities/services/mouse/helpers/mouse-position.helper.js +12 -12
- package/dist/utilities/services/mouse/helpers/mouse-position.helper.test.js +168 -73
- package/dist/utilities/services/mouse/mouse-target-focus.service.d.ts +15 -15
- package/dist/utilities/services/mouse/mouse-target-focus.service.js +79 -76
- package/dist/utilities/services/mouse/mouse.service.d.ts +9 -9
- package/dist/utilities/services/mouse/mouse.service.js +86 -72
- package/dist/utilities/services/mouse/mouser-target-focus.service.d.ts +11 -11
- package/dist/utilities/services/mouse/mouser-target-focus.service.js +83 -81
- package/package.json +8 -13
|
@@ -1,143 +1,220 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const grid_1 = require("./grid");
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
const helpers_lib_1 = require('helpers-lib');
|
|
3
|
+
const vitest_1 = require('vitest');
|
|
4
|
+
const grid_1 = require('./grid');
|
|
6
5
|
(0, vitest_1.describe)('Grid', () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
6
|
+
let grid;
|
|
7
|
+
(0, vitest_1.beforeEach)(() => {
|
|
8
|
+
grid = grid_1.Grid.createNew(new helpers_lib_1.Vector(3, 3), true);
|
|
9
|
+
});
|
|
10
|
+
(0, vitest_1.test)('should be defined', () => {
|
|
11
|
+
(0, vitest_1.expect)(grid).toBeDefined();
|
|
12
|
+
});
|
|
13
|
+
(0, vitest_1.test)('should set and get values', () => {
|
|
14
|
+
grid.setArea(new helpers_lib_1.Rectangle(new helpers_lib_1.Vector(0, 0), new helpers_lib_1.Vector(1, 1)), false);
|
|
15
|
+
(0, vitest_1.expect)(grid.get(new helpers_lib_1.Vector(0, 0))).toBeFalsy();
|
|
16
|
+
(0, vitest_1.expect)(grid.get(new helpers_lib_1.Vector(0, 1))).toBeFalsy();
|
|
17
|
+
(0, vitest_1.expect)(grid.get(new helpers_lib_1.Vector(1, 0))).toBeFalsy();
|
|
18
|
+
(0, vitest_1.expect)(grid.get(new helpers_lib_1.Vector(1, 1))).toBeFalsy();
|
|
19
|
+
});
|
|
20
|
+
(0, vitest_1.test)('should throw an error if area is outside of the grid', () => {
|
|
21
|
+
(0, vitest_1.expect)(() =>
|
|
22
|
+
grid.setArea(new helpers_lib_1.Rectangle(new helpers_lib_1.Vector(0, 0), new helpers_lib_1.Vector(3, 3)), false)
|
|
23
|
+
).toThrow();
|
|
24
|
+
});
|
|
25
|
+
(0, vitest_1.test)('should crop area outside of the grid 1', () => {
|
|
26
|
+
(0, vitest_1.expect)(
|
|
27
|
+
grid
|
|
28
|
+
.cropPartsOutsideOfTheGrid(new helpers_lib_1.Rectangle(new helpers_lib_1.Vector(-1, -1), new helpers_lib_1.Vector(3, 3)))
|
|
29
|
+
.toRect()
|
|
30
|
+
).toStrictEqual({
|
|
31
|
+
topLeft: { x: 0, y: 0 },
|
|
32
|
+
bottomRight: { x: 2, y: 2 }
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
(0, vitest_1.test)('should crop area outside of the grid 2', () => {
|
|
36
|
+
(0, vitest_1.expect)(
|
|
37
|
+
grid
|
|
38
|
+
.cropPartsOutsideOfTheGrid(new helpers_lib_1.Rectangle(new helpers_lib_1.Vector(3, 3), new helpers_lib_1.Vector(4, 4)))
|
|
39
|
+
.toRect()
|
|
40
|
+
).toStrictEqual({
|
|
41
|
+
topLeft: { x: 2, y: 2 },
|
|
42
|
+
bottomRight: { x: 2, y: 2 }
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
(0, vitest_1.test)('should crop area outside of the grid 2', () => {
|
|
46
|
+
(0, vitest_1.expect)(
|
|
47
|
+
grid
|
|
48
|
+
.cropPartsOutsideOfTheGrid(
|
|
49
|
+
new helpers_lib_1.Rectangle(new helpers_lib_1.Vector(-1, -1), new helpers_lib_1.Vector(-1, -1))
|
|
50
|
+
)
|
|
51
|
+
.toRect()
|
|
52
|
+
).toStrictEqual({
|
|
53
|
+
topLeft: { x: 0, y: 0 },
|
|
54
|
+
bottomRight: { x: 0, y: 0 }
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
(0, vitest_1.test)('should check if area is within bounds', () => {
|
|
58
|
+
(0, vitest_1.expect)(
|
|
59
|
+
grid.isAreaWithinBounds(new helpers_lib_1.Rectangle(new helpers_lib_1.Vector(0, 0), new helpers_lib_1.Vector(1, 1)))
|
|
60
|
+
).toBeTruthy();
|
|
61
|
+
(0, vitest_1.expect)(
|
|
62
|
+
grid.isAreaWithinBounds(new helpers_lib_1.Rectangle(new helpers_lib_1.Vector(0, 0), new helpers_lib_1.Vector(3, 3)))
|
|
63
|
+
).toBeFalsy();
|
|
64
|
+
});
|
|
65
|
+
(0, vitest_1.test)('should check if point is within bounds', () => {
|
|
66
|
+
(0, vitest_1.expect)(grid.isPointWithinBounds(new helpers_lib_1.Vector(0, 0))).toBeTruthy();
|
|
67
|
+
(0, vitest_1.expect)(grid.isPointWithinBounds(new helpers_lib_1.Vector(1, 1))).toBeTruthy();
|
|
68
|
+
(0, vitest_1.expect)(grid.isPointWithinBounds(new helpers_lib_1.Vector(3, 3))).toBeFalsy();
|
|
69
|
+
});
|
|
70
|
+
(0, vitest_1.test)('should set area within bounds', () => {
|
|
71
|
+
grid.safeSetArea(new helpers_lib_1.Rectangle(new helpers_lib_1.Vector(0, 0), new helpers_lib_1.Vector(3, 3)), false);
|
|
72
|
+
(0, vitest_1.expect)(grid.get(new helpers_lib_1.Vector(0, 0))).toBeFalsy();
|
|
73
|
+
(0, vitest_1.expect)(grid.get(new helpers_lib_1.Vector(0, 1))).toBeFalsy();
|
|
74
|
+
(0, vitest_1.expect)(grid.get(new helpers_lib_1.Vector(1, 0))).toBeFalsy();
|
|
75
|
+
(0, vitest_1.expect)(grid.get(new helpers_lib_1.Vector(1, 1))).toBeFalsy();
|
|
76
|
+
});
|
|
77
|
+
(0, vitest_1.test)('should return neighbor positions only adjacent', () => {
|
|
78
|
+
(0, vitest_1.expect)(grid.getNeighborPositions(new helpers_lib_1.Vector(1, 1)).map(item => item.toVec2())).toStrictEqual([
|
|
79
|
+
{ x: 0, y: 1 },
|
|
80
|
+
{ x: 1, y: 0 },
|
|
81
|
+
{ x: 1, y: 2 },
|
|
82
|
+
{ x: 2, y: 1 }
|
|
83
|
+
]);
|
|
84
|
+
});
|
|
85
|
+
(0, vitest_1.test)('should return neighbor positions with diagonals', () => {
|
|
86
|
+
(0, vitest_1.expect)(
|
|
87
|
+
grid
|
|
88
|
+
.getNeighborPositions(new helpers_lib_1.Vector(1, 1), {
|
|
89
|
+
includeDiagonals: true
|
|
90
|
+
})
|
|
91
|
+
.map(item => item.toVec2())
|
|
92
|
+
).toStrictEqual([
|
|
93
|
+
{ x: 0, y: 1 },
|
|
94
|
+
{ x: 1, y: 0 },
|
|
95
|
+
{ x: 1, y: 2 },
|
|
96
|
+
{ x: 2, y: 1 },
|
|
97
|
+
{ x: 0, y: 0 },
|
|
98
|
+
{ x: 0, y: 2 },
|
|
99
|
+
{ x: 2, y: 0 },
|
|
100
|
+
{ x: 2, y: 2 }
|
|
101
|
+
]);
|
|
102
|
+
});
|
|
103
|
+
(0, vitest_1.test)('should return neighbor positions only adjacent at the edge', () => {
|
|
104
|
+
(0, vitest_1.expect)(grid.getNeighborPositions(new helpers_lib_1.Vector(2, 2)).map(item => item.toVec2())).toStrictEqual([
|
|
105
|
+
{ x: 1, y: 2 },
|
|
106
|
+
{ x: 2, y: 1 }
|
|
107
|
+
]);
|
|
108
|
+
});
|
|
109
|
+
(0, vitest_1.test)('should return neighbor positions at the edge with diagonals', () => {
|
|
110
|
+
(0, vitest_1.expect)(
|
|
111
|
+
grid
|
|
112
|
+
.getNeighborPositions(new helpers_lib_1.Vector(0, 0), {
|
|
113
|
+
includeDiagonals: true
|
|
114
|
+
})
|
|
115
|
+
.map(item => item.toVec2())
|
|
116
|
+
).toStrictEqual([
|
|
117
|
+
{ x: 0, y: 1 },
|
|
118
|
+
{ x: 1, y: 0 },
|
|
119
|
+
{ x: 1, y: 1 }
|
|
120
|
+
]);
|
|
121
|
+
});
|
|
122
|
+
(0, vitest_1.test)('should iterate over all values', () => {
|
|
123
|
+
grid.setArea(new helpers_lib_1.Rectangle(new helpers_lib_1.Vector(1, 0), new helpers_lib_1.Vector(1, 1)), false);
|
|
124
|
+
const values = [];
|
|
125
|
+
grid.forEach((value, position) => values.push({ value, position }));
|
|
126
|
+
(0, vitest_1.expect)(
|
|
127
|
+
values.map(item => ({
|
|
128
|
+
value: item.value,
|
|
129
|
+
position: item.position.toVec2()
|
|
130
|
+
}))
|
|
131
|
+
).toStrictEqual([
|
|
132
|
+
{ value: true, position: { x: 0, y: 0 } },
|
|
133
|
+
{ value: false, position: { x: 1, y: 0 } },
|
|
134
|
+
{ value: true, position: { x: 2, y: 0 } },
|
|
135
|
+
{ value: true, position: { x: 0, y: 1 } },
|
|
136
|
+
{ value: false, position: { x: 1, y: 1 } },
|
|
137
|
+
{ value: true, position: { x: 2, y: 1 } },
|
|
138
|
+
{ value: true, position: { x: 0, y: 2 } },
|
|
139
|
+
{ value: true, position: { x: 1, y: 2 } },
|
|
140
|
+
{ value: true, position: { x: 2, y: 2 } }
|
|
141
|
+
]);
|
|
142
|
+
});
|
|
143
|
+
(0, vitest_1.test)('should map over all values', () => {
|
|
144
|
+
grid.setArea(new helpers_lib_1.Rectangle(new helpers_lib_1.Vector(1, 0), new helpers_lib_1.Vector(1, 1)), false);
|
|
145
|
+
const newGrid = grid.map((value, position) => (position.x + position.y) * (value ? 1 : -1));
|
|
146
|
+
(0, vitest_1.expect)(newGrid.get(new helpers_lib_1.Vector(0, 0))).toBe(0);
|
|
147
|
+
(0, vitest_1.expect)(newGrid.get(new helpers_lib_1.Vector(1, 0))).toBe(-1);
|
|
148
|
+
(0, vitest_1.expect)(newGrid.get(new helpers_lib_1.Vector(2, 0))).toBe(2);
|
|
149
|
+
(0, vitest_1.expect)(newGrid.get(new helpers_lib_1.Vector(0, 1))).toBe(1);
|
|
150
|
+
(0, vitest_1.expect)(newGrid.get(new helpers_lib_1.Vector(1, 1))).toBe(-2);
|
|
151
|
+
(0, vitest_1.expect)(newGrid.get(new helpers_lib_1.Vector(2, 1))).toBe(3);
|
|
152
|
+
(0, vitest_1.expect)(newGrid.get(new helpers_lib_1.Vector(0, 2))).toBe(2);
|
|
153
|
+
(0, vitest_1.expect)(newGrid.get(new helpers_lib_1.Vector(1, 2))).toBe(3);
|
|
154
|
+
(0, vitest_1.expect)(newGrid.get(new helpers_lib_1.Vector(2, 2))).toBe(4);
|
|
155
|
+
(0, vitest_1.expect)(newGrid.size.toVec2()).toStrictEqual({ x: 3, y: 3 });
|
|
156
|
+
});
|
|
157
|
+
(0, vitest_1.test)('should find the neighbor direction from a vector', () => {
|
|
158
|
+
(0, vitest_1.expect)(grid_1.Grid.vectorToNeighborDirection(new helpers_lib_1.Vector(0, 1)).toVec2()).toStrictEqual({
|
|
159
|
+
x: 0,
|
|
160
|
+
y: 1
|
|
161
|
+
});
|
|
162
|
+
(0, vitest_1.expect)(grid_1.Grid.vectorToNeighborDirection(new helpers_lib_1.Vector(1, 0)).toVec2()).toStrictEqual({
|
|
163
|
+
x: 1,
|
|
164
|
+
y: 0
|
|
165
|
+
});
|
|
166
|
+
(0, vitest_1.expect)(grid_1.Grid.vectorToNeighborDirection(new helpers_lib_1.Vector(0, -1)).toVec2()).toStrictEqual({
|
|
167
|
+
x: 0,
|
|
168
|
+
y: -1
|
|
169
|
+
});
|
|
170
|
+
(0, vitest_1.expect)(grid_1.Grid.vectorToNeighborDirection(new helpers_lib_1.Vector(-1, 0)).toVec2()).toStrictEqual({
|
|
171
|
+
x: -1,
|
|
172
|
+
y: 0
|
|
173
|
+
});
|
|
174
|
+
(0, vitest_1.expect)(grid_1.Grid.vectorToNeighborDirection(new helpers_lib_1.Vector(0.5, 2)).toVec2()).toStrictEqual({
|
|
175
|
+
x: 0,
|
|
176
|
+
y: 1
|
|
177
|
+
});
|
|
178
|
+
(0, vitest_1.expect)(grid_1.Grid.vectorToNeighborDirection(new helpers_lib_1.Vector(2, -0.5)).toVec2()).toStrictEqual({
|
|
179
|
+
x: 1,
|
|
180
|
+
y: -0
|
|
181
|
+
});
|
|
182
|
+
(0, vitest_1.expect)(grid_1.Grid.vectorToNeighborDirection(new helpers_lib_1.Vector(0.5, -2)).toVec2()).toStrictEqual({
|
|
183
|
+
x: 0,
|
|
184
|
+
y: -1
|
|
185
|
+
});
|
|
186
|
+
(0, vitest_1.expect)(grid_1.Grid.vectorToNeighborDirection(new helpers_lib_1.Vector(-2, -0.5)).toVec2()).toStrictEqual({
|
|
187
|
+
x: -1,
|
|
188
|
+
y: -0
|
|
189
|
+
});
|
|
190
|
+
const middle = grid_1.Grid.vectorToNeighborDirection(new helpers_lib_1.Vector(1, 1));
|
|
191
|
+
(0, vitest_1.expect)(
|
|
192
|
+
helpers_lib_1.Vector.isEqual(middle, new helpers_lib_1.Vector(0, 1)) ||
|
|
193
|
+
helpers_lib_1.Vector.isEqual(middle, new helpers_lib_1.Vector(1, 0))
|
|
194
|
+
).toBeTruthy();
|
|
195
|
+
});
|
|
196
|
+
(0, vitest_1.test)('should find the neighbor direction with diagonals from a vector', () => {
|
|
197
|
+
(0, vitest_1.expect)(
|
|
198
|
+
grid_1.Grid.vectorToNeighborDirection(new helpers_lib_1.Vector(0, 1), {
|
|
199
|
+
includeDiagonals: true
|
|
200
|
+
}).toVec2()
|
|
201
|
+
).toStrictEqual({ x: 0, y: 1 });
|
|
202
|
+
(0, vitest_1.expect)(
|
|
203
|
+
grid_1.Grid.vectorToNeighborDirection(new helpers_lib_1.Vector(1, 1), {
|
|
204
|
+
includeDiagonals: true
|
|
205
|
+
}).toVec2()
|
|
206
|
+
).toStrictEqual({ x: 1, y: 1 });
|
|
207
|
+
(0, vitest_1.expect)(
|
|
208
|
+
grid_1.Grid.vectorToNeighborDirection(new helpers_lib_1.Vector(-1, -1), { includeDiagonals: true }).toVec2()
|
|
209
|
+
).toStrictEqual({
|
|
210
|
+
x: -1,
|
|
211
|
+
y: -1
|
|
212
|
+
});
|
|
213
|
+
(0, vitest_1.expect)(
|
|
214
|
+
grid_1.Grid.vectorToNeighborDirection(new helpers_lib_1.Vector(2, 1), {
|
|
215
|
+
includeDiagonals: true
|
|
216
|
+
}).toVec2()
|
|
217
|
+
).toStrictEqual({ x: 1, y: 0 });
|
|
218
|
+
});
|
|
142
219
|
});
|
|
143
|
-
//# sourceMappingURL=grid.test.js.map
|
|
220
|
+
//# sourceMappingURL=grid.test.js.map
|
package/dist/utilities/libraries/data-structures/grid/position-to-grid-position-converter.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Rectangle, Vector } from 'helpers-lib';
|
|
2
2
|
export declare class PositionToGridPositionConverter {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
static areaToGridArea(boundingBox: Rectangle, cellSize: number): Rectangle;
|
|
4
|
+
static positionToGridPosition(point: Vector, cellSize: number): Vector;
|
|
5
|
+
static gridPositionToPosition(gridPosition: Vector, cellSize: number): Vector;
|
|
6
6
|
}
|
package/dist/utilities/libraries/data-structures/grid/position-to-grid-position-converter.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
2
|
exports.PositionToGridPositionConverter = void 0;
|
|
4
|
-
const helpers_lib_1 = require(
|
|
3
|
+
const helpers_lib_1 = require('helpers-lib');
|
|
5
4
|
class PositionToGridPositionConverter {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
static areaToGridArea(boundingBox, cellSize) {
|
|
6
|
+
return new helpers_lib_1.Rectangle(
|
|
7
|
+
PositionToGridPositionConverter.positionToGridPosition(boundingBox.topLeft, cellSize),
|
|
8
|
+
PositionToGridPositionConverter.positionToGridPosition(boundingBox.bottomRight, cellSize)
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
static positionToGridPosition(point, cellSize) {
|
|
12
|
+
return point.divideNumber(cellSize).floor();
|
|
13
|
+
}
|
|
14
|
+
static gridPositionToPosition(gridPosition, cellSize) {
|
|
15
|
+
return gridPosition.add(new helpers_lib_1.Vector(0.5, 0.5)).multiplyNumber(cellSize);
|
|
16
|
+
}
|
|
15
17
|
}
|
|
16
18
|
exports.PositionToGridPositionConverter = PositionToGridPositionConverter;
|
|
17
|
-
//# sourceMappingURL=position-to-grid-position-converter.js.map
|
|
19
|
+
//# sourceMappingURL=position-to-grid-position-converter.js.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
export declare class Queue<T> {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
private start;
|
|
3
|
+
private end;
|
|
4
|
+
get isEmpty(): boolean;
|
|
5
|
+
constructor(firstNode?: T | undefined);
|
|
6
|
+
/**
|
|
7
|
+
* @param args The values to add to end of the queue
|
|
8
|
+
*/
|
|
9
|
+
add(...args: T[]): void;
|
|
10
|
+
/**
|
|
11
|
+
* @returns The value of the first element in the queue
|
|
12
|
+
*/
|
|
13
|
+
pop(): T | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* @returns The value of the first element in the queue without removing it
|
|
16
|
+
*/
|
|
17
|
+
peek(): T | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* @param deepCopyItem An optional function that takes an item and returns a deep copy of it
|
|
20
|
+
* @returns The duplicated queue
|
|
21
|
+
*/
|
|
22
|
+
duplicate(deepCopyItem?: (item: T) => T): Queue<T>;
|
|
23
23
|
}
|
|
@@ -1,75 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
2
|
exports.Queue = void 0;
|
|
4
3
|
class DoublyLinkedListNode {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
constructor(value) {
|
|
5
|
+
this.value = value;
|
|
6
|
+
}
|
|
8
7
|
}
|
|
9
8
|
class Queue {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* @param args The values to add to end of the queue
|
|
22
|
-
*/
|
|
23
|
-
add(...args) {
|
|
24
|
-
args.forEach(value => {
|
|
25
|
-
let newNode = new DoublyLinkedListNode(value);
|
|
26
|
-
if (this.start) {
|
|
27
|
-
newNode.previous = this.end;
|
|
28
|
-
this.end.next = newNode;
|
|
29
|
-
this.end = newNode;
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
this.start = newNode;
|
|
33
|
-
this.end = newNode;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* @returns The value of the first element in the queue
|
|
39
|
-
*/
|
|
40
|
-
pop() {
|
|
41
|
-
if (this.start) {
|
|
42
|
-
let value = this.start.value;
|
|
43
|
-
this.start = this.start.next;
|
|
44
|
-
if (this.start) {
|
|
45
|
-
this.start.previous = undefined;
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
this.end = undefined;
|
|
49
|
-
}
|
|
50
|
-
return value;
|
|
51
|
-
}
|
|
9
|
+
get isEmpty() {
|
|
10
|
+
return this.start === undefined;
|
|
11
|
+
}
|
|
12
|
+
constructor(firstNode) {
|
|
13
|
+
if (firstNode) {
|
|
14
|
+
const firstNodeInstance = new DoublyLinkedListNode(firstNode);
|
|
15
|
+
this.start = firstNodeInstance;
|
|
16
|
+
this.end = firstNodeInstance;
|
|
52
17
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @param args The values to add to end of the queue
|
|
21
|
+
*/
|
|
22
|
+
add(...args) {
|
|
23
|
+
args.forEach(value => {
|
|
24
|
+
const newNode = new DoublyLinkedListNode(value);
|
|
25
|
+
if (this.start) {
|
|
26
|
+
newNode.previous = this.end;
|
|
27
|
+
this.end.next = newNode;
|
|
28
|
+
this.end = newNode;
|
|
29
|
+
} else {
|
|
30
|
+
this.start = newNode;
|
|
31
|
+
this.end = newNode;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @returns The value of the first element in the queue
|
|
37
|
+
*/
|
|
38
|
+
pop() {
|
|
39
|
+
if (this.start) {
|
|
40
|
+
const value = this.start.value;
|
|
41
|
+
this.start = this.start.next;
|
|
42
|
+
if (this.start) {
|
|
43
|
+
this.start.previous = undefined;
|
|
44
|
+
} else {
|
|
45
|
+
this.end = undefined;
|
|
46
|
+
}
|
|
47
|
+
return value;
|
|
58
48
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @returns The value of the first element in the queue without removing it
|
|
52
|
+
*/
|
|
53
|
+
peek() {
|
|
54
|
+
return this.start?.value;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* @param deepCopyItem An optional function that takes an item and returns a deep copy of it
|
|
58
|
+
* @returns The duplicated queue
|
|
59
|
+
*/
|
|
60
|
+
duplicate(deepCopyItem) {
|
|
61
|
+
const newQueue = new Queue();
|
|
62
|
+
let current = this.start;
|
|
63
|
+
while (current) {
|
|
64
|
+
const value = deepCopyItem ? deepCopyItem(current.value) : current.value;
|
|
65
|
+
newQueue.add(value);
|
|
66
|
+
current = current.next;
|
|
72
67
|
}
|
|
68
|
+
return newQueue;
|
|
69
|
+
}
|
|
73
70
|
}
|
|
74
71
|
exports.Queue = Queue;
|
|
75
|
-
//# sourceMappingURL=queue.js.map
|
|
72
|
+
//# sourceMappingURL=queue.js.map
|