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); } }
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); } }
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); } } }
virtual public void OnGemOperation(int row, int column, GemOperation operation) { //Implemented in child class }