[refactor] Update Action enum in mediator pattern.
This commit is contained in:
parent
c23f58e86f
commit
5b81a88d84
@ -7,20 +7,15 @@ package com.iluwatar;
|
|||||||
*/
|
*/
|
||||||
public enum Action {
|
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) {
|
Action(String title) {
|
||||||
case ENEMY:
|
this.title = title;
|
||||||
return "spotted enemies";
|
}
|
||||||
case GOLD:
|
|
||||||
return "found gold";
|
public String toString() {
|
||||||
case HUNT:
|
return title;
|
||||||
return "hunted a rabbit";
|
|
||||||
case TALE:
|
|
||||||
return "tells a tale";
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user