Ejemplo n.º 1
0
 public void OnGemOperation(int row, int column, GemOperation operation)
 {
     //Debug.Log(string.Format("Gem:{0},{1} is {2}.", row, column, operation.ToString()));
     if (_states[_currentGameBoardState] != null)
     {
         _states[_currentGameBoardState].OnGemOperation(row, column, operation);
     }
 }
Ejemplo n.º 2
0
 public override void OnGemOperation(int row, int column, GemOperation operation)
 {
     base.OnGemOperation(row, column, operation);
     if (operation == GemOperation.TouchDown)
     {
         _controller._firstSelectedGemControler = _controller._currentGemControllerMatrix[row, column];
         _controller.ChangeToState(GameBoardState.FirstSelection);
     }
 }
Ejemplo n.º 3
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);
         }
     }
 }
Ejemplo n.º 4
0
 virtual public void OnGemOperation(int row, int column, GemOperation operation)
 {
     //Implemented in child class
 }