diff -r 3ceb637cf53d -r 59fca1d3cb55 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 Sat Jul 14 23:27:11 2012 +0400 @@ -0,0 +1,40 @@ +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 enum CellContent implements TextRepresentable { + + ClosedLambdaLift("L"), + Earth("."), + Empty(" "), + Lambda("\\"), + MiningRobot("R"), + OpenLambdaLift("O"), + Rock("*"), + Wall("#"); + + private String text; + + private CellContent(String text) { + this.text = text; + } + + @Override + public String toText() { + return text; + } + + public static CellContent fromText(String text) { + for (CellContent content : values()) { + if (text != null && text.equals(content.toText())) + return content; + } + return null; + } + +}