-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDragon.java
More file actions
executable file
·94 lines (82 loc) · 2.25 KB
/
Copy pathDragon.java
File metadata and controls
executable file
·94 lines (82 loc) · 2.25 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import java.util.List;
import java.util.ArrayList;
/**
* This is the coding for the JavaZoo's new dragon. Period 1
*
* @author Jaehyung Choi
* @version 2015-03-19
*/
public class Dragon extends Animal implements Flyable, Swimmable
{
private String appearance;
private List<String> treasures;
/**
* Constructor for objects of class Bear
*/
public Dragon(String name, String desc)
{
super(desc, name);
treasures = new ArrayList<String>();
treasures.add("Golden crown of the King of the Nile");
treasures.add("Tibetan singing bowl of Grandmaster Shorr");
treasures.add("Wand stolen from Voldemort himself");
treasures.add("Macbook of the all powerful Master Ooda");
treasures.add("Silver banana of the HubbyWubby");
treasures.add("Cup of swag from the Essence of the World");
treasures.add("Rug woven from Mr. Shorr's beard");
}
public String roar()
{
return "RAAAAAAAAAAWR";
}
public String breathe()
{
return "The dragon just burnt a visitor to crisp.";
}
public String prophesize()
{
return "The dragon speaks a wise and mysterious prophecy.";
}
@Override
public String sleep()
{
return "zzzzzzzzz";
}
@Override
public String play()
{
String playing = "";
for(String rich : treasures)
{
playing += "The dragon admires his "+ rich +".\n";
}
return playing;
}
@Override
public String eat()
{
return "The dragon devours its mid-lunch snack: a full grown elephant.";
}
@Override
public String move()
{
return fly();
}
public String fly()
{
return "The dragon flies up and breaks through the bars, causing havoc and mayhem in the city.";
}
@Override
public String makeNoise()
{
return roar();
}
public String roam()
{
return "The dragon breaks out of the zoo and roams the countryside, terrorizing the villagers.";
}
public String swim()
{
return "The dragon swims in the river, enjoying himself as he basks in the warm flow of sunlight.";
}
}