-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuilding.java
100 lines (80 loc) · 1.67 KB
/
Building.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
* Default building object class
*/
public class Building {
#hi
String name;
String type;
int code = 0;
int number;
int x;
int y;
boolean accessible = true;
public Building(String details){
String[] buildingDetails = details.split(",");
this.name = buildingDetails[0];
this.type = buildingDetails[1];
this.number = Integer.parseInt(buildingDetails[2]);
this.x = Integer.parseInt(buildingDetails[3]);
this.y = Integer.parseInt(buildingDetails[4]);
}
public Building(String name, int code, int number, int x, int y,
boolean accessible) {
super();
this.name = name;
this.code = code;
this.number = number;
this.x = x;
this.y = y;
this.accessible = accessible;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
public String getXY(){
String xy = Integer.toString(x) + "," + Integer.toString(y);
return xy;
}
public boolean isAccessible() {
return accessible;
}
public void setAccessible(boolean accessible) {
this.accessible = accessible;
}
public void printInfo(){
System.out.println("Building:" + name + "," + type + ","+ code + "," + number + " at " + x +"," + y + "," + accessible);
}
}