-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSky.java
More file actions
44 lines (44 loc) · 1.06 KB
/
Copy pathSky.java
File metadata and controls
44 lines (44 loc) · 1.06 KB
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
package lab4;
class Sky extends Entity {
private Glowing glowing;
private boolean isGlow = false;
private boolean isChangeColor = false;
public Sky(Area type, String name){
super("небо над территорией " + type.getArea() + " " + name);
if ((name == "Стокгольм") && (type == Area.CITY)) {
glowing = Glowing.SPECIAL;
} else {
glowing = Glowing.ORDINARY;
}
}
public void glow() {
isGlow = true;
}
public boolean getGlow() {
return isGlow;
}
public String showGlow() {
String s;
if (isGlow) {
s = "небо светится " + glowing.getGlowing() + " светом";
} else {
s = "небо не светится " + glowing.getGlowing() + " светом";
}
return s;
}
public void changeColor() {
isChangeColor = true;
}
public String showChangeColor() {
String s;
if (isChangeColor) {
s = "небо меняет цвет";
} else {
s = "небо не меняет цвет";
}
return s;
}
public String getInformation() {
return getName();
}
}