public void StartGame_WithInInvalidCommand_ShouldNotThrow()
        {
            this.mockReader = new MockIReader("invalid").GetSpecialReader("invalid");
            var engine = new GameEngine(this.gameLogic, this.mockPrinter, this.mockReader, this.db, this.topScoreController, this.gamesController);

            engine.StartGame();
        }
        public void StartGame_WithFinishInput_ShouldEndGame()
        {
            this.mockReader = new MockIReader("finish").MockReader.Object;
            var engine = new GameEngine(this.gameLogic, this.mockPrinter, this.mockReader, this.db, this.topScoreController, this.gamesController);

            engine.StartGame();
        }
Ejemplo n.º 3
0
        public static void Main()
        {
            var renderer = new ConsoleRenderer();
            var inputReader = new ConsoleInputReader();

            var engine = new GameEngine(renderer, inputReader);
            engine.Run();
        }
 public static void Main()
 {
     ICommandManager commandManager = new CommandManager();
     IUserInterface userInterface = new ConsoleInterface();
     IRequester requester = new Requester();
    
     var engine = new GameEngine(userInterface, commandManager, requester);
     engine.Run();
 }
        /// <summary>
        ///     The main.
        /// </summary>
        private static void Main()
        {
            Galaxy galaxy = new Galaxy();
            SeedStarSystems(galaxy);

            ICommandManager commandManager = new ExtendedCommandManager();
            IGameEngine engine = new GameEngine(commandManager, galaxy);
            engine.Run();
        }
Ejemplo n.º 6
0
        public static void Main()
        {
            IInputReader reader = new ConsoleReader();
            IOutputWriter writer = new ConsoleWriter();
            IGameData data = new GameData();
            IBlobFactory blobFactory = new BlobFactory();

            IRunnable engine = new GameEngine(reader, writer, data, blobFactory);
            engine.Run();
        }
Ejemplo n.º 7
0
 public static void Main()
 {
     Galaxy galaxy = new Galaxy();
     SeedStarSystems(galaxy);
     
     // ICommandManager commandManager = new CommandManager();
     ICommandManager commandManager = new CommandManagerExtension();
     IGameEngine engine = new GameEngine(commandManager, galaxy);
     engine.Run();
 }
Ejemplo n.º 8
0
        public static void Main()
        {
            IRenderer renderer = new ConsoleRenderer();
            IInputHandler inputHandler = new ConsoleInputHandler();
            IPlayer player = new Player();
            SeedInitialPlayerInventory(player);

            IGameEngine engine = new GameEngine(renderer, inputHandler, player);

            engine.Run();
        }
Ejemplo n.º 9
0
 public Tile(int row, int column, GameEngine engine)
 {
     this.row = row;
     this.column = column;
     this.engine = engine;
     engine.AddTile(this);
     this.MouseUp += HandleMouseUp;
     //Button specific
     TabIndex = 1 + column + engine.Columns * row;
     Size = size;
     Location = new System.Drawing.Point(startPos.X + (size.Width + margin) * column, startPos.Y + (size.Height + margin) * row);
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Entry point for the Balloons Pop-2 game.
        /// </summary>
        private static void Main()
        {
            const int BoardSize = 10;

            var engineDependencies = new GameEngineDependencies(
                new ConsoleUserInterface(),
                new Logger(),
                new Board(BoardSize, BoardSize, new RandomGenerator()),
                new BoardMemory(),
                new CommandFactory());

            var engine = new GameEngine(engineDependencies);

            engine.Run();
        }
Ejemplo n.º 11
0
        public Board()
        {
            var engine = new GameEngine(4, 4, 1);
            engine.UserMessage += HandleUserMessage;

            SuspendLayout();

            for (var row = 0; row < engine.Rows; row++) {
                for (var column = 0; column < engine.Columns; column++) {
                    var tile = new Tile(column, row, engine);
                    Controls.Add (tile);
                }
            }
            //			AutoScaleDimensions = new System.Drawing.SizeF (6F, 13F);
            //			AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            ClientSize = new System.Drawing.Size (184, 262);
            Text = "Minesweeper";
            ResumeLayout (false);
            engine.Init();
        }
        public void StartGame_WithInValidCoordinates_ShouldNotPopBalloon()
        {
            this.mockReader = new MockIReader("-1 8").GetSpecialReader("-1 8");
            var engine = new GameEngine(this.gameLogic, this.mockPrinter, this.mockReader, this.db, this.topScoreController, this.gamesController);
            var balloonsBefore = engine.GameLogic.Game.RemainingBalloons;

            engine.StartGame();

            var balloonsAfter = engine.GameLogic.Game.RemainingBalloons;

            Assert.AreEqual(balloonsBefore, balloonsAfter);
        }
        public void StartGame_WithSaveInput_ShouldSaveGame()
        {
            this.mockReader = new MockIReader("save").GetSpecialReader("save");
            var engine = new GameEngine(this.gameLogic, this.mockPrinter, this.mockReader, this.db, this.topScoreController, this.gamesController);

            engine.StartGame();

            Assert.IsNotNull(engine.GamesController.SearchById("save"));
        }