[refactor] Update Action enum in mediator pattern.

This commit is contained in:
ruslanpa 2015-02-09 21:59:12 +02:00
parent c23f58e86f
commit 5b81a88d84

View File

@ -7,20 +7,15 @@ package com.iluwatar;
*/
public enum Action {
HUNT, TALE, GOLD, ENEMY;
HUNT("hunted a rabbit"), TALE("tells a tale"), GOLD("found gold"), ENEMY("spotted enemies"), NONE("");
public String toString() {
private String title;
switch (this) {
case ENEMY:
return "spotted enemies";
case GOLD:
return "found gold";
case HUNT:
return "hunted a rabbit";
case TALE:
return "tells a tale";
}
return "";
Action(String title) {
this.title = title;
}
public String toString() {
return title;
}
}