public LetterDieEventArgs(GameLetter letter, GameCellPos letterPosition) { this.letter = letter; this.letterPosition = letterPosition; }
public WordAndLetterDieEventArgs(GameWord word, GameLetter letter, GameCellPos wordPosition) { this.word = word; this.letter = letter; this.wordPosition = wordPosition; }
protected virtual bool StartWordAndLetterDieAnimation(GameWord word, GameLetter letter, GameCellPos wordPosition) { if (OnStartWordAndLetterDieAnimation == null) return false; return OnStartWordAndLetterDieAnimation(this, new WordAndLetterDieEventArgs(word, letter, wordPosition)); }
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 void Offset(GameCellPos dPos) { Row += dPos.Row; Column += dPos.Column; }
protected virtual bool StartLetterDieAnimation(GameLetter letter, GameCellPos letterPosition) { if(OnStartLetterDieAnimation == null) return false; return OnStartLetterDieAnimation(this, new LetterDieEventArgs(letter, letterPosition)); }
public CanMoveResult TryMoveObjectHere(GameObject obj, int startRow, int startColumn) { CanMoveResult result = CanMoveObjectHere(obj, startRow, startColumn); if (result != CanMoveResult.Success) return result; RemoveObject(obj); FillObjectCells(obj, startRow, startColumn); objectDict[obj] = new GameCellPos(startRow, startColumn); return CanMoveResult.Success; }
public bool TryGetObjectPosition(GameObject obj, out GameCellPos position) { return objectDict.TryGetValue(obj, out position); }
public GameCell this[GameCellPos position] { get { return cells[position.Row][position.Column]; } }
public DrawCellInfo(GameCellPos cellPos, GameCellPos objectPos, GameObject obj) : this(cellPos) { this.objectPos = objectPos; this.obj = obj; }
public DrawCellInfo(GameCellPos cellPos) { this.cellPos = cellPos; }