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