void FillObjectCells(GameObject obj, int startRow, int startColumn) { for (int i = 0; i < obj.Height; i++) { for (int j = 0; j < obj.Width; j++) { if (!obj.Bitmap[i, j]) continue; cells[i + startRow][j + startColumn] = new GameCell(obj); } } }
GameWord CheckLetterStopCell(GameCellPos letterPos, GameCell cell, out GameErrorInfo gameError) { GameWord word = cell.GameObject as GameWord; gameError = null; if (word != null) { GameCellPos wordPos; if (mainTable.TryGetObjectPosition(word, out wordPos) && ((wordPos.Column == letterPos.Column) || (wordPos.Column + word.Width > letterPos.Column))) { int wordRelColumn = letterPos.Column - wordPos.Column; if (wordRelColumn >= 0 && wordRelColumn < word.Width){ if (string.Equals(word.StringMap[0, wordRelColumn], currentLetter.StringMap[0, 0], StringComparison.InvariantCultureIgnoreCase)) { return word; } else { gameError = new GameErrorInfo(word.RulesMap[0, wordRelColumn], currentLetter.StringMap[0, 0], word.Word); } } } } return null; }
public GameTable(int width, int height) { this.width = width; this.height = height; cells = new GameCell[height][]; for (int i = 0; i < height; i++) cells[i] = new GameCell[width]; }