示例#1
0
        private static void fillOutOutputRoomData_checkULCorner(SimpleRoom_Output thisRoom_output, SimpleRoom_Output leftRoom_output,
                                                                SimpleRoom_Output upRoom_output, SimpleRoom_Output diagonalRoom_output,
                                                                SimpleRoom_Building thisRoom_building, SimpleRoom_Building leftRoom_building,
                                                                SimpleRoom_Building upRoom_building, SimpleRoom_Building diagonalRoom_building)
        {
            // If any of these rooms are empty, keep the corner closed:
            if (!thisRoom_output.getIsNotEmpty() || !leftRoom_output.getIsNotEmpty() ||
                !upRoom_output.getIsNotEmpty() || !diagonalRoom_output.getIsNotEmpty())
            {
                return;
            }

            // Check all eight walls connected to this corner. If all of them are open, open up the corner:
            if (thisRoom_output.getWallIsOpen(Constants.doorID_up) && thisRoom_output.getWallIsOpen(Constants.doorID_left) &&
                // leftRoom_output.getWallIsOpen(Constants.doorID_up) && leftRoom_output.getWallIsOpen(Constants.doorID_right) &&
                // upRoom_output.getWallIsOpen(Constants.doorID_down) && upRoom_output.getWallIsOpen(Constants.doorID_left) &&
                diagonalRoom_output.getWallIsOpen(Constants.doorID_down) && diagonalRoom_output.getWallIsOpen(Constants.doorID_right) &&
                (thisRoom_building.getContainsDoor() == Constants.simplified_doorStatus_undefined ||
                 thisRoom_building.getPreviousRoomDirection() == Constants.doorID_right || thisRoom_building.getPreviousRoomDirection() == Constants.doorID_down) &&
                (leftRoom_building.getContainsDoor() == Constants.simplified_doorStatus_undefined ||
                 leftRoom_building.getPreviousRoomDirection() == Constants.doorID_left || leftRoom_building.getPreviousRoomDirection() == Constants.doorID_down) &&
                (upRoom_building.getContainsDoor() == Constants.simplified_doorStatus_undefined ||
                 upRoom_building.getPreviousRoomDirection() == Constants.doorID_up || upRoom_building.getPreviousRoomDirection() == Constants.doorID_right) &&
                (diagonalRoom_building.getContainsDoor() == Constants.simplified_doorStatus_undefined ||
                 diagonalRoom_building.getPreviousRoomDirection() == Constants.doorID_up || diagonalRoom_building.getPreviousRoomDirection() == Constants.doorID_left))
            {
                thisRoom_output.setCornerAsOpen(Constants.cornerID_ul);
                leftRoom_output.setCornerAsOpen(Constants.cornerID_ur);
                upRoom_output.setCornerAsOpen(Constants.cornerID_dl);
                diagonalRoom_output.setCornerAsOpen(Constants.cornerID_dr);
            }
        }
示例#2
0
        // ------------------------------------------------------------------------------------------------------
        // ----------- Output Packet stuff: --------------------------------------------------------
        // ------------------------------------------------------------------------------------------------------

        public static SimpleRoom_Output[,] instantiateRooms_Output(byte width, byte height)
        {
            SimpleRoom_Output[,] returnArray = new SimpleRoom_Output[width, height];

            for (int indexX = 0; indexX < width; indexX++)
            {
                for (int indexY = 0; indexY < height; indexY++)
                {
                    returnArray[indexX, indexY] = new SimpleRoom_Output();
                }
            }

            return(returnArray);
        }
示例#3
0
        private static void fillOutOutputRoomData_checkAdjacentDoors(SimpleRoom_Building thisRoom_building, SimpleRoom_Building adjRoom_building,
                                                                     SimpleRoom_Output thisRoom_output, SimpleRoom_Output adjRoom_output,
                                                                     byte thisRoomConnection, byte adjRoomConnection)
        {
            // thisRoomConnection should be either Constants.doorID_right or Constants.doorID_down,
            // while adjRoomConnection should be either Constants.doorID_left or Constants.doorID_up.

            // If this room has no building entry, keep the output empty as well:
            if (!thisRoom_building.getIsNotEmpty() || !adjRoom_building.getIsNotEmpty())
            {
                return;
            }

            // If the rooms share a clearance level, or if they are connected by a door, open their walls:
            if (thisRoom_building.getClearanceLevel() == adjRoom_building.getClearanceLevel() ||
                (thisRoom_building.getContainsDoor() != Constants.simplified_doorStatus_undefined && thisRoom_building.getPreviousRoomDirection() == thisRoomConnection) ||
                (adjRoom_building.getContainsDoor() != Constants.simplified_doorStatus_undefined && adjRoom_building.getPreviousRoomDirection() == adjRoomConnection))
            {
                thisRoom_output.setWallAsOpen(thisRoomConnection);
                adjRoom_output.setWallAsOpen(adjRoomConnection);
            }

            // If not, both walls will stay closed.
        }