Ejemplo n.º 1
0
        public GameEngine(IGameController gameController, IGameboardGenerator fieldGenerator, IDetonationPatternFactory detonationFactory)
        {
            this.gameController = gameController;
            int size = this.gameController.GetPlaygroundSizeFromUser();

            double minesPercentage = this.DetermineMinesPercentage();
            this.board = fieldGenerator.Generate(size, minesPercentage);
            this.board.SetDetonationFactory(detonationFactory);

            this.blownMines = 0;
        }
Ejemplo n.º 2
0
        public GameEngine(IGameController gameController, IGameboardGenerator fieldGenerator, IDetonationPatternFactory detonationFactory)
        {
            this.gameController = gameController;
            int size = this.gameController.GetPlaygroundSizeFromUser();

            double minesPercentage = this.DetermineMinesPercentage();

            this.board = fieldGenerator.Generate(size, minesPercentage);
            this.board.SetDetonationFactory(detonationFactory);

            this.blownMines = 0;
        }