wgge 1.0.18 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/model/ModelBase.js
CHANGED
|
@@ -153,13 +153,13 @@ export default class Vector2 extends ObjectModel {
|
|
|
153
153
|
return Math.max(distX, distY) <= size;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
getDirectNeighborPositions(
|
|
156
|
+
getDirectNeighborPositions(includeCenter = false) {
|
|
157
157
|
const positions = [];
|
|
158
|
-
if (includeCenter) positions.push(
|
|
159
|
-
positions.push(new Vector2(
|
|
160
|
-
positions.push(new Vector2(
|
|
161
|
-
positions.push(new Vector2(
|
|
162
|
-
positions.push(new Vector2(
|
|
158
|
+
if (includeCenter) positions.push(this);
|
|
159
|
+
positions.push(new Vector2(this.x - 1, this.y));
|
|
160
|
+
positions.push(new Vector2(this.x, this.y - 1));
|
|
161
|
+
positions.push(new Vector2(this.x + 1, this.y));
|
|
162
|
+
positions.push(new Vector2(this.x, this.y + 1));
|
|
163
163
|
return positions;
|
|
164
164
|
}
|
|
165
165
|
|