|
|
@@ -15,17 +15,30 @@ LetterCell.prototype.constructor = LetterCell;
|
|
|
|
|
|
var debugFound = {};
|
|
|
|
|
|
-function DefinitionCell(x, y, letter, definitionArray, currentDefinition) {
|
|
|
- if (debugFound[letter]) debugFound[letter].push({x:x,y:y}); else debugFound[letter] = [{x:x,y:y}];
|
|
|
+function Definition(position, alignment, text) {
|
|
|
+}
|
|
|
+
|
|
|
+Definition.POSITION_TOP = {};
|
|
|
+Definition.POSITION_BOTTOM = {};
|
|
|
+Definition.POSITION_RIGHT = {};
|
|
|
+Definition.POSITION_LEFT = {};
|
|
|
+
|
|
|
+Definition.ALIGNMENT_HORIZONTAL = {};
|
|
|
+Definition.ALIGNMENT_VERTICAL = {};
|
|
|
+
|
|
|
+function DefinitionCell(x, y, code, definitionArray, currentDefinition) {
|
|
|
+ if (debugFound[code]) debugFound[code].push({x:x,y:y}); else debugFound[code] = [{x:x,y:y}];
|
|
|
GridCell.call(this, x, y);
|
|
|
this.definitions = [];
|
|
|
+ if ()
|
|
|
}
|
|
|
DefinitionCell.prototype = Object.create(GridCell);
|
|
|
DefinitionCell.prototype.constructor = DefinitionCell;
|
|
|
|
|
|
function parseGrid(grid, definitions, w, h) {
|
|
|
var currentDefinition = 0
|
|
|
- ,resultGrid = [];
|
|
|
+ ,resultGrid = []
|
|
|
+ ,firstCharCode = 'a'.charCodeAt(0);
|
|
|
|
|
|
for (var i =0; i < h; i++) {
|
|
|
for (var j =0; j < w; j++) {
|
|
|
@@ -33,7 +46,7 @@ function parseGrid(grid, definitions, w, h) {
|
|
|
if (c == c.toUpperCase()) {
|
|
|
resultGrid.push(new LetterCell(i, j, c));
|
|
|
} else {
|
|
|
- var cell = new DefinitionCell(i, j, c, definitions, currentDefinition);
|
|
|
+ var cell = new DefinitionCell(i, j, c.charCodeAt(0) -firstCharCode, definitions, currentDefinition);
|
|
|
currentDefinition += cell.definitions.length;
|
|
|
resultGrid.push(cell);
|
|
|
}
|