Improves a toString method.
Makes it more readable and deletes an useless semicolon.
This commit is contained in:
parent
a4637fcf99
commit
bc060309e3
@ -6,23 +6,16 @@ public enum Action {
|
|||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|
||||||
String s = "";
|
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case ENEMY:
|
case ENEMY:
|
||||||
s = "spotted enemies";
|
return "spotted enemies";
|
||||||
break;
|
|
||||||
case GOLD:
|
case GOLD:
|
||||||
s = "found gold";
|
return "found gold";
|
||||||
break;
|
|
||||||
case HUNT:
|
case HUNT:
|
||||||
s = "hunted a rabbit";
|
return "hunted a rabbit";
|
||||||
break;
|
|
||||||
case TALE:
|
case TALE:
|
||||||
s = "tells a tale";
|
return "tells a tale";
|
||||||
break;
|
}
|
||||||
default:
|
return "";
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return s;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user