public void copyDataFromOneToAnother(SimpleRoom_Building otherRoom)
 {
     clearanceLevel        = otherRoom.getClearanceLevel();
     previousRoomDirection = otherRoom.getPreviousRoomDirection();
     containsDoor          = otherRoom.getContainsDoor();
     containsItem          = otherRoom.getContainsItem();
     isNotEmpty            = otherRoom.getIsNotEmpty();
 }
Beispiel #2
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.
        }