2015-11-15 06:53:54 +00:00
|
|
|
package uk.org.mafoo.wordbubbles;
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
2015-11-21 19:24:24 +00:00
|
|
|
public class Cell {
|
2015-11-15 06:53:54 +00:00
|
|
|
|
|
|
|
protected final char inmate;
|
2015-11-21 19:24:24 +00:00
|
|
|
protected int x = -1;
|
|
|
|
protected int y = -1;
|
2015-11-15 06:53:54 +00:00
|
|
|
protected Cell (final char c, final int in_x, final int in_y) {
|
|
|
|
if(c >= 'a' && c <= 'z') {
|
|
|
|
inmate = c;
|
|
|
|
x = in_x;
|
|
|
|
y = in_y;
|
2015-11-21 19:24:24 +00:00
|
|
|
} else throw new RuntimeException("Unable to create a cell with no inmate");
|
2015-11-15 06:53:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
|
|
|
return "" + inmate;
|
|
|
|
}
|
|
|
|
|
2015-11-21 19:24:24 +00:00
|
|
|
public String toStringVerbose() {
|
|
|
|
return "" + inmate + "@" + x + "," + y;
|
|
|
|
}
|
2015-11-15 06:53:54 +00:00
|
|
|
}
|