ricskooo

Untitled

Mar 7th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. public class Person {
  2. private String name;
  3. private int age;
  4. private boolean isEmployee;
  5. private Room room;
  6. private Building building;
  7.  
  8.  
  9. public Person(String name, int age, boolean isEmployee) {
  10. this.name = name;
  11. this.age = age;
  12. this.isEmployee = isEmployee;
  13. }
  14.  
  15. public boolean enterRoom(Person pObject, int szobaszam){ //building tömb szobaszámáinak indexje
  16. if(building.getRooms()[szobaszam] == null)
  17. return true;
  18. return false;
  19. }
  20.  
  21. public void leaveRoom(Person pObject){
  22. for (int i = 0; i < room.getPerson().length;i++){
  23. if(room.getPerson()[i].equals(pObject)){
  24. room.getPerson()[i] = null;
  25. }
  26.  
  27. }
  28. }
  29.  
  30. public String getName() {
  31. return name;
  32. }
  33.  
  34. public void setName(String name) {
  35. this.name = name;
  36. }
  37.  
  38. public int getAge() {
  39. return age;
  40. }
  41.  
  42. public void setAge(int age) {
  43. this.age = age;
  44. }
  45.  
  46. public boolean isEmployee() {
  47. return isEmployee;
  48. }
  49.  
  50. public void setEmployee(boolean employee) {
  51. isEmployee = employee;
  52. }
  53.  
  54. public Room getRoom() {
  55. return room;
  56. }
  57.  
  58. public void setRoom(Room room) {
  59. this.room = room;
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment