-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTwilight.java
More file actions
43 lines (43 loc) · 1.4 KB
/
Copy pathTwilight.java
File metadata and controls
43 lines (43 loc) · 1.4 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
package lab4;
class Twilight extends Entity {
private DescriptionOfTwilight clearness;
private DescriptionOfTwilight blueness;
private DescriptionOfTwilight transparency;
private boolean isSpecial;
private boolean isStartTwilight = false;
public Twilight(Area type, String name){
super("сумерки на территории " + type.getArea() + " " + name);
if ((name == "Стокгольм") && (type == Area.CITY)) {
clearness = DescriptionOfTwilight.SPECIALCLEAR;
blueness = DescriptionOfTwilight.SPECIALBLUE;
transparency = DescriptionOfTwilight.SPECIALTRANSPARENT;
isSpecial = true;
} else {
clearness = DescriptionOfTwilight.CLEAR;
blueness = DescriptionOfTwilight.BLUE;
transparency = DescriptionOfTwilight.TRANSPARENT;
isSpecial = false;
}
}
public void startTwilight() {
isStartTwilight = true;
}
public boolean getStartTwilight() {
return isStartTwilight;
}
public boolean getIsSpecial() {
return isSpecial;
}
public String showTwilight() {
String s;
if (isStartTwilight) {
s = "сумерки обладают следующими характеристиками: " + clearness.getTwilight() + ", " + blueness.getTwilight() + ", " + transparency.getTwilight();
} else {
s = "сумерки пока не наступили";
}
return s;
}
public String getInformation() {
return getName();
}
}