Skip to content

Commit

Permalink
use Position class
Browse files Browse the repository at this point in the history
  • Loading branch information
bob0005 committed Aug 12, 2024
1 parent c0d5fc8 commit 8b253a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/src/three/scenes/Worldmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,12 @@ export default class WorldmapScene extends HexagonScene {
}

private _canBuildStructure(hexCoords: HexPosition) {
const contractPos = new Position({ x: hexCoords.col, y: hexCoords.row }).getContract();

const isStructure = this.structureManager.structuresMap.get(hexCoords.col)?.has(hexCoords.row) || false;
const isExplored = this.exploredTiles.get(hexCoords.col)?.has(hexCoords.row) || false;

const biomeType = this.biome.getBiome(hexCoords.col + FELT_CENTER, hexCoords.row + FELT_CENTER);
const biomeType = this.biome.getBiome(contractPos.x, contractPos.y);
const isOcean = biomeType === BiomeType.Ocean || biomeType === BiomeType.DeepOcean;

return !isStructure && isExplored && !isOcean;
Expand Down

0 comments on commit 8b253a3

Please sign in to comment.