excalibur 0.25.0 → 0.25.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.
- package/.nvmrc +1 -1
- package/CHANGELOG.md +49 -9
- package/LICENSE.md +1 -1
- package/README.md +8 -12
- package/build/dist/Actions/Action/Blink.d.ts +3 -3
- package/build/dist/Actions/Action/Delay.d.ts +1 -5
- package/build/dist/Actions/Action/Die.d.ts +3 -5
- package/build/dist/Actions/Action/EaseTo.d.ts +4 -2
- package/build/dist/Actions/Action/Fade.d.ts +3 -3
- package/build/dist/Actions/Action/Follow.d.ts +6 -4
- package/build/dist/Actions/Action/Meet.d.ts +6 -4
- package/build/dist/Actions/Action/MoveBy.d.ts +6 -4
- package/build/dist/Actions/Action/MoveTo.d.ts +6 -4
- package/build/dist/Actions/Action/Repeat.d.ts +2 -2
- package/build/dist/Actions/Action/RepeatForever.d.ts +2 -2
- package/build/dist/Actions/Action/RotateBy.d.ts +4 -3
- package/build/dist/Actions/Action/RotateTo.d.ts +4 -3
- package/build/dist/Actions/Action/ScaleBy.d.ts +4 -3
- package/build/dist/Actions/Action/ScaleTo.d.ts +4 -3
- package/build/dist/Actions/Action.d.ts +2 -2
- package/build/dist/Actions/ActionContext.d.ts +16 -10
- package/build/dist/Actions/ActionQueue.d.ts +3 -3
- package/build/dist/Actions/ActionsComponent.d.ts +236 -0
- package/build/dist/Actions/ActionsSystem.d.ts +9 -0
- package/build/dist/Actions/Index.d.ts +2 -0
- package/build/dist/Actor.d.ts +10 -8
- package/build/dist/Engine.d.ts +6 -1
- package/build/dist/EntityComponentSystem/EntityManager.d.ts +1 -0
- package/build/dist/Graphics/Animation.d.ts +64 -0
- package/build/dist/Graphics/Context/ExcaliburGraphicsContext.d.ts +1 -1
- package/build/dist/Graphics/Context/ExcaliburGraphicsContextWebGL.d.ts +6 -0
- package/build/dist/Graphics/GraphicsComponent.d.ts +2 -0
- package/build/dist/Loader.css +1 -0
- package/build/dist/Loader.d.ts +1 -0
- package/build/dist/Screen.d.ts +3 -0
- package/build/dist/excalibur.js +14369 -13942
- package/build/dist/excalibur.js.map +1 -1
- package/build/dist/excalibur.min.js +1 -1
- package/build/dist/excalibur.min.js.LICENSE.txt +1 -1
- package/build/dist/excalibur.min.js.map +1 -1
- package/build/esm/Actions/Action/Blink.d.ts +17 -0
- package/build/esm/Actions/Action/CallMethod.d.ts +10 -0
- package/build/esm/Actions/Action/Delay.d.ts +12 -0
- package/build/esm/Actions/Action/Die.d.ts +11 -0
- package/build/esm/Actions/Action/EaseTo.d.ts +21 -0
- package/build/esm/Actions/Action/Fade.d.ts +17 -0
- package/build/esm/Actions/Action/Follow.d.ts +23 -0
- package/build/esm/Actions/Action/Meet.d.ts +23 -0
- package/build/esm/Actions/Action/MoveBy.d.ts +22 -0
- package/build/esm/Actions/Action/MoveTo.d.ts +21 -0
- package/build/esm/Actions/Action/Repeat.d.ts +16 -0
- package/build/esm/Actions/Action/RepeatForever.d.ts +20 -0
- package/build/esm/Actions/Action/RotateBy.d.ts +27 -0
- package/build/esm/Actions/Action/RotateTo.d.ts +26 -0
- package/build/esm/Actions/Action/ScaleBy.d.ts +24 -0
- package/build/esm/Actions/Action/ScaleTo.d.ts +23 -0
- package/build/esm/Actions/Action.d.ts +10 -0
- package/build/esm/Actions/ActionContext.d.ts +219 -0
- package/build/esm/Actions/ActionQueue.d.ts +56 -0
- package/build/esm/Actions/Actionable.d.ts +4 -0
- package/build/esm/Actions/ActionsComponent.d.ts +236 -0
- package/build/esm/Actions/ActionsSystem.d.ts +9 -0
- package/build/{dist/Actions/Index.js → esm/Actions/Index.d.ts} +2 -1
- package/build/{dist/Actions/RotationType.js → esm/Actions/RotationType.d.ts} +6 -8
- package/build/esm/Actor.d.ts +727 -0
- package/build/esm/Camera.d.ts +360 -0
- package/build/{dist/Class.js → esm/Class.d.ts} +12 -17
- package/build/esm/Collision/BodyComponent.d.ts +208 -0
- package/build/esm/Collision/BoundingBox.d.ts +109 -0
- package/build/esm/Collision/ColliderComponent.d.ts +98 -0
- package/build/esm/Collision/Colliders/CircleCollider.d.ts +92 -0
- package/build/esm/Collision/Colliders/ClosestLineJumpTable.d.ts +23 -0
- package/build/esm/Collision/Colliders/Collider.d.ts +94 -0
- package/build/esm/Collision/Colliders/CollisionJumpTable.d.ts +14 -0
- package/build/esm/Collision/Colliders/CompositeCollider.d.ts +38 -0
- package/build/esm/Collision/Colliders/EdgeCollider.d.ts +112 -0
- package/build/esm/Collision/Colliders/PolygonCollider.d.ts +138 -0
- package/build/esm/Collision/Colliders/SeparatingAxis.d.ts +46 -0
- package/build/esm/Collision/Colliders/Shape.d.ts +54 -0
- package/build/esm/Collision/CollisionSystem.d.ts +26 -0
- package/build/{dist/Collision/CollisionType.js → esm/Collision/CollisionType.d.ts} +6 -8
- package/build/esm/Collision/Detection/CollisionContact.d.ts +53 -0
- package/build/esm/Collision/Detection/CollisionProcessor.d.ts +28 -0
- package/build/esm/Collision/Detection/DynamicTree.d.ts +85 -0
- package/build/esm/Collision/Detection/DynamicTreeCollisionProcessor.d.ts +40 -0
- package/build/esm/Collision/Detection/Pair.d.ts +31 -0
- package/build/{dist/Collision/Group/CollisionGroup.js → esm/Collision/Group/CollisionGroup.d.ts} +17 -36
- package/build/esm/Collision/Group/CollisionGroupManager.d.ts +30 -0
- package/build/{dist/Collision/Index.js → esm/Collision/Index.d.ts} +0 -1
- package/build/esm/Collision/Integrator.d.ts +6 -0
- package/build/esm/Collision/MotionSystem.d.ts +11 -0
- package/build/esm/Collision/Physics.d.ts +133 -0
- package/build/esm/Collision/Side.d.ts +21 -0
- package/build/esm/Collision/Solver/ArcadeSolver.d.ts +15 -0
- package/build/esm/Collision/Solver/ContactConstraintPoint.d.ts +43 -0
- package/build/esm/Collision/Solver/RealisticSolver.d.ts +21 -0
- package/build/esm/Collision/Solver/Solver.d.ts +50 -0
- package/build/esm/Color.d.ts +244 -0
- package/build/esm/Configurable.d.ts +9 -0
- package/build/esm/Debug/Debug.d.ts +327 -0
- package/build/esm/Debug/DebugFlags.d.ts +11 -0
- package/build/esm/Debug/DebugSystem.d.ts +29 -0
- package/build/{dist/Debug/index.js → esm/Debug/index.d.ts} +0 -1
- package/build/esm/Deprecated.d.ts +0 -0
- package/build/esm/Drawing/Animation.d.ts +196 -0
- package/build/esm/Drawing/CanvasDrawComponent.d.ts +10 -0
- package/build/esm/Drawing/CanvasDrawingSystem.d.ts +23 -0
- package/build/esm/Drawing/Index.d.ts +9 -0
- package/build/esm/Drawing/Polygon.d.ts +74 -0
- package/build/esm/Drawing/Sprite.d.ts +159 -0
- package/build/esm/Drawing/SpriteEffects.d.ts +120 -0
- package/build/esm/Drawing/SpriteSheet.d.ts +184 -0
- package/build/esm/Drawing/Texture.d.ts +44 -0
- package/build/esm/Engine.d.ts +586 -0
- package/build/esm/EntityComponentSystem/Component.d.ts +69 -0
- package/build/esm/EntityComponentSystem/Components/MotionComponent.d.ts +55 -0
- package/build/esm/EntityComponentSystem/Components/TransformComponent.d.ts +103 -0
- package/build/esm/EntityComponentSystem/Entity.d.ts +247 -0
- package/build/esm/EntityComponentSystem/EntityManager.d.ts +35 -0
- package/build/esm/EntityComponentSystem/Query.d.ts +51 -0
- package/build/esm/EntityComponentSystem/QueryManager.d.ts +48 -0
- package/build/esm/EntityComponentSystem/System.d.ts +107 -0
- package/build/esm/EntityComponentSystem/SystemManager.d.ts +45 -0
- package/build/esm/EntityComponentSystem/Util.d.ts +1 -0
- package/build/esm/EntityComponentSystem/World.d.ts +45 -0
- package/build/{dist/EntityComponentSystem/index.js → esm/EntityComponentSystem/index.d.ts} +0 -1
- package/build/esm/EventDispatcher.d.ts +51 -0
- package/build/esm/Events/MediaEvents.d.ts +47 -0
- package/build/esm/Events.d.ts +475 -0
- package/build/esm/Flags.d.ts +62 -0
- package/build/esm/Graphics/Animation.d.ts +189 -0
- package/build/esm/Graphics/Canvas.d.ts +24 -0
- package/build/esm/Graphics/Circle.d.ts +15 -0
- package/build/esm/Graphics/Context/ExcaliburGraphicsContext.d.ts +155 -0
- package/build/esm/Graphics/Context/ExcaliburGraphicsContext2DCanvas.d.ts +87 -0
- package/build/esm/Graphics/Context/ExcaliburGraphicsContextWebGL.d.ts +111 -0
- package/build/esm/Graphics/Context/batch.d.ts +11 -0
- package/build/esm/Graphics/Context/debug-text.d.ts +24 -0
- package/build/esm/Graphics/Context/draw-image-command.d.ts +47 -0
- package/build/esm/Graphics/Context/image-renderer.d.ts +39 -0
- package/build/esm/Graphics/Context/line-renderer.d.ts +22 -0
- package/build/esm/Graphics/Context/point-renderer.d.ts +22 -0
- package/build/esm/Graphics/Context/renderer.d.ts +66 -0
- package/build/esm/Graphics/Context/shader.d.ts +81 -0
- package/build/esm/Graphics/Context/state-stack.d.ts +10 -0
- package/build/esm/Graphics/Context/texture-loader.d.ts +33 -0
- package/build/esm/Graphics/Context/transform-stack.d.ts +12 -0
- package/build/esm/Graphics/Context/webgl-util.d.ts +12 -0
- package/build/esm/Graphics/Font.d.ts +57 -0
- package/build/{dist/Graphics/FontCommon.js → esm/Graphics/FontCommon.d.ts} +54 -37
- package/build/esm/Graphics/Graphic.d.ts +129 -0
- package/build/esm/Graphics/GraphicsComponent.d.ts +224 -0
- package/build/esm/Graphics/GraphicsDiagnostics.d.ts +5 -0
- package/build/esm/Graphics/GraphicsGroup.d.ts +24 -0
- package/build/esm/Graphics/GraphicsSystem.d.ts +35 -0
- package/build/esm/Graphics/ImageSource.d.ts +53 -0
- package/build/esm/Graphics/Polygon.d.ts +17 -0
- package/build/esm/Graphics/Raster.d.ts +105 -0
- package/build/esm/Graphics/Rectangle.d.ts +13 -0
- package/build/esm/Graphics/Sprite.d.ts +59 -0
- package/build/esm/Graphics/SpriteFont.d.ts +53 -0
- package/build/esm/Graphics/SpriteSheet.d.ts +137 -0
- package/build/esm/Graphics/Text.d.ts +29 -0
- package/build/{dist/Graphics/index.js → esm/Graphics/index.d.ts} +0 -4
- package/build/esm/Id.d.ts +8 -0
- package/build/esm/Input/CapturePointerConfig.d.ts +13 -0
- package/build/esm/Input/EngineInput.d.ts +8 -0
- package/build/esm/Input/Gamepad.d.ts +227 -0
- package/build/{dist/Input/Index.js → esm/Input/Index.d.ts} +0 -1
- package/build/esm/Input/Keyboard.d.ts +187 -0
- package/build/esm/Input/Pointer.d.ts +134 -0
- package/build/esm/Input/PointerEvents.d.ts +170 -0
- package/build/esm/Input/Pointers.d.ts +78 -0
- package/build/esm/Interfaces/Audio.d.ts +29 -0
- package/build/esm/Interfaces/AudioImplementation.d.ts +25 -0
- package/build/esm/Interfaces/Clonable.d.ts +3 -0
- package/build/esm/Interfaces/Drawable.d.ts +97 -0
- package/build/esm/Interfaces/Evented.d.ts +31 -0
- package/build/{dist/Interfaces/Index.js → esm/Interfaces/Index.d.ts} +0 -1
- package/build/esm/Interfaces/LifecycleEvents.d.ts +167 -0
- package/build/esm/Interfaces/Loadable.d.ts +18 -0
- package/build/esm/Interfaces/PointerEventHandlers.d.ts +40 -0
- package/build/esm/Interfaces/Trait.d.ts +9 -0
- package/build/esm/Label.d.ts +146 -0
- package/build/esm/Loader.d.ts +174 -0
- package/build/{dist/Math/Index.js → esm/Math/Index.d.ts} +0 -1
- package/build/esm/Math/Random.d.ts +125 -0
- package/build/esm/Math/global-coordinates.d.ts +10 -0
- package/build/esm/Math/line.d.ts +95 -0
- package/build/esm/Math/matrix.d.ts +110 -0
- package/build/esm/Math/projection.d.ts +10 -0
- package/build/esm/Math/ray.d.ts +25 -0
- package/build/esm/Math/vector-view.d.ts +18 -0
- package/build/esm/Math/vector.d.ts +201 -0
- package/build/esm/Particles.d.ts +244 -0
- package/build/esm/Polyfill.d.ts +6 -0
- package/build/esm/PostProcessing/ColorBlindCorrector.d.ts +28 -0
- package/build/{dist/PostProcessing/Index.js → esm/PostProcessing/Index.d.ts} +0 -1
- package/build/esm/PostProcessing/PostProcessor.d.ts +6 -0
- package/build/esm/Promises.d.ts +87 -0
- package/build/esm/Resources/Gif.d.ts +117 -0
- package/build/{dist/Resources/Index.js → esm/Resources/Index.d.ts} +0 -1
- package/build/esm/Resources/Resource.d.ts +31 -0
- package/build/esm/Resources/Sound/AudioContext.d.ts +7 -0
- package/build/{dist/Resources/Sound/Index.js → esm/Resources/Sound/Index.d.ts} +0 -1
- package/build/esm/Resources/Sound/Sound.d.ts +79 -0
- package/build/esm/Resources/Sound/WebAudioInstance.d.ts +45 -0
- package/build/esm/Scene.d.ts +301 -0
- package/build/esm/Screen.d.ts +285 -0
- package/build/esm/ScreenElement.d.ts +13 -0
- package/build/esm/TileMap.d.ts +222 -0
- package/build/esm/Timer.d.ts +93 -0
- package/build/esm/Traits/CapturePointer.d.ts +10 -0
- package/build/{dist/Traits/Index.js → esm/Traits/Index.d.ts} +0 -1
- package/build/esm/Traits/OffscreenCulling.d.ts +11 -0
- package/build/esm/Trigger.d.ts +48 -0
- package/build/esm/Util/Actors.d.ts +12 -0
- package/build/esm/Util/Browser.d.ts +28 -0
- package/build/esm/Util/CullingBox.d.ts +23 -0
- package/build/esm/Util/Decorators.d.ts +15 -0
- package/build/esm/Util/Detector.d.ts +40 -0
- package/build/esm/Util/DrawUtil.d.ts +69 -0
- package/build/esm/Util/EasingFunctions.d.ts +59 -0
- package/build/{dist/Util/Index.js → esm/Util/Index.d.ts} +0 -1
- package/build/esm/Util/Log.d.ts +109 -0
- package/build/esm/Util/Observable.d.ts +55 -0
- package/build/esm/Util/Pool.d.ts +44 -0
- package/build/esm/Util/SortedList.d.ts +52 -0
- package/build/esm/Util/Sound.d.ts +4 -0
- package/build/esm/Util/Util.d.ts +196 -0
- package/build/esm/Util/Watch.d.ts +8 -0
- package/build/esm/Util/WebAudio.d.ts +15 -0
- package/build/esm/excalibur.d.ts +2 -0
- package/build/esm/excalibur.js +28874 -0
- package/build/esm/excalibur.js.map +1 -0
- package/build/esm/excalibur.min.js +3 -0
- package/build/esm/excalibur.min.js.LICENSE.txt +7 -0
- package/build/esm/excalibur.min.js.map +1 -0
- package/build/{dist/index.js → esm/index.d.ts} +4 -18
- package/package.json +31 -25
- package/wallaby.js +2 -0
- package/build/dist/Actions/Action/Blink.js +0 -45
- package/build/dist/Actions/Action/Blink.js.map +0 -1
- package/build/dist/Actions/Action/CallMethod.js +0 -21
- package/build/dist/Actions/Action/CallMethod.js.map +0 -1
- package/build/dist/Actions/Action/Delay.js +0 -28
- package/build/dist/Actions/Action/Delay.js.map +0 -1
- package/build/dist/Actions/Action/Die.js +0 -21
- package/build/dist/Actions/Action/Die.js.map +0 -1
- package/build/dist/Actions/Action/EaseTo.js +0 -66
- package/build/dist/Actions/Action/EaseTo.js.map +0 -1
- package/build/dist/Actions/Action/Fade.js +0 -42
- package/build/dist/Actions/Action/Fade.js.map +0 -1
- package/build/dist/Actions/Action/Follow.js +0 -51
- package/build/dist/Actions/Action/Follow.js.map +0 -1
- package/build/dist/Actions/Action/Meet.js +0 -48
- package/build/dist/Actions/Action/Meet.js.map +0 -1
- package/build/dist/Actions/Action/MoveBy.js +0 -42
- package/build/dist/Actions/Action/MoveBy.js.map +0 -1
- package/build/dist/Actions/Action/MoveTo.js +0 -35
- package/build/dist/Actions/Action/MoveTo.js.map +0 -1
- package/build/dist/Actions/Action/Repeat.js +0 -31
- package/build/dist/Actions/Action/Repeat.js.map +0 -1
- package/build/dist/Actions/Action/RepeatForever.js +0 -37
- package/build/dist/Actions/Action/RepeatForever.js.map +0 -1
- package/build/dist/Actions/Action/RotateBy.js +0 -88
- package/build/dist/Actions/Action/RotateBy.js.map +0 -1
- package/build/dist/Actions/Action/RotateTo.js +0 -87
- package/build/dist/Actions/Action/RotateTo.js.map +0 -1
- package/build/dist/Actions/Action/ScaleBy.js +0 -47
- package/build/dist/Actions/Action/ScaleBy.js.map +0 -1
- package/build/dist/Actions/Action/ScaleTo.js +0 -58
- package/build/dist/Actions/Action/ScaleTo.js.map +0 -1
- package/build/dist/Actions/Action.js +0 -2
- package/build/dist/Actions/Action.js.map +0 -1
- package/build/dist/Actions/ActionContext.js +0 -297
- package/build/dist/Actions/ActionContext.js.map +0 -1
- package/build/dist/Actions/ActionQueue.js +0 -87
- package/build/dist/Actions/ActionQueue.js.map +0 -1
- package/build/dist/Actions/Actionable.js +0 -2
- package/build/dist/Actions/Actionable.js.map +0 -1
- package/build/dist/Actions/Index.js.map +0 -1
- package/build/dist/Actions/RotationType.js.map +0 -1
- package/build/dist/Actor.js +0 -856
- package/build/dist/Actor.js.map +0 -1
- package/build/dist/Camera.js +0 -627
- package/build/dist/Camera.js.map +0 -1
- package/build/dist/Class.js.map +0 -1
- package/build/dist/Collision/BodyComponent.js +0 -347
- package/build/dist/Collision/BodyComponent.js.map +0 -1
- package/build/dist/Collision/BoundingBox.js +0 -355
- package/build/dist/Collision/BoundingBox.js.map +0 -1
- package/build/dist/Collision/ColliderComponent.js +0 -201
- package/build/dist/Collision/ColliderComponent.js.map +0 -1
- package/build/dist/Collision/Colliders/CircleCollider.js +0 -215
- package/build/dist/Collision/Colliders/CircleCollider.js.map +0 -1
- package/build/dist/Collision/Colliders/ClosestLineJumpTable.js +0 -211
- package/build/dist/Collision/Colliders/ClosestLineJumpTable.js.map +0 -1
- package/build/dist/Collision/Colliders/Collider.js +0 -26
- package/build/dist/Collision/Colliders/Collider.js.map +0 -1
- package/build/dist/Collision/Colliders/CollisionJumpTable.js +0 -301
- package/build/dist/Collision/Colliders/CollisionJumpTable.js.map +0 -1
- package/build/dist/Collision/Colliders/CompositeCollider.js +0 -232
- package/build/dist/Collision/Colliders/CompositeCollider.js.map +0 -1
- package/build/dist/Collision/Colliders/EdgeCollider.js +0 -253
- package/build/dist/Collision/Colliders/EdgeCollider.js.map +0 -1
- package/build/dist/Collision/Colliders/PolygonCollider.js +0 -389
- package/build/dist/Collision/Colliders/PolygonCollider.js.map +0 -1
- package/build/dist/Collision/Colliders/SeparatingAxis.js +0 -67
- package/build/dist/Collision/Colliders/SeparatingAxis.js.map +0 -1
- package/build/dist/Collision/Colliders/Shape.js +0 -102
- package/build/dist/Collision/Colliders/Shape.js.map +0 -1
- package/build/dist/Collision/CollisionSystem.js +0 -116
- package/build/dist/Collision/CollisionSystem.js.map +0 -1
- package/build/dist/Collision/CollisionType.js.map +0 -1
- package/build/dist/Collision/Detection/CollisionContact.js +0 -46
- package/build/dist/Collision/Detection/CollisionContact.js.map +0 -1
- package/build/dist/Collision/Detection/CollisionProcessor.js +0 -2
- package/build/dist/Collision/Detection/CollisionProcessor.js.map +0 -1
- package/build/dist/Collision/Detection/DynamicTree.js +0 -442
- package/build/dist/Collision/Detection/DynamicTree.js.map +0 -1
- package/build/dist/Collision/Detection/DynamicTreeCollisionProcessor.js +0 -228
- package/build/dist/Collision/Detection/DynamicTreeCollisionProcessor.js.map +0 -1
- package/build/dist/Collision/Detection/Pair.js +0 -74
- package/build/dist/Collision/Detection/Pair.js.map +0 -1
- package/build/dist/Collision/Group/CollisionGroup.js.map +0 -1
- package/build/dist/Collision/Group/CollisionGroupManager.js +0 -52
- package/build/dist/Collision/Group/CollisionGroupManager.js.map +0 -1
- package/build/dist/Collision/Index.js.map +0 -1
- package/build/dist/Collision/Integrator.js +0 -11
- package/build/dist/Collision/Integrator.js.map +0 -1
- package/build/dist/Collision/MotionSystem.js +0 -38
- package/build/dist/Collision/MotionSystem.js.map +0 -1
- package/build/dist/Collision/Physics.js +0 -163
- package/build/dist/Collision/Physics.js.map +0 -1
- package/build/dist/Collision/Side.js +0 -51
- package/build/dist/Collision/Side.js.map +0 -1
- package/build/dist/Collision/Solver/ArcadeSolver.js +0 -96
- package/build/dist/Collision/Solver/ArcadeSolver.js.map +0 -1
- package/build/dist/Collision/Solver/ContactConstraintPoint.js +0 -83
- package/build/dist/Collision/Solver/ContactConstraintPoint.js.map +0 -1
- package/build/dist/Collision/Solver/RealisticSolver.js +0 -248
- package/build/dist/Collision/Solver/RealisticSolver.js.map +0 -1
- package/build/dist/Collision/Solver/Solver.js +0 -37
- package/build/dist/Collision/Solver/Solver.js.map +0 -1
- package/build/dist/Color.js +0 -461
- package/build/dist/Color.js.map +0 -1
- package/build/dist/Configurable.js +0 -32
- package/build/dist/Configurable.js.map +0 -1
- package/build/dist/Debug/Debug.js +0 -339
- package/build/dist/Debug/Debug.js.map +0 -1
- package/build/dist/Debug/DebugFlags.js +0 -13
- package/build/dist/Debug/DebugFlags.js.map +0 -1
- package/build/dist/Debug/DebugSystem.js +0 -242
- package/build/dist/Debug/DebugSystem.js.map +0 -1
- package/build/dist/Debug/index.js.map +0 -1
- package/build/dist/Deprecated.js +0 -2
- package/build/dist/Deprecated.js.map +0 -1
- package/build/dist/Drawing/Animation.js +0 -285
- package/build/dist/Drawing/Animation.js.map +0 -1
- package/build/dist/Drawing/CanvasDrawComponent.js +0 -16
- package/build/dist/Drawing/CanvasDrawComponent.js.map +0 -1
- package/build/dist/Drawing/CanvasDrawingSystem.js +0 -95
- package/build/dist/Drawing/CanvasDrawingSystem.js.map +0 -1
- package/build/dist/Drawing/Index.js +0 -10
- package/build/dist/Drawing/Index.js.map +0 -1
- package/build/dist/Drawing/Polygon.js +0 -129
- package/build/dist/Drawing/Polygon.js.map +0 -1
- package/build/dist/Drawing/Sprite.js +0 -356
- package/build/dist/Drawing/Sprite.js.map +0 -1
- package/build/dist/Drawing/SpriteEffects.js +0 -246
- package/build/dist/Drawing/SpriteEffects.js.map +0 -1
- package/build/dist/Drawing/SpriteSheet.js +0 -413
- package/build/dist/Drawing/SpriteSheet.js.map +0 -1
- package/build/dist/Drawing/Texture.js +0 -80
- package/build/dist/Drawing/Texture.js.map +0 -1
- package/build/dist/Engine.js +0 -871
- package/build/dist/Engine.js.map +0 -1
- package/build/dist/EntityComponentSystem/Component.js +0 -65
- package/build/dist/EntityComponentSystem/Component.js.map +0 -1
- package/build/dist/EntityComponentSystem/Components/MotionComponent.js +0 -33
- package/build/dist/EntityComponentSystem/Components/MotionComponent.js.map +0 -1
- package/build/dist/EntityComponentSystem/Components/TransformComponent.js +0 -249
- package/build/dist/EntityComponentSystem/Components/TransformComponent.js.map +0 -1
- package/build/dist/EntityComponentSystem/Entity.js +0 -452
- package/build/dist/EntityComponentSystem/Entity.js.map +0 -1
- package/build/dist/EntityComponentSystem/EntityManager.js +0 -121
- package/build/dist/EntityComponentSystem/EntityManager.js.map +0 -1
- package/build/dist/EntityComponentSystem/Query.js +0 -91
- package/build/dist/EntityComponentSystem/Query.js.map +0 -1
- package/build/dist/EntityComponentSystem/QueryManager.js +0 -90
- package/build/dist/EntityComponentSystem/QueryManager.js.map +0 -1
- package/build/dist/EntityComponentSystem/System.js +0 -76
- package/build/dist/EntityComponentSystem/System.js.map +0 -1
- package/build/dist/EntityComponentSystem/SystemManager.js +0 -96
- package/build/dist/EntityComponentSystem/SystemManager.js.map +0 -1
- package/build/dist/EntityComponentSystem/Util.js +0 -5
- package/build/dist/EntityComponentSystem/Util.js.map +0 -1
- package/build/dist/EntityComponentSystem/World.js +0 -55
- package/build/dist/EntityComponentSystem/World.js.map +0 -1
- package/build/dist/EntityComponentSystem/index.js.map +0 -1
- package/build/dist/EventDispatcher.js +0 -133
- package/build/dist/EventDispatcher.js.map +0 -1
- package/build/dist/Events/MediaEvents.js +0 -75
- package/build/dist/Events/MediaEvents.js.map +0 -1
- package/build/dist/Events.js +0 -497
- package/build/dist/Events.js.map +0 -1
- package/build/dist/Flags.js +0 -90
- package/build/dist/Flags.js.map +0 -1
- package/build/dist/Graphics/Animation.js +0 -230
- package/build/dist/Graphics/Animation.js.map +0 -1
- package/build/dist/Graphics/Canvas.js +0 -34
- package/build/dist/Graphics/Canvas.js.map +0 -1
- package/build/dist/Graphics/Circle.js +0 -39
- package/build/dist/Graphics/Circle.js.map +0 -1
- package/build/dist/Graphics/Context/ExcaliburGraphicsContext.js +0 -2
- package/build/dist/Graphics/Context/ExcaliburGraphicsContext.js.map +0 -1
- package/build/dist/Graphics/Context/ExcaliburGraphicsContext2DCanvas.js +0 -177
- package/build/dist/Graphics/Context/ExcaliburGraphicsContext2DCanvas.js.map +0 -1
- package/build/dist/Graphics/Context/ExcaliburGraphicsContextWebGL.js +0 -188
- package/build/dist/Graphics/Context/ExcaliburGraphicsContextWebGL.js.map +0 -1
- package/build/dist/Graphics/Context/batch.js +0 -24
- package/build/dist/Graphics/Context/batch.js.map +0 -1
- package/build/dist/Graphics/Context/debug-text.js +0 -47
- package/build/dist/Graphics/Context/debug-text.js.map +0 -1
- package/build/dist/Graphics/Context/draw-image-command.js +0 -179
- package/build/dist/Graphics/Context/draw-image-command.js.map +0 -1
- package/build/dist/Graphics/Context/image-renderer.js +0 -295
- package/build/dist/Graphics/Context/image-renderer.js.map +0 -1
- package/build/dist/Graphics/Context/line-renderer.js +0 -70
- package/build/dist/Graphics/Context/line-renderer.js.map +0 -1
- package/build/dist/Graphics/Context/point-renderer.js +0 -67
- package/build/dist/Graphics/Context/point-renderer.js.map +0 -1
- package/build/dist/Graphics/Context/renderer.js +0 -75
- package/build/dist/Graphics/Context/renderer.js.map +0 -1
- package/build/dist/Graphics/Context/shader.js +0 -189
- package/build/dist/Graphics/Context/shader.js.map +0 -1
- package/build/dist/Graphics/Context/state-stack.js +0 -27
- package/build/dist/Graphics/Context/state-stack.js.map +0 -1
- package/build/dist/Graphics/Context/texture-loader.js +0 -84
- package/build/dist/Graphics/Context/texture-loader.js.map +0 -1
- package/build/dist/Graphics/Context/transform-stack.js +0 -30
- package/build/dist/Graphics/Context/transform-stack.js.map +0 -1
- package/build/dist/Graphics/Context/webgl-util.js +0 -26
- package/build/dist/Graphics/Context/webgl-util.js.map +0 -1
- package/build/dist/Graphics/Font.js +0 -209
- package/build/dist/Graphics/Font.js.map +0 -1
- package/build/dist/Graphics/FontCommon.js.map +0 -1
- package/build/dist/Graphics/Graphic.js +0 -147
- package/build/dist/Graphics/Graphic.js.map +0 -1
- package/build/dist/Graphics/GraphicsComponent.js +0 -276
- package/build/dist/Graphics/GraphicsComponent.js.map +0 -1
- package/build/dist/Graphics/GraphicsDiagnostics.js +0 -9
- package/build/dist/Graphics/GraphicsDiagnostics.js.map +0 -1
- package/build/dist/Graphics/GraphicsGroup.js +0 -66
- package/build/dist/Graphics/GraphicsGroup.js.map +0 -1
- package/build/dist/Graphics/GraphicsSystem.js +0 -161
- package/build/dist/Graphics/GraphicsSystem.js.map +0 -1
- package/build/dist/Graphics/ImageSource.js +0 -117
- package/build/dist/Graphics/ImageSource.js.map +0 -1
- package/build/dist/Graphics/Polygon.js +0 -51
- package/build/dist/Graphics/Polygon.js.map +0 -1
- package/build/dist/Graphics/Raster.js +0 -209
- package/build/dist/Graphics/Raster.js.map +0 -1
- package/build/dist/Graphics/Rectangle.js +0 -24
- package/build/dist/Graphics/Rectangle.js.map +0 -1
- package/build/dist/Graphics/Sprite.js +0 -81
- package/build/dist/Graphics/Sprite.js.map +0 -1
- package/build/dist/Graphics/SpriteFont.js +0 -116
- package/build/dist/Graphics/SpriteFont.js.map +0 -1
- package/build/dist/Graphics/SpriteSheet.js +0 -116
- package/build/dist/Graphics/SpriteSheet.js.map +0 -1
- package/build/dist/Graphics/Text.js +0 -82
- package/build/dist/Graphics/Text.js.map +0 -1
- package/build/dist/Graphics/index.js.map +0 -1
- package/build/dist/Id.js +0 -8
- package/build/dist/Id.js.map +0 -1
- package/build/dist/Input/CapturePointerConfig.js +0 -5
- package/build/dist/Input/CapturePointerConfig.js.map +0 -1
- package/build/dist/Input/EngineInput.js +0 -2
- package/build/dist/Input/EngineInput.js.map +0 -1
- package/build/dist/Input/Gamepad.js +0 -358
- package/build/dist/Input/Gamepad.js.map +0 -1
- package/build/dist/Input/Index.js.map +0 -1
- package/build/dist/Input/Keyboard.js +0 -267
- package/build/dist/Input/Keyboard.js.map +0 -1
- package/build/dist/Input/Pointer.js +0 -205
- package/build/dist/Input/Pointer.js.map +0 -1
- package/build/dist/Input/PointerEvents.js +0 -309
- package/build/dist/Input/PointerEvents.js.map +0 -1
- package/build/dist/Input/Pointers.js +0 -405
- package/build/dist/Input/Pointers.js.map +0 -1
- package/build/dist/Interfaces/Audio.js +0 -2
- package/build/dist/Interfaces/Audio.js.map +0 -1
- package/build/dist/Interfaces/AudioImplementation.js +0 -11
- package/build/dist/Interfaces/AudioImplementation.js.map +0 -1
- package/build/dist/Interfaces/Clonable.js +0 -2
- package/build/dist/Interfaces/Clonable.js.map +0 -1
- package/build/dist/Interfaces/Drawable.js +0 -2
- package/build/dist/Interfaces/Drawable.js.map +0 -1
- package/build/dist/Interfaces/Evented.js +0 -2
- package/build/dist/Interfaces/Evented.js.map +0 -1
- package/build/dist/Interfaces/Index.js.map +0 -1
- package/build/dist/Interfaces/LifecycleEvents.js +0 -51
- package/build/dist/Interfaces/LifecycleEvents.js.map +0 -1
- package/build/dist/Interfaces/Loadable.js +0 -2
- package/build/dist/Interfaces/Loadable.js.map +0 -1
- package/build/dist/Interfaces/PointerEventHandlers.js +0 -2
- package/build/dist/Interfaces/PointerEventHandlers.js.map +0 -1
- package/build/dist/Interfaces/Trait.js +0 -2
- package/build/dist/Interfaces/Trait.js.map +0 -1
- package/build/dist/Label.js +0 -262
- package/build/dist/Label.js.map +0 -1
- package/build/dist/Loader.js +0 -344
- package/build/dist/Loader.js.map +0 -1
- package/build/dist/Math/Index.js.map +0 -1
- package/build/dist/Math/Random.js +0 -239
- package/build/dist/Math/Random.js.map +0 -1
- package/build/dist/Math/global-coordinates.js +0 -30
- package/build/dist/Math/global-coordinates.js.map +0 -1
- package/build/dist/Math/line.js +0 -194
- package/build/dist/Math/line.js.map +0 -1
- package/build/dist/Math/matrix.js +0 -425
- package/build/dist/Math/matrix.js.map +0 -1
- package/build/dist/Math/projection.js +0 -24
- package/build/dist/Math/projection.js.map +0 -1
- package/build/dist/Math/ray.js +0 -52
- package/build/dist/Math/ray.js.map +0 -1
- package/build/dist/Math/vector-view.js +0 -25
- package/build/dist/Math/vector-view.js.map +0 -1
- package/build/dist/Math/vector.js +0 -326
- package/build/dist/Math/vector.js.map +0 -1
- package/build/dist/Particles.js +0 -436
- package/build/dist/Particles.js.map +0 -1
- package/build/dist/Polyfill.js +0 -56
- package/build/dist/Polyfill.js.map +0 -1
- package/build/dist/PostProcessing/ColorBlindCorrector.js +0 -193
- package/build/dist/PostProcessing/ColorBlindCorrector.js.map +0 -1
- package/build/dist/PostProcessing/Index.js.map +0 -1
- package/build/dist/PostProcessing/PostProcessor.js +0 -2
- package/build/dist/PostProcessing/PostProcessor.js.map +0 -1
- package/build/dist/Promises.js +0 -205
- package/build/dist/Promises.js.map +0 -1
- package/build/dist/Resources/Gif.js +0 -490
- package/build/dist/Resources/Gif.js.map +0 -1
- package/build/dist/Resources/Index.js.map +0 -1
- package/build/dist/Resources/Resource.js +0 -74
- package/build/dist/Resources/Resource.js.map +0 -1
- package/build/dist/Resources/Sound/AudioContext.js +0 -16
- package/build/dist/Resources/Sound/AudioContext.js.map +0 -1
- package/build/dist/Resources/Sound/Index.js.map +0 -1
- package/build/dist/Resources/Sound/Sound.js +0 -257
- package/build/dist/Resources/Sound/Sound.js.map +0 -1
- package/build/dist/Resources/Sound/WebAudioInstance.js +0 -160
- package/build/dist/Resources/Sound/WebAudioInstance.js.map +0 -1
- package/build/dist/Scene.js +0 -443
- package/build/dist/Scene.js.map +0 -1
- package/build/dist/Screen.js +0 -611
- package/build/dist/Screen.js.map +0 -1
- package/build/dist/ScreenElement.js +0 -33
- package/build/dist/ScreenElement.js.map +0 -1
- package/build/dist/TileMap.js +0 -465
- package/build/dist/TileMap.js.map +0 -1
- package/build/dist/Timer.js +0 -198
- package/build/dist/Timer.js.map +0 -1
- package/build/dist/Traits/CapturePointer.js +0 -16
- package/build/dist/Traits/CapturePointer.js.map +0 -1
- package/build/dist/Traits/Index.js.map +0 -1
- package/build/dist/Traits/OffscreenCulling.js +0 -35
- package/build/dist/Traits/OffscreenCulling.js.map +0 -1
- package/build/dist/Trigger.js +0 -107
- package/build/dist/Trigger.js.map +0 -1
- package/build/dist/Util/Actors.js +0 -19
- package/build/dist/Util/Actors.js.map +0 -1
- package/build/dist/Util/Browser.js +0 -66
- package/build/dist/Util/Browser.js.map +0 -1
- package/build/dist/Util/CullingBox.js +0 -104
- package/build/dist/Util/CullingBox.js.map +0 -1
- package/build/dist/Util/Decorators.js +0 -78
- package/build/dist/Util/Decorators.js.map +0 -1
- package/build/dist/Util/Detector.js +0 -167
- package/build/dist/Util/Detector.js.map +0 -1
- package/build/dist/Util/DrawUtil.js +0 -115
- package/build/dist/Util/DrawUtil.js.map +0 -1
- package/build/dist/Util/EasingFunctions.js +0 -118
- package/build/dist/Util/EasingFunctions.js.map +0 -1
- package/build/dist/Util/Index.js.map +0 -1
- package/build/dist/Util/Log.js +0 -195
- package/build/dist/Util/Log.js.map +0 -1
- package/build/dist/Util/Observable.js +0 -60
- package/build/dist/Util/Observable.js.map +0 -1
- package/build/dist/Util/Pool.js +0 -72
- package/build/dist/Util/Pool.js.map +0 -1
- package/build/dist/Util/SortedList.js +0 -261
- package/build/dist/Util/SortedList.js.map +0 -1
- package/build/dist/Util/Sound.js +0 -22
- package/build/dist/Util/Sound.js.map +0 -1
- package/build/dist/Util/Util.js +0 -401
- package/build/dist/Util/Util.js.map +0 -1
- package/build/dist/Util/Watch.js +0 -67
- package/build/dist/Util/Watch.js.map +0 -1
- package/build/dist/Util/WebAudio.js +0 -62
- package/build/dist/Util/WebAudio.js.map +0 -1
- package/build/dist/index.js.map +0 -1
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { obsolete } from './Decorators';
|
|
8
|
-
/**
|
|
9
|
-
* A sorted list implementation. NOTE: this implementation is not self-balancing
|
|
10
|
-
* @deprecated WIll be removed in v0.26.0 Use built in JS array.sort
|
|
11
|
-
*/
|
|
12
|
-
let SortedList = class SortedList {
|
|
13
|
-
constructor(getComparable) {
|
|
14
|
-
this._getComparable = getComparable;
|
|
15
|
-
}
|
|
16
|
-
find(element) {
|
|
17
|
-
return this._find(this._root, element);
|
|
18
|
-
}
|
|
19
|
-
_find(node, element) {
|
|
20
|
-
if (node == null) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
else if (this._getComparable(element) === node.getKey()) {
|
|
24
|
-
if (node.getData().indexOf(element) > -1) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
else if (this._getComparable(element) < node.getKey()) {
|
|
32
|
-
return this._find(node.getLeft(), element);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return this._find(node.getRight(), element);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
// returns the array of elements at a specific key value
|
|
39
|
-
get(key) {
|
|
40
|
-
return this._get(this._root, key);
|
|
41
|
-
}
|
|
42
|
-
_get(node, key) {
|
|
43
|
-
if (node == null) {
|
|
44
|
-
return [];
|
|
45
|
-
}
|
|
46
|
-
else if (key === node.getKey()) {
|
|
47
|
-
return node.getData();
|
|
48
|
-
}
|
|
49
|
-
else if (key < node.getKey()) {
|
|
50
|
-
return this._get(node.getLeft(), key);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
return this._get(node.getRight(), key);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
add(element) {
|
|
57
|
-
if (this._root == null) {
|
|
58
|
-
this._root = new BinaryTreeNode(this._getComparable(element), [element], null, null);
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
return this._insert(this._root, element);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
_insert(node, element) {
|
|
66
|
-
if (node != null) {
|
|
67
|
-
if (this._getComparable(element) === node.getKey()) {
|
|
68
|
-
if (node.getData().indexOf(element) > -1) {
|
|
69
|
-
return false; // the element we're trying to insert already exists
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
node.getData().push(element);
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
else if (this._getComparable(element) < node.getKey()) {
|
|
77
|
-
if (node.getLeft() == null) {
|
|
78
|
-
node.setLeft(new BinaryTreeNode(this._getComparable(element), [element], null, null));
|
|
79
|
-
return true;
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
return this._insert(node.getLeft(), element);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
if (node.getRight() == null) {
|
|
87
|
-
node.setRight(new BinaryTreeNode(this._getComparable(element), [element], null, null));
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
return this._insert(node.getRight(), element);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
removeByComparable(element) {
|
|
98
|
-
this._root = this._remove(this._root, element);
|
|
99
|
-
}
|
|
100
|
-
_remove(node, element) {
|
|
101
|
-
if (node == null) {
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
else if (this._getComparable(element) === node.getKey()) {
|
|
105
|
-
const elementIndex = node.getData().indexOf(element);
|
|
106
|
-
// if the node contains the element, remove the element
|
|
107
|
-
if (elementIndex > -1) {
|
|
108
|
-
node.getData().splice(elementIndex, 1);
|
|
109
|
-
// if we have removed the last element at this node, remove the node
|
|
110
|
-
if (node.getData().length === 0) {
|
|
111
|
-
// if the node is a leaf
|
|
112
|
-
if (node.getLeft() == null && node.getRight() == null) {
|
|
113
|
-
return null;
|
|
114
|
-
}
|
|
115
|
-
else if (node.getLeft() == null) {
|
|
116
|
-
return node.getRight();
|
|
117
|
-
}
|
|
118
|
-
else if (node.getRight() == null) {
|
|
119
|
-
return node.getLeft();
|
|
120
|
-
}
|
|
121
|
-
// if node has 2 children
|
|
122
|
-
const temp = this._findMinNode(node.getRight());
|
|
123
|
-
node.setKey(temp.getKey());
|
|
124
|
-
node.setData(temp.getData());
|
|
125
|
-
node.setRight(this._cleanup(node.getRight(), temp)); //"cleanup nodes" (move them up recursively)
|
|
126
|
-
return node;
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
// this prevents the node from being removed since it still contains elements
|
|
130
|
-
return node;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
else if (this._getComparable(element) < node.getKey()) {
|
|
135
|
-
node.setLeft(this._remove(node.getLeft(), element));
|
|
136
|
-
return node;
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
node.setRight(this._remove(node.getRight(), element));
|
|
140
|
-
return node;
|
|
141
|
-
}
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
// called once we have successfully removed the element we wanted, recursively corrects the part of the tree below the removed node
|
|
145
|
-
_cleanup(node, element) {
|
|
146
|
-
const comparable = element.getKey();
|
|
147
|
-
if (node == null) {
|
|
148
|
-
return null;
|
|
149
|
-
}
|
|
150
|
-
else if (comparable === node.getKey()) {
|
|
151
|
-
// if the node is a leaf
|
|
152
|
-
if (node.getLeft() == null && node.getRight() == null) {
|
|
153
|
-
return null;
|
|
154
|
-
}
|
|
155
|
-
else if (node.getLeft() == null) {
|
|
156
|
-
return node.getRight();
|
|
157
|
-
}
|
|
158
|
-
else if (node.getRight() == null) {
|
|
159
|
-
return node.getLeft();
|
|
160
|
-
}
|
|
161
|
-
// if node has 2 children
|
|
162
|
-
const temp = this._findMinNode(node.getRight());
|
|
163
|
-
node.setKey(temp.getKey());
|
|
164
|
-
node.setData(temp.getData());
|
|
165
|
-
node.setRight(this._cleanup(node.getRight(), temp));
|
|
166
|
-
return node;
|
|
167
|
-
}
|
|
168
|
-
else if (element.getKey() < node.getKey()) {
|
|
169
|
-
node.setLeft(this._cleanup(node.getLeft(), element));
|
|
170
|
-
return node;
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
node.setRight(this._cleanup(node.getRight(), element));
|
|
174
|
-
return node;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
_findMinNode(node) {
|
|
178
|
-
let current = node;
|
|
179
|
-
while (current.getLeft() != null) {
|
|
180
|
-
current = current.getLeft();
|
|
181
|
-
}
|
|
182
|
-
return current;
|
|
183
|
-
}
|
|
184
|
-
list() {
|
|
185
|
-
const results = new Array();
|
|
186
|
-
this._list(this._root, results);
|
|
187
|
-
return results;
|
|
188
|
-
}
|
|
189
|
-
_list(treeNode, results) {
|
|
190
|
-
if (treeNode != null) {
|
|
191
|
-
this._list(treeNode.getLeft(), results);
|
|
192
|
-
treeNode.getData().forEach((element) => {
|
|
193
|
-
results.push(element);
|
|
194
|
-
});
|
|
195
|
-
this._list(treeNode.getRight(), results);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
SortedList = __decorate([
|
|
200
|
-
obsolete({ message: 'Will be removed in excalibur v0.26.0', alternateMethod: 'Use built in JS array.sort' })
|
|
201
|
-
], SortedList);
|
|
202
|
-
export { SortedList };
|
|
203
|
-
/**
|
|
204
|
-
* A tree node part of [[SortedList]]
|
|
205
|
-
* @deprecated Will be removed in v0.26.0
|
|
206
|
-
*/
|
|
207
|
-
let BinaryTreeNode = class BinaryTreeNode {
|
|
208
|
-
constructor(key, data, left, right) {
|
|
209
|
-
this._key = key;
|
|
210
|
-
this._data = data;
|
|
211
|
-
this._left = left;
|
|
212
|
-
this._right = right;
|
|
213
|
-
}
|
|
214
|
-
getKey() {
|
|
215
|
-
return this._key;
|
|
216
|
-
}
|
|
217
|
-
setKey(key) {
|
|
218
|
-
this._key = key;
|
|
219
|
-
}
|
|
220
|
-
getData() {
|
|
221
|
-
return this._data;
|
|
222
|
-
}
|
|
223
|
-
setData(data) {
|
|
224
|
-
this._data = data;
|
|
225
|
-
}
|
|
226
|
-
getLeft() {
|
|
227
|
-
return this._left;
|
|
228
|
-
}
|
|
229
|
-
setLeft(left) {
|
|
230
|
-
this._left = left;
|
|
231
|
-
}
|
|
232
|
-
getRight() {
|
|
233
|
-
return this._right;
|
|
234
|
-
}
|
|
235
|
-
setRight(right) {
|
|
236
|
-
this._right = right;
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
BinaryTreeNode = __decorate([
|
|
240
|
-
obsolete({ message: 'Will be removed in excalibur v0.26.0' })
|
|
241
|
-
], BinaryTreeNode);
|
|
242
|
-
export { BinaryTreeNode };
|
|
243
|
-
/**
|
|
244
|
-
* Mock element for testing
|
|
245
|
-
*
|
|
246
|
-
* @internal
|
|
247
|
-
* @deprecated Will be removed in v0.26.0
|
|
248
|
-
*/
|
|
249
|
-
export class MockedElement {
|
|
250
|
-
constructor(key) {
|
|
251
|
-
this._key = 0;
|
|
252
|
-
this._key = key;
|
|
253
|
-
}
|
|
254
|
-
getTheKey() {
|
|
255
|
-
return this._key;
|
|
256
|
-
}
|
|
257
|
-
setKey(key) {
|
|
258
|
-
this._key = key;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
//# sourceMappingURL=SortedList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SortedList.js","sourceRoot":"","sources":["../../../src/engine/Util/SortedList.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC;;;GAGG;AAEH,IAAa,UAAU,GAAvB,MAAa,UAAU;IAIrB,YAAY,aAAkC;QAC5C,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;IAEM,IAAI,CAAC,OAAU;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IAEO,KAAK,CAAC,IAAuB,E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GAAG,IAAI,CAAC;IACpB,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAEM,OAAO,CAAC,IAAuB;QACpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAEM,QAAQ,CAAC,KAAwB;QACtC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;CACF,CAAA;AA5CY,cAAc;IAD1B,QAAQ,CAAC,EAAC,OAAO,EAAE,sCAAsC,EAAC,CAAC;GAC/C,cAAc,CA4C1B;SA5CY,cAAc;AA8C3B;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IAGxB,YAAY,GAAW;QAFf,SAAI,GAAW,CAAC,CAAC;QAGvB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAEM,SAAS;QACd,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEM,MAAM,CAAC,GAAW;QACvB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;CACF"}
|
package/build/dist/Util/Sound.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Logger } from './Log';
|
|
2
|
-
/**
|
|
3
|
-
* Whether or not the browser can play this file as HTML5 Audio
|
|
4
|
-
*/
|
|
5
|
-
export function canPlayFile(file) {
|
|
6
|
-
try {
|
|
7
|
-
const a = new Audio();
|
|
8
|
-
const filetype = /.*\.([A-Za-z0-9]+)$/;
|
|
9
|
-
const type = file.match(filetype)[1];
|
|
10
|
-
if (a.canPlayType('audio/' + type)) {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
catch (e) {
|
|
18
|
-
Logger.getInstance().warn('Cannot determine audio support, assuming no support for the Audio Tag', e);
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=Sound.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Sound.js","sourceRoot":"","sources":["../../../src/engine/Util/Sound.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,IAAI;QACF,MAAM,CAAC,GAAG,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,QAAQ,GAAG,qBAAqB,CAAC;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACrC,IAAI,CAAC,CAAC,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE;YAClC,OAAO,IAAI,CAAC;SACb;aAAM;YACL,OAAO,KAAK,CAAC;SACd;KACF;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,uEAAuE,EAAE,CAAC,CAAC,CAAC;QACtG,OAAO,KAAK,CAAC;KACd;AACH,CAAC"}
|
package/build/dist/Util/Util.js
DELETED
|
@@ -1,401 +0,0 @@
|
|
|
1
|
-
import { Vector } from '../Math/vector';
|
|
2
|
-
import { Random } from '../Math/Random';
|
|
3
|
-
import { Side } from '../Collision/Side';
|
|
4
|
-
/**
|
|
5
|
-
* Two PI constant
|
|
6
|
-
*/
|
|
7
|
-
export const TwoPI = Math.PI * 2;
|
|
8
|
-
/**
|
|
9
|
-
* Merges one or more objects into a single target object
|
|
10
|
-
*
|
|
11
|
-
* @returns Merged object with properties from other objects
|
|
12
|
-
* @credit https://gomakethings.com/vanilla-javascript-version-of-jquery-extend/
|
|
13
|
-
*/
|
|
14
|
-
export function extend() {
|
|
15
|
-
const extended = {};
|
|
16
|
-
let deep = false;
|
|
17
|
-
let i = 0;
|
|
18
|
-
const length = arguments.length;
|
|
19
|
-
// Check if a deep merge
|
|
20
|
-
if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {
|
|
21
|
-
deep = arguments[0];
|
|
22
|
-
i++;
|
|
23
|
-
}
|
|
24
|
-
// Merge the object into the extended object
|
|
25
|
-
const assignExists = typeof Object.assign === 'function';
|
|
26
|
-
let merge = null;
|
|
27
|
-
if (!assignExists) {
|
|
28
|
-
merge = function (obj) {
|
|
29
|
-
for (const prop in obj) {
|
|
30
|
-
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
|
31
|
-
// If deep merge and property is an object, merge properties
|
|
32
|
-
if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {
|
|
33
|
-
extended[prop] = extend(true, extended[prop], obj[prop]);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
extended[prop] = obj[prop];
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
merge = Object.assign;
|
|
44
|
-
}
|
|
45
|
-
// Loop through each object and conduct a merge
|
|
46
|
-
for (; i < length; i++) {
|
|
47
|
-
const obj = arguments[i];
|
|
48
|
-
if (!assignExists) {
|
|
49
|
-
merge(obj);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
merge(extended, obj);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return extended;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Encode a string in base64
|
|
59
|
-
* @deprecated This will be removed in v0.26.0
|
|
60
|
-
*/
|
|
61
|
-
export function base64Encode(inputStr) {
|
|
62
|
-
const b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
63
|
-
let outputStr = '';
|
|
64
|
-
let i = 0;
|
|
65
|
-
while (i < inputStr.length) {
|
|
66
|
-
//all three "& 0xff" added below are there to fix a known bug
|
|
67
|
-
//with bytes returned by xhr.responseText
|
|
68
|
-
const byte1 = inputStr.charCodeAt(i++) & 0xff;
|
|
69
|
-
const byte2 = inputStr.charCodeAt(i++) & 0xff;
|
|
70
|
-
const byte3 = inputStr.charCodeAt(i++) & 0xff;
|
|
71
|
-
const enc1 = byte1 >> 2;
|
|
72
|
-
const enc2 = ((byte1 & 3) << 4) | (byte2 >> 4);
|
|
73
|
-
let enc3, enc4;
|
|
74
|
-
if (isNaN(byte2)) {
|
|
75
|
-
enc3 = enc4 = 64;
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
enc3 = ((byte2 & 15) << 2) | (byte3 >> 6);
|
|
79
|
-
if (isNaN(byte3)) {
|
|
80
|
-
enc4 = 64;
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
enc4 = byte3 & 63;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
outputStr += b64.charAt(enc1) + b64.charAt(enc2) + b64.charAt(enc3) + b64.charAt(enc4);
|
|
87
|
-
}
|
|
88
|
-
return outputStr;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Sugar that will use `nullishVal` if it's not null or undefined. Simulates the `??` operator
|
|
92
|
-
* @param nullishVal
|
|
93
|
-
* @param defaultVal
|
|
94
|
-
*/
|
|
95
|
-
export function nullish(nullishVal, defaultVal) {
|
|
96
|
-
return nullishVal !== null && nullishVal !== undefined ? nullishVal : defaultVal;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Clamps a value between a min and max inclusive
|
|
100
|
-
*/
|
|
101
|
-
export function clamp(val, min, max) {
|
|
102
|
-
return Math.min(Math.max(min, val), max);
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Find a random floating point number in range
|
|
106
|
-
*/
|
|
107
|
-
export function randomInRange(min, max, random = new Random()) {
|
|
108
|
-
return random ? random.floating(min, max) : min + Math.random() * (max - min);
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Find a random integer in a range
|
|
112
|
-
*/
|
|
113
|
-
export function randomIntInRange(min, max, random = new Random()) {
|
|
114
|
-
return random ? random.integer(min, max) : Math.round(randomInRange(min, max));
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Convert an angle to be the equivalent in the range [0, 2PI]
|
|
118
|
-
*/
|
|
119
|
-
export function canonicalizeAngle(angle) {
|
|
120
|
-
let tmpAngle = angle;
|
|
121
|
-
if (angle > TwoPI) {
|
|
122
|
-
while (tmpAngle > TwoPI) {
|
|
123
|
-
tmpAngle -= TwoPI;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
if (angle < 0) {
|
|
127
|
-
while (tmpAngle < 0) {
|
|
128
|
-
tmpAngle += TwoPI;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return tmpAngle;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Convert radians to degrees
|
|
135
|
-
*/
|
|
136
|
-
export function toDegrees(radians) {
|
|
137
|
-
return (180 / Math.PI) * radians;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Convert degrees to radians
|
|
141
|
-
*/
|
|
142
|
-
export function toRadians(degrees) {
|
|
143
|
-
return (degrees / 180) * Math.PI;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Find the screen position of an HTML element
|
|
147
|
-
*/
|
|
148
|
-
export function getPosition(el) {
|
|
149
|
-
let oLeft = 0, oTop = 0;
|
|
150
|
-
const calcOffsetLeft = (parent) => {
|
|
151
|
-
oLeft += parent.offsetLeft;
|
|
152
|
-
if (parent.offsetParent) {
|
|
153
|
-
calcOffsetLeft(parent.offsetParent);
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
const calcOffsetTop = (parent) => {
|
|
157
|
-
oTop += parent.offsetTop;
|
|
158
|
-
if (parent.offsetParent) {
|
|
159
|
-
calcOffsetTop(parent.offsetParent);
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
calcOffsetLeft(el);
|
|
163
|
-
calcOffsetTop(el);
|
|
164
|
-
return new Vector(oLeft, oTop);
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Add an item to an array list if it doesn't already exist. Returns true if added, false if not and already exists in the array.
|
|
168
|
-
* @deprecated Will be removed in v0.26.0
|
|
169
|
-
*/
|
|
170
|
-
export function addItemToArray(item, array) {
|
|
171
|
-
if (array.indexOf(item) === -1) {
|
|
172
|
-
array.push(item);
|
|
173
|
-
return true;
|
|
174
|
-
}
|
|
175
|
-
return false;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Remove an item from an list
|
|
179
|
-
* @deprecated Will be removed in v0.26.0
|
|
180
|
-
*/
|
|
181
|
-
export function removeItemFromArray(item, array) {
|
|
182
|
-
let index = -1;
|
|
183
|
-
if ((index = array.indexOf(item)) > -1) {
|
|
184
|
-
array.splice(index, 1);
|
|
185
|
-
return true;
|
|
186
|
-
}
|
|
187
|
-
return false;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* See if an array contains something
|
|
191
|
-
*/
|
|
192
|
-
export function contains(array, obj) {
|
|
193
|
-
for (let i = 0; i < array.length; i++) {
|
|
194
|
-
if (array[i] === obj) {
|
|
195
|
-
return true;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
return false;
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Get the opposit side
|
|
202
|
-
* TODO: Move to Side type
|
|
203
|
-
* @deprecated Will be removed in v0.26.0
|
|
204
|
-
*/
|
|
205
|
-
export function getOppositeSide(side) {
|
|
206
|
-
if (side === Side.Top) {
|
|
207
|
-
return Side.Bottom;
|
|
208
|
-
}
|
|
209
|
-
if (side === Side.Bottom) {
|
|
210
|
-
return Side.Top;
|
|
211
|
-
}
|
|
212
|
-
if (side === Side.Left) {
|
|
213
|
-
return Side.Right;
|
|
214
|
-
}
|
|
215
|
-
if (side === Side.Right) {
|
|
216
|
-
return Side.Left;
|
|
217
|
-
}
|
|
218
|
-
return Side.None;
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Returns the side in the direction of the vector supplied
|
|
222
|
-
* @param direction Vector to check
|
|
223
|
-
* @deprecated
|
|
224
|
-
* TODO: Move to Side type
|
|
225
|
-
*/
|
|
226
|
-
export function getSideFromDirection(direction) {
|
|
227
|
-
const directions = [Vector.Left, Vector.Right, Vector.Up, Vector.Down];
|
|
228
|
-
const directionEnum = [Side.Left, Side.Right, Side.Top, Side.Bottom];
|
|
229
|
-
let max = -Number.MAX_VALUE;
|
|
230
|
-
let maxIndex = -1;
|
|
231
|
-
for (let i = 0; i < directions.length; i++) {
|
|
232
|
-
if (directions[i].dot(direction) > max) {
|
|
233
|
-
max = directions[i].dot(direction);
|
|
234
|
-
maxIndex = i;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
return directionEnum[maxIndex];
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Excalibur's dynamically resizing collection
|
|
241
|
-
* @deprecated Will be removed v0.26.0
|
|
242
|
-
*/
|
|
243
|
-
export class Collection {
|
|
244
|
-
/**
|
|
245
|
-
* @param initialSize Initial size of the internal backing array
|
|
246
|
-
*/
|
|
247
|
-
constructor(initialSize = Collection.DefaultSize) {
|
|
248
|
-
this._internalArray = null;
|
|
249
|
-
this._endPointer = 0;
|
|
250
|
-
this._internalArray = new Array(initialSize);
|
|
251
|
-
}
|
|
252
|
-
_resize() {
|
|
253
|
-
const newSize = this._internalArray.length * 2;
|
|
254
|
-
const newArray = new Array(newSize);
|
|
255
|
-
const count = this.count();
|
|
256
|
-
for (let i = 0; i < count; i++) {
|
|
257
|
-
newArray[i] = this._internalArray[i];
|
|
258
|
-
}
|
|
259
|
-
delete this._internalArray;
|
|
260
|
-
this._internalArray = newArray;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Push elements to the end of the collection
|
|
264
|
-
*/
|
|
265
|
-
push(element) {
|
|
266
|
-
if (this._endPointer === this._internalArray.length) {
|
|
267
|
-
this._resize();
|
|
268
|
-
}
|
|
269
|
-
return (this._internalArray[this._endPointer++] = element);
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* Removes elements from the end of the collection
|
|
273
|
-
*/
|
|
274
|
-
pop() {
|
|
275
|
-
this._endPointer = this._endPointer - 1 < 0 ? 0 : this._endPointer - 1;
|
|
276
|
-
return this._internalArray[this._endPointer];
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Returns the count of the collection
|
|
280
|
-
*/
|
|
281
|
-
count() {
|
|
282
|
-
return this._endPointer;
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Empties the collection
|
|
286
|
-
*/
|
|
287
|
-
clear() {
|
|
288
|
-
this._endPointer = 0;
|
|
289
|
-
}
|
|
290
|
-
/**
|
|
291
|
-
* Returns the size of the internal backing array
|
|
292
|
-
*/
|
|
293
|
-
internalSize() {
|
|
294
|
-
return this._internalArray.length;
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Returns an element at a specific index
|
|
298
|
-
* @param index Index of element to retrieve
|
|
299
|
-
*/
|
|
300
|
-
elementAt(index) {
|
|
301
|
-
if (index >= this.count()) {
|
|
302
|
-
//Logger.getInstance().error('Invalid parameter: ' + index);
|
|
303
|
-
throw new Error('Invalid index ' + index);
|
|
304
|
-
}
|
|
305
|
-
return this._internalArray[index];
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* Inserts an element at a specific index
|
|
309
|
-
* @param index Index to insert the element
|
|
310
|
-
* @param value Element to insert
|
|
311
|
-
*/
|
|
312
|
-
insert(index, value) {
|
|
313
|
-
if (index >= this.count()) {
|
|
314
|
-
this._resize();
|
|
315
|
-
}
|
|
316
|
-
return (this._internalArray[index] = value);
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* Removes an element at a specific index
|
|
320
|
-
* @param index Index of element to remove
|
|
321
|
-
*/
|
|
322
|
-
remove(index) {
|
|
323
|
-
const count = this.count();
|
|
324
|
-
if (count === 0) {
|
|
325
|
-
//Logger.getInstance().error('Invalid parameter: ' + index);
|
|
326
|
-
throw new Error('Invalid parameter ' + index);
|
|
327
|
-
}
|
|
328
|
-
// O(n) Shift
|
|
329
|
-
const removed = this._internalArray[index];
|
|
330
|
-
for (let i = index; i < count; i++) {
|
|
331
|
-
this._internalArray[i] = this._internalArray[i + 1];
|
|
332
|
-
}
|
|
333
|
-
this._endPointer--;
|
|
334
|
-
return removed;
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Removes an element by reference
|
|
338
|
-
* @param element Element to retrieve
|
|
339
|
-
*/
|
|
340
|
-
removeElement(element) {
|
|
341
|
-
const index = this._internalArray.indexOf(element);
|
|
342
|
-
this.remove(index);
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* Returns a array representing the collection
|
|
346
|
-
*/
|
|
347
|
-
toArray() {
|
|
348
|
-
return this._internalArray.slice(0, this._endPointer);
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Iterate over every element in the collection
|
|
352
|
-
* @param func Callback to call for each element passing a reference to the element and its index, returned values are ignored
|
|
353
|
-
*/
|
|
354
|
-
forEach(func) {
|
|
355
|
-
let i = 0;
|
|
356
|
-
const count = this.count();
|
|
357
|
-
for (i; i < count; i++) {
|
|
358
|
-
func.call(this, this._internalArray[i], i);
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
/**
|
|
362
|
-
* Mutate every element in the collection
|
|
363
|
-
* @param func Callback to call for each element passing a reference to the element and its index, any values returned mutate
|
|
364
|
-
* the collection
|
|
365
|
-
*/
|
|
366
|
-
map(func) {
|
|
367
|
-
const count = this.count();
|
|
368
|
-
for (let i = 0; i < count; i++) {
|
|
369
|
-
this._internalArray[i] = func.call(this, this._internalArray[i], i);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
/**
|
|
374
|
-
* Default collection size
|
|
375
|
-
*/
|
|
376
|
-
Collection.DefaultSize = 200;
|
|
377
|
-
/**
|
|
378
|
-
* Used for exhaustive checks at compile time
|
|
379
|
-
*/
|
|
380
|
-
export function fail(message) {
|
|
381
|
-
throw new Error(message);
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Generate a range of numbers
|
|
385
|
-
* For example: range(0, 5) -> [0, 1, 2, 3, 4, 5]
|
|
386
|
-
* @param from inclusive
|
|
387
|
-
* @param to inclusive
|
|
388
|
-
*/
|
|
389
|
-
export const range = (from, to) => Array.from(new Array(to - from + 1), (_x, i) => i + from);
|
|
390
|
-
/**
|
|
391
|
-
* Create a promise that resolves after a certain number of milliseconds
|
|
392
|
-
* @param milliseconds
|
|
393
|
-
*/
|
|
394
|
-
export function delay(milliseconds) {
|
|
395
|
-
return new Promise((resolve) => {
|
|
396
|
-
setTimeout(() => {
|
|
397
|
-
resolve();
|
|
398
|
-
}, milliseconds);
|
|
399
|
-
});
|
|
400
|
-
}
|
|
401
|
-
//# sourceMappingURL=Util.js.map
|