static GameEngine Initialize()
 {
     Field playerField = new PlayerField(MaxRow, MaxCol);
     Field enemyField = new EnemyField(MaxRow, MaxCol);
     List<Ship> playerShips = new List<Ship>();
     List<Ship> computerShips = new List<Ship>();
     IUserInterface keyboard = new KeyboardInterface();
     IRenderer renderer = new ConsoleRenderer();
     ShipGenerator.Generate(5, playerShips, MaxRow, MaxCol);
     ShipGenerator.Generate(5, computerShips, MaxRow, MaxCol);
     GameEngine engine = new GameEngine(playerField, playerShips, enemyField, computerShips, keyboard, renderer,MinRow,MaxRow,MinCol,MaxCol);
     return engine;
 }
예제 #2
0
        static GameEngine Initialize()
        {
            Field          playerField   = new PlayerField(MaxRow, MaxCol);
            Field          enemyField    = new EnemyField(MaxRow, MaxCol);
            List <Ship>    playerShips   = new List <Ship>();
            List <Ship>    computerShips = new List <Ship>();
            IUserInterface keyboard      = new KeyboardInterface();
            IRenderer      renderer      = new ConsoleRenderer();

            ShipGenerator.Generate(5, playerShips, MaxRow, MaxCol);
            ShipGenerator.Generate(5, computerShips, MaxRow, MaxCol);
            GameEngine engine = new GameEngine(playerField, playerShips, enemyField, computerShips, keyboard, renderer, MinRow, MaxRow, MinCol, MaxCol);

            return(engine);
        }