-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSea.java
More file actions
54 lines (46 loc) · 1.44 KB
/
Sea.java
File metadata and controls
54 lines (46 loc) · 1.44 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
45
46
47
48
49
50
51
52
53
54
import java.util.Arrays;
import java.util.Objects;
public class Sea {
boolean waves=false;
Time[] times = Time.values();
Time time = times[(int) (Math.random() * 4)];
void ReflectLighting(boolean StatusOfLighting){
if(StatusOfLighting == true){
StormCloud.StatusOfLighting=false;
System.out.println(" " + time + " море озарялось ");
}
}
void reflectSunRays(boolean StatusOfRays){
if(StatusOfRays==true){
SunnyWeather.StatusOfRays=false;
System.out.println(" " + time + " море отражало ");
}
}
void playWaves(){
waves=true;
System.out.println(" Море "+time+" играло волнами.");
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Sea sea = (Sea) o;
return waves == sea.waves &&
Arrays.equals(times, sea.times) &&
time == sea.time;
}
@Override
public int hashCode() {
int result = Objects.hash(waves, time);
result = 31 * result + Arrays.hashCode(times);
return result;
}
@Override
public String toString() {
return "Sea{" +
"waves=" + waves +
", times=" + Arrays.toString(times) +
", time=" + time +
'}';
}
}