-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReflection.java
More file actions
30 lines (29 loc) · 982 Bytes
/
Copy pathReflection.java
File metadata and controls
30 lines (29 loc) · 982 Bytes
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
package lab4;
class Reflection extends Entity {
private String object;
private String reflectingObject;
private Boolean isSpecial;
public Reflection(String object, WaterObject reflectingObject, Twilight twilight){
super("Oтражение объекта " + object + " в объекте " + reflectingObject.getInformation());
if (twilight.getStartTwilight()) {
isSpecial = twilight.getIsSpecial();
} else {
isSpecial = false;
}
}
public boolean getIsSpecial() {
return isSpecial;
}
public void showReflection() {
String s;
if (isSpecial) {
s = getInformation() + " обладает характеристикой: " + DescriptionOfReflection.SPECIAL.getDescription() + ".";
} else {
s = getInformation() + " обладает характеристикой: " + DescriptionOfReflection.ORDINARY.getDescription() + ".";
}
System.out.println(s);
}
public String getInformation() {
return getName();
}
}