diff --git a/MapBuilderForWeb/BuilderVisuals.js b/MapBuilderForWeb/BuilderVisuals.js index feee945..05b5539 100644 --- a/MapBuilderForWeb/BuilderVisuals.js +++ b/MapBuilderForWeb/BuilderVisuals.js @@ -6,16 +6,17 @@ let value = "646970303030"; var isClicking = false; - function AddHoverListenerToElements(elements){ + function AddHoverListenerToElements(elements, callback){ for(let i=0; i in the and appends into tbl.appendChild(tblBody); body.appendChild(tbl); - tbl.setAttribute("border", "2"); + //tbl.setAttribute("border", "2"); return tbl; } diff --git a/MapBuilderForWeb/MapBuilder.js b/MapBuilderForWeb/MapBuilder.js index 27a8677..a0303da 100644 --- a/MapBuilderForWeb/MapBuilder.js +++ b/MapBuilderForWeb/MapBuilder.js @@ -11,17 +11,19 @@ } - var occupancyMap; const OCCUPIED = true; const FREE = false; const OUT_OF_BOUNDS = 2; const OBSTRUCTED = 3; const MAP_CUT = 4; + const NULL = 5; function GetOccupancyOfPlacingInfo(){ - //If at least one coordenate is occupied, then return occupied - let mapLengthX = occupancyMap.length; - let mapLengthY = occupancyMap[0].length; + + //let mapLengthX = occupancyMap.length; + //let mapLengthY = occupancyMap[0].length; + let occupancyMap = occupancyMaps[currentItemPlacingInfo.level.x][currentItemPlacingInfo.level.y]; + let x = currentItemPlacingInfo.coordenates.x; let y = currentItemPlacingInfo.coordenates.y; @@ -29,7 +31,7 @@ let state = ( occupancyMap[ currentItemPlacingInfo.positionX ][ currentItemPlacingInfo.positionY ] ); if( state == null){ - return MAP_CUT; + return NULL; } if( state == OCCUPIED){ return OCCUPIED; @@ -54,6 +56,7 @@ function UpdateOccupancy(coordenates, state){ + let occupancyMap = occupancyMaps[currentItemPlacingInfo.level.x][currentItemPlacingInfo.level.y]; for(var i=0; i -

Item Type: 0
Rotation: 0
Coordenate: 0 , 0
+

Item Type: 0
Level: 0,0
Rotation: 0
Coordenate: 0 , 0