Skip to content

Commit

Permalink
[#1091] convert object pool to an instantiable class
Browse files Browse the repository at this point in the history
with the global pool property now being an instance of the new ObjectPool Class
  • Loading branch information
obiot committed May 13, 2022
1 parent 791b580 commit 898ea6c
Show file tree
Hide file tree
Showing 36 changed files with 191 additions and 184 deletions.
2 changes: 1 addition & 1 deletion src/camera/camera2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Matrix3d from "./../math/matrix3.js";
import Rect from "./../geometries/rectangle.js";
import { renderer } from "./../video/video.js";
import * as event from "./../system/event.js";
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";
import Renderable from "./../renderable/renderable.js";
import {clamp, toBeCloseTo} from "./../math/math.js";
import { world } from "./../game.js";
Expand Down
2 changes: 1 addition & 1 deletion src/geometries/ellipse.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";

/**
* @classdesc
Expand Down
2 changes: 1 addition & 1 deletion src/geometries/line.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";
import Polygon from "./poly.js";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/geometries/path2d.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";
import { TAU } from "./../math/math.js";
import earcut from "earcut";

Expand Down
2 changes: 1 addition & 1 deletion src/geometries/poly.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import earcut from "earcut";
import Vector2d from "./../math/vector2.js";
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";

/**
* @classdesc
Expand Down
2 changes: 1 addition & 1 deletion src/geometries/rectangle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";
import Polygon from "./poly.js";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { plugin, plugins } from "./plugin/plugin.js";
import * as video from "./video/video.js";
import save from "./system/save.js";
import timer from "./system/timer.js";
import * as pool from "./system/pooling.js";
import pool from "./system/pooling.js";
import state from "./state/state.js";
import level from "./level/level.js";

Expand Down
2 changes: 1 addition & 1 deletion src/input/pointerevent.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { throttle } from "./../utils/function.js";
import { remove } from "./../utils/array.js";
import * as event from "./../system/event.js";
import timer from "./../system/timer.js";
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";
import device from "./../system/device.js";
import Pointer from "./pointer.js";
import Rect from "./../geometries/rectangle.js";
Expand Down
2 changes: 1 addition & 1 deletion src/level/tiled/TMXLayer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createCanvas } from "./../../video/video.js";
import * as pool from "./../../system/pooling.js";
import pool from "./../../system/pooling.js";
import * as TMXUtils from "./TMXUtils.js";
import Tile from "./TMXTile.js";
import Renderable from "./../../renderable/renderable.js";
Expand Down
2 changes: 1 addition & 1 deletion src/level/tiled/TMXObject.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as pool from "./../../system/pooling.js";
import pool from "./../../system/pooling.js";
import { applyTMXProperties } from "./TMXUtils.js";
import Tile from "./TMXTile.js";
import Ellipse from "./../../geometries/ellipse.js";
Expand Down
2 changes: 1 addition & 1 deletion src/level/tiled/TMXTileMap.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as pool from "./../../system/pooling.js";
import pool from "./../../system/pooling.js";
import * as event from "./../../system/event.js";
import { viewport } from "./../../game.js";
import collision from "./../../physics/collision.js";
Expand Down
2 changes: 1 addition & 1 deletion src/level/tiled/renderer/TMXHexagonalRenderer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Vector2d from "./../../../math/vector2.js";
import * as pool from "./../../../system/pooling.js";
import pool from "./../../../system/pooling.js";
import TMXRenderer from "./TMXRenderer.js";
import TMXLayer from "./../TMXLayer.js";

Expand Down
2 changes: 1 addition & 1 deletion src/level/tiled/renderer/TMXIsometricRenderer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Vector2d from "./../../../math/vector2.js";
import * as pool from "./../../../system/pooling.js";
import pool from "./../../../system/pooling.js";
import TMXRenderer from "./TMXRenderer.js";
import TMXLayer from "./../TMXLayer.js";

Expand Down
2 changes: 1 addition & 1 deletion src/level/tiled/renderer/TMXOrthogonalRenderer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Vector2d from "./../../../math/vector2.js";
import * as pool from "./../../../system/pooling.js";
import pool from "./../../../system/pooling.js";
import TMXRenderer from "./TMXRenderer.js";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/level/tiled/renderer/TMXRenderer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-unused-vars */

import * as pool from "./../../../system/pooling.js";
import pool from "./../../../system/pooling.js";
import TMXLayer from "./../TMXLayer.js";
import Bounds from "./../../../physics/Bounds.js";

Expand Down
2 changes: 1 addition & 1 deletion src/level/tiled/renderer/TMXStaggeredRenderer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Vector2d from "./../../../math/vector2.js";
import * as pool from "./../../../system/pooling.js";
import pool from "./../../../system/pooling.js";
import TMXHexagonalRenderer from "./TMXHexagonalRenderer.js";
import { degToRad } from "./../../../math/math.js";

Expand Down
2 changes: 1 addition & 1 deletion src/loader/loadingscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { world, viewport } from "./../game.js";
import { createCanvas, renderer } from "./../video/video.js";
import * as event from "./../system/event.js";
import {nextPowerOfTwo} from "./../math/math.js";
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";
import Renderable from "./../renderable/renderable.js";
import Stage from "./../state/stage.js";

Expand Down
2 changes: 1 addition & 1 deletion src/math/color.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { clamp, random } from "./math.js";
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";

// convert a give color component to it hexadecimal value
var toHex = function (component) {
Expand Down
2 changes: 1 addition & 1 deletion src/math/matrix2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";
import Matrix3d from "./matrix3.js";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/math/matrix3.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";
import { EPSILON } from "./math.js";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/math/observable_vector2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";
import Vector2d from "./vector2.js";
import {clamp} from "./math.js";

Expand Down
2 changes: 1 addition & 1 deletion src/math/observable_vector3.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vector3d from "./vector3.js";
import {clamp} from "./math.js";
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";

/**
* @classdesc
Expand Down
2 changes: 1 addition & 1 deletion src/math/vector2.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {clamp} from "./math.js";
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";

/**
* @classdesc
Expand Down
2 changes: 1 addition & 1 deletion src/math/vector3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {clamp} from "./math.js";
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";

/**
* @classdesc
Expand Down
2 changes: 1 addition & 1 deletion src/particles/emitter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createCanvas } from "./../video/video.js";
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";
import ParticleEmitterSettings from "./settings.js";
import { randomFloat } from "./../math/math.js";
import Container from "./../renderable/container.js";
Expand Down
2 changes: 1 addition & 1 deletion src/physics/bounds.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";
import Vector2d from "./../math/vector2.js";
import Polygon from "./../geometries/poly.js";

Expand Down
2 changes: 1 addition & 1 deletion src/renderable/colorlayer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";
import { viewport } from "./../game.js";
import Renderable from "./renderable.js";

Expand Down
2 changes: 1 addition & 1 deletion src/renderable/container.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import utils from "./../utils/utils.js";
import * as game from "./../game.js";
import * as event from "./../system/event.js";
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";
import state from "./../state/state.js";
import Renderable from "./renderable.js";
import Body from "./../physics/body.js";
Expand Down
2 changes: 1 addition & 1 deletion src/renderable/imagelayer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { renderer } from "./../video/video.js";
import * as event from "./../system/event.js";
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";
import { viewport } from "./../game.js";
import Sprite from "./sprite.js";
import * as stringUtil from "./../utils/string.js";
Expand Down
2 changes: 1 addition & 1 deletion src/renderable/renderable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ObservableVector2d from "./../math/observable_vector2.js";
import ObservableVector3d from "./../math/observable_vector3.js";
import Rect from "./../geometries/rectangle.js";
import Container from "./container.js";
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";
import { releaseAllPointerEvents } from "./../input/input.js";
import { clamp } from "./../math/math.js";

Expand Down
2 changes: 1 addition & 1 deletion src/renderable/sprite.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vector2d from "./../math/vector2.js";
import { renderer } from "./../video/video.js";
import * as pool from "./../system/pooling.js";
import pool from "./../system/pooling.js";
import loader from "./../loader/loader.js";
import { TextureAtlas } from "./../video/texture.js";
import Renderable from "./renderable.js";
Expand Down
Loading

0 comments on commit 898ea6c

Please sign in to comment.