remove duplicated function

This commit is contained in:
Zutatensuppe 2020-11-12 19:30:17 +01:00
parent 3dc9edeee6
commit dad92aef4a

View file

@ -179,13 +179,6 @@ const setTilesOwner = (gameId, tileIdxs, owner) => {
} }
} }
function pointInBounds(pt, rect) {
return pt.x >= rect.x
&& pt.x <= rect.x + rect.w
&& pt.y >= rect.y
&& pt.y <= rect.y + rect.h
}
// get all grouped tiles for a tile // get all grouped tiles for a tile
function getGroupedTileIdxs(gameId, tileIdx) { function getGroupedTileIdxs(gameId, tileIdx) {
const tiles = GAMES[gameId].puzzle.tiles const tiles = GAMES[gameId].puzzle.tiles
@ -224,7 +217,7 @@ const freeTileIdxByPos = (gameId, pos) => {
w: info.tileSize, w: info.tileSize,
h: info.tileSize, h: info.tileSize,
} }
if (pointInBounds(pos, collisionRect)) { if (Geometry.pointInBounds(pos, collisionRect)) {
if (maxZ === -1 || tile.z > maxZ) { if (maxZ === -1 || tile.z > maxZ) {
maxZ = tile.z maxZ = tile.z
tileIdx = idx tileIdx = idx