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