Example #1
0
        public room placeRoom(levelData myData)
        {
            int maxLeng = myData.maxWidth;
            int minLeng = myData.minWidth;
            int xLeng   = irandom(minLeng, maxLeng);
            int yLeng   = irandom(minLeng, maxLeng);
            int zLeng   = irandom(minLeng, maxLeng);
            //assumes mapWidth is greater than maxLeng
            int x = irandom(1, mapWidth - xLeng - 1);
            int y = irandom(1, mapWidth - yLeng - 1);
            int z = irandom(1, mapWidth - zLeng - 1);

            myGrid.setRegion(x, y, z, xLeng, yLeng, zLeng, 1);
            room tempRoom = new room(x, y, z, xLeng, yLeng, zLeng, 1);

            return(tempRoom);
        }
Example #2
0
 public void setRegion(room myRoom)
 {
     setRegion(myRoom.x, myRoom.y, myRoom.z, myRoom.xWidth, myRoom.yWidth, myRoom.zWidth, myRoom.val);
 }