Skip to content

Commit

Permalink
Declare fields as readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
vanruesc committed Apr 13, 2024
1 parent 6bfe2d3 commit 008754f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/core/KeyDesign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,31 @@ export class KeyDesign {
* The bit allotments.
*/

private bits: Vector3;
private readonly bits: Vector3;

/**
* The key range.
*/

private range: Vector4;
private readonly range: Vector4;

/**
* A bit mask for the X-coordinate. The first item holds the low bits, the second one holds the high bits.
*/

private maskX: number[];
private readonly maskX: [number, number];

/**
* A bit mask for the Y-coordinate. The first item holds the low bits, the second one holds the high bits.
*/

private maskY: number[];
private readonly maskY: [number, number];

/**
* A bit mask for the Z-coordinate. The first item holds the low bits, the second one holds the high bits.
*/

private maskZ: number[];
private readonly maskZ: [number, number];

/**
* Constructs a new key design.
Expand Down
12 changes: 6 additions & 6 deletions src/core/KeyIterator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,37 @@ export class KeyIterator implements Iterator<number>, Iterable<number> {
* The key design.
*/

private keyDesign: KeyDesign;
private readonly keyDesign: KeyDesign;

/**
* The lower index bounds.
*/

private min: Vector3;
private readonly min: Vector3;

/**
* The upper index bounds.
*/

private max: Vector3;
private readonly max: Vector3;

/**
* The base key coordinates.
*/

private keyBase: Vector3;
private readonly keyBase: Vector3;

/**
* The current key iteration coordinates.
*/

private key: Vector3;
private readonly key: Vector3;

/**
* The iteration limits.
*/

private limit: Vector3;
private readonly limit: Vector3;

/**
* An iterator result.
Expand Down
4 changes: 2 additions & 2 deletions src/core/Octree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,13 @@ export class Octree<T> implements Tree, Iterable<OctantWrapper<T>> {
* The level zero cell size.
*/

private cellSize: Vector3;
private readonly cellSize: Vector3;

/**
* @see {@link keyDesign}
*/

private _keyDesign: KeyDesign;
private readonly _keyDesign: KeyDesign;

/**
* The hierarchical octant grids.
Expand Down

0 comments on commit 008754f

Please sign in to comment.