Comparing version 0.7.5 to 0.7.51
{ | ||
"name": "squishjs", | ||
"version": "0.7.5", | ||
"version": "0.7.51", | ||
"description": "squish & unsquish stuff", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -71,6 +71,6 @@ const listenable = require("./util/listenable"); | ||
findChild(id) { | ||
return this.#findChildHelper(id, this); | ||
return this.findChildHelper(id, this); | ||
} | ||
#findChildHelper(nodeId, node, found = null) { | ||
findChildHelper(nodeId, node, found = null) { | ||
if (node.node.id === nodeId) { | ||
@@ -84,3 +84,3 @@ found = node; | ||
} | ||
found = this.#findChildHelper(nodeId, node.node.children[i], found); | ||
found = this.findChildHelper(nodeId, node.node.children[i], found); | ||
} | ||
@@ -87,0 +87,0 @@ |
@@ -15,11 +15,8 @@ const { GameNode } = require('./GameNode'); | ||
class ViewableGame extends Game { | ||
#plane; | ||
#fakeRoot; | ||
#planeSize; | ||
constructor(planeSize) { | ||
super(); | ||
this.#planeSize = planeSize; | ||
this.#plane = makePlane(this.planeSize); | ||
this.planeSize = planeSize; | ||
this.plane = makePlane(this.planeSize); | ||
this.#fakeRoot = new GameNode.Shape({ | ||
this.fakeRoot = new GameNode.Shape({ | ||
shapeType: Shapes.POLYGON, | ||
@@ -32,3 +29,3 @@ coordinates2d: ShapeUtils.rectangle(0, 0, 0, 0), | ||
{ | ||
root: this.#fakeRoot | ||
root: this.fakeRoot | ||
} | ||
@@ -39,4 +36,4 @@ ]; | ||
updatePlaneSize(s) { | ||
this.#planeSize = s; | ||
this.#plane.node.coordinates2d = ShapeUtils.rectangle(0, 0, s, s); | ||
this.planeSize = s; | ||
this.plane.node.coordinates2d = ShapeUtils.rectangle(0, 0, s, s); | ||
} | ||
@@ -49,11 +46,11 @@ | ||
getPlane() { | ||
return this.#plane; | ||
return this.plane; | ||
} | ||
getPlaneSize() { | ||
return this.#planeSize; | ||
return this.planeSize; | ||
} | ||
getViewRoot() { | ||
return this.#fakeRoot; | ||
return this.fakeRoot; | ||
} | ||
@@ -60,0 +57,0 @@ |
153494
2867