Example #1
0
        /// <summary>
        /// Обрабатывет результат выстрела
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ResultFire(object sender, ResponseEventArgs e)
        {
            ShotResponse response = e.Response as ShotResponse;

            if (response != null)
            {
                Shot shot = response.CurrentShot;
                if (shot != null)
                {
                    if (response.IsSuccess && _isMyTurn)
                    {
                        _seaOpponent.SetShot(shot, response.KilledShipInfo);
                        TransferTurn(response.NextShotUserId);
                    }
                    else
                    {
                        _seaPlayer.SetShot(shot, response.KilledShipInfo);
                        TransferTurn(response.NextShotUserId);
                    }
                }
            }
        }