private void Handle(CellTouchEvent cellEvent) { if (cellEvent.Step == Steps.player) { _playerScoreCount += cellEvent.Number; _playerScore.text = _playerScoreCount.ToString(); NextStep(cellEvent); } else { _aiScoreCount += cellEvent.Number; _aiScore.text = _aiScoreCount.ToString(); } }
private void NextStep(CellTouchEvent cellEvent) { var choisedCell = Observable.Start( () => { var choise = logic.ChoiceCell( cellEvent.Step, cellEvent.X, 10, cellEvent.cellParamList, _playerScoreCount, _aiScoreCount); return choise; }); Observable.WhenAll(choisedCell).ObserveOnMainThread().Subscribe(result => _cellLogic.ChoiceCell(Steps.ai, result[0])); }