示例#1
0
    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();
        }
    }
示例#2
0
 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]));
 }