diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-08-25 16:48:17 -0600 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-08-25 16:48:17 -0600 |
commit | 773ce84f4bf559337e132edd7fcce02a0a2598fd (patch) | |
tree | 5fd0b452b459cc5a5b6a1ed98f2d7b9af950864d /engine/structures/Grid.ts | |
parent | dec7b614d895a1b507137e4a96a8999ff63aa179 (diff) | |
download | jumpstorm-773ce84f4bf559337e132edd7fcce02a0a2598fd.tar.gz jumpstorm-773ce84f4bf559337e132edd7fcce02a0a2598fd.zip |
prettier formatting
Diffstat (limited to 'engine/structures/Grid.ts')
-rw-r--r-- | engine/structures/Grid.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/engine/structures/Grid.ts b/engine/structures/Grid.ts index 6e8c0cb..5f0e053 100644 --- a/engine/structures/Grid.ts +++ b/engine/structures/Grid.ts @@ -1,6 +1,6 @@ -import type { Coord2D, Dimension2D } from "../interfaces"; -import type { BoxedEntry, RefreshingCollisionFinderBehavior } from "."; -import { Miscellaneous } from "../config/constants"; +import type { Coord2D, Dimension2D } from '../interfaces'; +import type { BoxedEntry, RefreshingCollisionFinderBehavior } from '.'; +import { Miscellaneous } from '../config/constants'; export class Grid implements RefreshingCollisionFinderBehavior { private cellEntities: Map<number, string[]>; @@ -12,11 +12,11 @@ export class Grid implements RefreshingCollisionFinderBehavior { constructor( gridDimension: Dimension2D = { width: Miscellaneous.WIDTH, - height: Miscellaneous.HEIGHT, + height: Miscellaneous.HEIGHT }, cellDimension: Dimension2D = { width: Miscellaneous.DEFAULT_GRID_WIDTH, - height: Miscellaneous.DEFAULT_GRID_HEIGHT, + height: Miscellaneous.DEFAULT_GRID_HEIGHT }, topLeft = { x: 0, y: 0 } ) { @@ -73,7 +73,7 @@ export class Grid implements RefreshingCollisionFinderBehavior { const translated: Coord2D = { y: center.y - this.topLeft.y, - x: center.x - this.topLeft.x, + x: center.x - this.topLeft.x }; const topLeftBox = { @@ -82,7 +82,7 @@ export class Grid implements RefreshingCollisionFinderBehavior { ), y: Math.floor( (translated.y - dimension.height / 2) / this.cellDimension.height - ), + ) }; const bottomRightBox = { x: Math.floor( @@ -90,7 +90,7 @@ export class Grid implements RefreshingCollisionFinderBehavior { ), y: Math.floor( (translated.y + dimension.height / 2) / this.cellDimension.height - ), + ) }; const cells: number[] = []; |