Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Building;
- import java.util.Arrays;
- /**
- * Created by Ricsko on 2017. 03. 01..
- */
- public class Building {
- protected Room[] roomNumbers;
- protected boolean open;
- private static int iAdd = 0;
- private static int iRemove = 0;
- public Building(int numboffuckingrooms, boolean open) {
- this.roomNumbers = new Room[numboffuckingrooms];
- this.open = open;
- }
- public boolean addRoom(Room RObject){
- if(iAdd < roomNumbers.length){
- roomNumbers[iAdd] = RObject;
- iAdd++;
- return true;
- }
- return false;
- }
- public void removeRoom(Room ROjbect){
- if(iRemove < roomNumbers.length){
- if(roomNumbers[iRemove].equals(ROjbect)){
- roomNumbers[iRemove] = null;
- }
- }
- }
- public void kiirBuilding(){
- System.out.println(this);
- }
- @Override
- public String toString() {
- return "Building{" +
- "roomNumbers=" + Arrays.toString(roomNumbers) +
- ", open=" + open +
- '}';
- }
- }
Add Comment
Please, Sign In to add comment