Пример #1
0
        public void Play(string firstCoordinates, string lastCoordinates)
        {
            _commentator.Greet();
            _playerName = _commentator.GetPlayerName(_playerName);
            _commentator.TellAStory(_playerName);

            var board = _boardGenerator.Generate();

            while (true)
            {
                var shotCoordinates = GetShotCoordinates(firstCoordinates, lastCoordinates);

                var shipShotResult = board.ReceiveShot(shotCoordinates);

                _commentator.PrintResult(shipShotResult, shotCoordinates, _playerName);

                if (shipShotResult.Result == ShotResult.Won)
                {
                    break;
                }
            }
        }