-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHuman.java
More file actions
66 lines (64 loc) · 1.76 KB
/
Human.java
File metadata and controls
66 lines (64 loc) · 1.76 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
55
56
57
58
59
60
61
62
63
64
65
66
public class Human extends aCreature{
enum Gender {
Male,
Female;
}
enum BootsTypeOn {
None,
Sneakers,
Sandals;
}
enum StandsOn {
Parket,
WoodenFloor,
Asphalt,
Concrete;
}
Gender gender;
BootsTypeOn boots;
StandsOn standOn;
Human (String name, Gender gender, boolean flyingType, BootsTypeOn boots, StandsOn floor){
this.name = name;
this.gender = gender;
this.flyingType = flyingType;
this.boots = boots;
standOn = floor;
}
Human (String name, Gender gender, boolean flyingType, BootsTypeOn boots){
this.name = name;
this.gender = gender;
this.flyingType = flyingType;
this.boots = boots;
}
Human (String name, Gender gender, boolean type){
this.name = name;
this.gender = gender;
this.flyingType = type;
}
Human (String name, boolean type){
this.name = name;
this.gender = gender;
this.flyingType = type;
}
private int countNotGiveUp = 0;
public int getCountNotGiveUp() {
return countNotGiveUp;
}
public void setCountNotGiveUp(int countNotGiveUp) {
this.countNotGiveUp = countNotGiveUp;
}
public void getShoes(){
if (this.boots == BootsTypeOn.None)
System.out.println(name + " стоит босиком на " + standOn);
}
static public class GetGender {
public static Gender get(Human b) throws NoGenderException{
if (b.gender == null){
throw new NoGenderException();
}
else {
return b.gender;
}
}
}
}