| author | indvdum (gotoindvdum[at]gmail[dot]com) |
| Sun, 15 Jul 2012 04:09:14 +0400 | |
| changeset 22 | a46d0179df7a |
| parent 6 | 0dbbc8983926 |
| child 27 | 505c25412b16 |
| permissions | -rw-r--r-- |
1 package ru.bosony.model.cellscontents;
3 import ru.bosony.model.io.TextRepresentable;
5 /**
6 * @author indvdum (gotoindvdum[at]gmail[dot]com) <br>
7 * 13.07.2012 21:25:49
8 *
9 */
10 public enum CellContent implements TextRepresentable {
12 ClosedLambdaLift("L"),
13 Earth("."),
14 Empty(" "),
15 Lambda("\\"),
16 MiningRobot("R"),
17 OpenLambdaLift("O"),
18 Rock("*"),
19 Wall("#");
21 private String text;
23 private CellContent(String text) {
24 this.text = text;
25 }
27 @Override
28 public String toText() {
29 return text;
30 }
32 public static CellContent fromText(String text) {
33 for (CellContent content : values()) {
34 if (text != null && text.equals(content.toText()))
35 return content;
36 }
37 return null;
38 }
40 }