Пример #1
0
 public override void OnGemOperation(int row, int column, GemOperation operation)
 {
     base.OnGemOperation(row, column, operation);
     if (operation == GemOperation.TouchDown /* || operation == GemOperation.TouchEnter*/)
     {
         // check if the two selected gem is adjacent
         var  selectedGemControler = _controller._currentGemControllerMatrix[row, column];
         bool isAdjacent           = GemController.IsAdjacent(_controller._firstSelectedGemControler, selectedGemControler);
         if (isAdjacent)
         {
             _controller._secondSelectedGemControler = selectedGemControler;
             _controller.ChangeToState(GameBoardState.SecondSelection);
         }
         else
         {
             _controller._firstSelectedGemControler.SetIsSelected(false);
             _controller._firstSelectedGemControler = selectedGemControler;
             _controller._firstSelectedGemControler.SetIsSelected(true);
         }
     }
 }