| author | indvdum (gotoindvdum[at]gmail[dot]com) |
| Fri, 13 Jul 2012 21:55:14 +0400 | |
| branch | indvdum |
| changeset 5 | 162341642dd7 |
| child 6 | 0dbbc8983926 |
| permissions | -rw-r--r-- |
| indvdum@5 | 1 |
package ru.bosony.model.cellscontents; |
| indvdum@5 | 2 |
|
| indvdum@5 | 3 |
import ru.bosony.model.io.TextRepresentable; |
| indvdum@5 | 4 |
|
| indvdum@5 | 5 |
/** |
| indvdum@5 | 6 |
* @author indvdum (gotoindvdum[at]gmail[dot]com) <br> |
| indvdum@5 | 7 |
* 13.07.2012 21:25:49 |
| indvdum@5 | 8 |
* |
| indvdum@5 | 9 |
*/ |
| indvdum@5 | 10 |
public abstract class CellContent implements TextRepresentable {
|
| indvdum@5 | 11 |
|
| indvdum@5 | 12 |
@Override |
| indvdum@5 | 13 |
public CellContent fromText(String text) {
|
| indvdum@5 | 14 |
for (CellContent content : new CellContent[] {
|
| indvdum@5 | 15 |
new ClosedLambdaLift(), |
| indvdum@5 | 16 |
new Earth(), |
| indvdum@5 | 17 |
new Empty(), |
| indvdum@5 | 18 |
new Lambda(), |
| indvdum@5 | 19 |
new MiningRobot(), |
| indvdum@5 | 20 |
new OpenLambdaLift(), |
| indvdum@5 | 21 |
new Rock(), |
| indvdum@5 | 22 |
new Wall() |
| indvdum@5 | 23 |
}) {
|
| indvdum@5 | 24 |
if (text != null && text.equals(content.toText())) |
| indvdum@5 | 25 |
return content; |
| indvdum@5 | 26 |
} |
| indvdum@5 | 27 |
return null; |
| indvdum@5 | 28 |
} |
| indvdum@5 | 29 |
|
| indvdum@5 | 30 |
} |