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() { | 	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: |  | ||||||
| 			break; |  | ||||||
| 		} | 		} | ||||||
| 		return s; | 		return ""; | ||||||
| 	}; | 	} | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user