| author | indvdum (gotoindvdum[at]gmail[dot]com) |
| Mon, 16 Jul 2012 00:05:50 +0400 | |
| changeset 29 | 66aa96e8fd92 |
| parent 7 | 251961e44b5f |
| child 47 | b3d48e364f9e |
| 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 RIGHT("R"),
14 UP("U"),
15 DOWN("D"),
16 WAIT("W"),
17 ABORT("A"),
18 RAZOR("S");
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 }