UNPKG

shaku

Version:

A simple and effective JavaScript game development framework that knows its place!

1,060 lines (979 loc) 26.3 kB
/** * A 3d box shape. * Based on code from THREE.js. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\box.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * A 3d frustum shape. * Based on code from THREE.js. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\frustum.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * A plane in 3D space. * Based on code from THREE.js. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\plane.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * A utility to provide gametime and delta between frames. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\game_time.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * All default collision detection implementations. * * |-- copyright and license --| * @module Shaku * @file shaku\src\collision\resolvers_imp.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * An interface for a batch renderer. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\draw_batches\draw_batch.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Assets base class. * * |-- copyright and license --| * @module Shaku * @file shaku\src\assets\asset.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Camera class. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\camera.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Camera class. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\camera3d.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Define a color object. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\color.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Define a gamepad object. * * |-- copyright and license --| * @module Shaku * @file shaku\src\input\gamepad.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Define a sprite object we can draw using sprite batches. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\sprite.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Define a sprites group. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\sprites_group.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Define possible text alignments. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\text_alignments.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Define possible texture filter modes. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\texture_filter_modes.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Define possible texture wrap modes. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\texture_wrap_modes.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Define supported blend modes. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\blend_modes.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Define supported usage modes. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\draw_batches\buffers_usage.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Define the managers interface. * * |-- copyright and license --| * @module Shaku * @file shaku\src\manager.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Effect base class. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\effects\effect.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Entry point for the Shaku module. * * |-- copyright and license --| * @module Shaku * @file shaku\src\index.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a 3d vector. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\vector3.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a MSDF font texture asset type. * * |-- copyright and license --| * @module Shaku * @file shaku\src\assets\msdf_font_texture_asset.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a basic effect to draw 3d sprites. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\effects\sprites_3d.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a basic effect to draw sprites with outline. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\effects\sprites_with_outline.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a basic effect to draw sprites without vertex color. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\effects\sprites_no_vertex_color.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a basic effect to draw sprites. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\effects\shapes.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a basic effect to draw sprites. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\effects\sprites.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a font texture asset type. * * |-- copyright and license --| * @module Shaku * @file shaku\src\assets\font_texture_asset.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a math utilities class. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\math_helper.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a seeded random generator. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\seeded_random.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a simple 2d circle. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\circle.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a simple 2d line. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\line.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a simple 2d rectangle. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\rectangle.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a simple 2d vector. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\vector2.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a simple 3d sphere. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\sphere.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a sound effect instance. * * |-- copyright and license --| * @module Shaku * @file shaku\src\sfx\sound_instance.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a storage adapter. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\storage_adapter.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement a storage wrapper. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\storage.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement an animator helper class. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\animator.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement an effect to draw MSDF font textures. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\effects\msdf_font.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement basic logger. * By default, uses console for logging, but it can be replaced with setDrivers(). * * |-- copyright and license --| * @module Shaku * @file shaku\src\logger.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement binary data asset type. * * |-- copyright and license --| * @module Shaku * @file shaku\src\assets\binary_asset.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement collision circle. * * |-- copyright and license --| * @module Shaku * @file shaku\src\collision\shapes\circle.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement collision lines. * * |-- copyright and license --| * @module Shaku * @file shaku\src\collision\shapes\lines.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement collision point. * * |-- copyright and license --| * @module Shaku * @file shaku\src\collision\shapes\point.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement collision rectangle. * * |-- copyright and license --| * @module Shaku * @file shaku\src\collision\shapes\rectangle.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement collision shape base class. * * |-- copyright and license --| * @module Shaku * @file shaku\src\collision\shapes\shape.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement collision tilemap. * * |-- copyright and license --| * @module Shaku * @file shaku\src\collision\shapes\tilemap.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement json asset type. * * |-- copyright and license --| * @module Shaku * @file shaku\src\assets\json_asset.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement sound asset type. * * |-- copyright and license --| * @module Shaku * @file shaku\src\assets\sound_asset.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement texture asset base type. * * |-- copyright and license --| * @module Shaku * @file shaku\src\assets\texture_asset_base.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement texture asset type. * * |-- copyright and license --| * @module Shaku * @file shaku\src\assets\texture_asset.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement texture asset type. * * |-- copyright and license --| * @module Shaku * @file shaku\src\assets\texture_in_atlas_asset.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement texture atlas asset type. * * |-- copyright and license --| * @module Shaku * @file shaku\src\assets\texture_atlas_asset.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement the assets manager. * * |-- copyright and license --| * @module Shaku * @file shaku\src\assets\assets.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement the collision manager. * * |-- copyright and license --| * @module Shaku * @file shaku\src\collision\collision.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement the collision manager. * * |-- copyright and license --| * @module Shaku * @file shaku\src\collision\collision_world.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement the collision resolver class. * * |-- copyright and license --| * @module Shaku * @file shaku\src\collision\resolver.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement the gfx lines batch renderer. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\draw_batches\lines_batch.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement the gfx manager. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\gfx.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement the gfx shapes batch renderer. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\draw_batches\shapes_batch.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement the gfx sprite batch renderer base class. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\draw_batches\sprite_batch_base.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement the gfx sprite batch renderer. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\draw_batches\sprite_batch.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement the gfx sprite batch renderer. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\draw_batches\sprite_batch_3d.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement the gfx text sprite batch renderer. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\draw_batches\text_batch.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement the gfx vertex container. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\vertex.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement the input manager. * * |-- copyright and license --| * @module Shaku * @file shaku\src\input\input.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implement the sfx manager. * * |-- copyright and license --| * @module Shaku * @file shaku\src\sfx\sfx.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implements 2d perlin noise generator. * Based on code from noisejs by Stefan Gustavson. * https://github.com/josephg/noisejs/blob/master/perlin.js * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\perlin.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Implements an algorithm to sort as many rectangles as possible in the smallest possible region. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\items_sorter.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Include all built-in effects. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\effects\index.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Include all util classes. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\index.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Just an alias to main manager so we can require() this folder as a package. * * |-- copyright and license --| * @module Shaku * @file shaku\src\assets\index.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Just an alias to main manager so we can require() this folder as a package. * * |-- copyright and license --| * @module Shaku * @file shaku\src\collision\index.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Just an alias to main manager so we can require() this folder as a package. * * |-- copyright and license --| * @module Shaku * @file shaku\src\gfx\index.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Just an alias to main manager so we can require() this folder as a package. * * |-- copyright and license --| * @module Shaku * @file shaku\src\input\index.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Just an alias to main manager so we can require() this folder as a package. * * |-- copyright and license --| * @module Shaku * @file shaku\src\sfx\index.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Matrix class. * Based on code from https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Matrix_math_for_the_web * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\matrix.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Shaku Main. * * |-- copyright and license --| * @module Shaku * @file shaku\src\shaku.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */ /** * Transformations object to store position, rotation and scale, that also support transformations inheritance. * * |-- copyright and license --| * @module Shaku * @file shaku\src\utils\transformation.js * @author Ronen Ness (ronenness@gmail.com | http://ronenness.com) * @copyright (c) 2021 Ronen Ness * @license MIT * |-- end copyright and license --| * */