| author | indvdum (gotoindvdum[at]gmail[dot]com) |
| Mon, 16 Jul 2012 18:58:08 +0400 | |
| branch | CleverSearch |
| changeset 47 | b3d48e364f9e |
| parent 29 | 66aa96e8fd92 |
| child 50 | 9530f55e9639 |
| permissions | -rw-r--r-- |
1 package ru.bosony.model.moving;
3 import ru.bosony.model.io.TextRepresentable;
5 /**
6 * @author indvdum (gotoindvdum[at]gmail[dot]com) <br>
7 * 14.07.2012 0:40:35
8 *
9 */
10 public enum Movement implements TextRepresentable {
12 LEFT("L"),
13 UP("U"),
14 RIGHT("R"),
15 DOWN("D"),
16 WAIT("W"),
17 RAZOR("S"),
18 ABORT("A");
20 private String text;
22 private Movement(String text) {
23 this.text = text;
24 }
26 @Override
27 public String toText() {
28 return text;
29 }
31 public static Movement fromText(String text) {
32 for (Movement content : values()) {
33 if (text != null && text.equals(content.toText()))
34 return content;
35 }
36 return null;
37 }
39 }