Esempio n. 1
0
 public LetterDieEventArgs(GameLetter letter, GameCellPos letterPosition)
 {
     this.letter = letter;
         this.letterPosition = letterPosition;
 }
Esempio n. 2
0
 public WordAndLetterDieEventArgs(GameWord word, GameLetter letter, GameCellPos wordPosition)
 {
     this.word = word;
         this.letter = letter;
         this.wordPosition = wordPosition;
 }
Esempio n. 3
0
 protected virtual bool StartWordAndLetterDieAnimation(GameWord word, GameLetter letter, GameCellPos wordPosition)
 {
     if (OnStartWordAndLetterDieAnimation == null) return false;
     return OnStartWordAndLetterDieAnimation(this, new WordAndLetterDieEventArgs(word, letter, wordPosition));
 }
Esempio n. 4
0
 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;
 }
Esempio n. 5
0
 public void Offset(GameCellPos dPos)
 {
     Row += dPos.Row;
     Column += dPos.Column;
 }
Esempio n. 6
0
 protected virtual bool StartLetterDieAnimation(GameLetter letter, GameCellPos letterPosition)
 {
     if(OnStartLetterDieAnimation == null) return false;
     return OnStartLetterDieAnimation(this, new LetterDieEventArgs(letter, letterPosition));
 }
Esempio n. 7
0
 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;
 }
Esempio n. 8
0
 public bool TryGetObjectPosition(GameObject obj, out GameCellPos position)
 {
     return objectDict.TryGetValue(obj, out position);
 }
Esempio n. 9
0
 public GameCell this[GameCellPos position]
 {
     get { return cells[position.Row][position.Column]; }
 }
Esempio n. 10
0
 public DrawCellInfo(GameCellPos cellPos, GameCellPos objectPos, GameObject obj)
     : this(cellPos)
 {
     this.objectPos = objectPos;
     this.obj = obj;
 }
Esempio n. 11
0
 public DrawCellInfo(GameCellPos cellPos)
 {
     this.cellPos = cellPos;
 }