public static void GameStartView(Player player, Player computer, Battlefield battlefield) { // Display Graphic DisplayBattleView(player, computer, battlefield); // information area Console.WriteLine(" ready to START"); Console.Write(" Press Enter to continue >"); Console.ReadKey(); SoundEffects.SetShipSoundPlayer(); }
public void PlacePlayerShips(List <Ship> playerShips, IPositionParser positionParser, IPositionValidator positionValidator, IShipManager shipManager, Battlefield battlefield) { foreach (var ship in playerShips) { Console.Clear(); Console.WriteLine(); //display battle field Console.WriteLine(GraphicManager.DisplayBattlefield(battlefield.ColumnSize, battlefield.RowSize, playerShips)); //display place table Console.WriteLine(GraphicManager.DisplayPlaceTable(playerShips, ship.ShipType)); //get the StartPosition Position position; do { Console.Write(" Enter position for {0} > ", ship.ShipType); position = positionParser.Parse(Console.ReadLine()); } while (position == null); //get the direction Direction direction; do { direction = GetDirection(); } while (direction == Direction.None); //get whole ship positions var shipPositions = shipManager.WholeShipPositions(position, ship.Size, direction); //validate player position shipPositions = ValidatePlayerPositions(playerShips, positionParser, positionValidator, shipManager, shipPositions, ship, battlefield); ship.Positions.AddRange(shipPositions); SoundEffects.SetShipSoundPlayer(); } }