diff -r 156014e240fd -r 162341642dd7 icfp-model/src/main/java/ru/bosony/model/cellscontents/CellContent.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/icfp-model/src/main/java/ru/bosony/model/cellscontents/CellContent.java Fri Jul 13 21:55:14 2012 +0400 @@ -0,0 +1,30 @@ +package ru.bosony.model.cellscontents; + +import ru.bosony.model.io.TextRepresentable; + +/** + * @author indvdum (gotoindvdum[at]gmail[dot]com)
+ * 13.07.2012 21:25:49 + * + */ +public abstract class CellContent implements TextRepresentable { + + @Override + public CellContent fromText(String text) { + for (CellContent content : new CellContent[] { + new ClosedLambdaLift(), + new Earth(), + new Empty(), + new Lambda(), + new MiningRobot(), + new OpenLambdaLift(), + new Rock(), + new Wall() + }) { + if (text != null && text.equals(content.toText())) + return content; + } + return null; + } + +}