Ejemplo n.º 1
0
        public Game(int inputedWidth, int inputedHeight, int inputedPause)
        {
            height = inputedHeight;
            width  = inputedWidth;
            pause  = inputedPause;

            gameCursor         = new Cursor(width, height);
            gameField          = new Field(height, width);
            gamePrintableField = new PrintableFieldWithCursor(gameField, gameCursor);
            gameIterations     = new GameIteration(gameField);
            isGameHasToStart   = new IsGameHasToStart();
            commands           = new CommandCollection(gameField, gameCursor, isGameHasToStart);
        }
Ejemplo n.º 2
0
 public CommandCollection(Field inputedField, Cursor inputedCursor, IsGameHasToStart gameStartState)
 {
     commands = new ICommandForGame[]
     {
         new AddPipe(inputedField, inputedCursor),
         new AddSource(inputedField, inputedCursor),
         new ClearCell(inputedField, inputedCursor),
         new MoveCursorDown(inputedCursor),
         new MoveCursorLeft(inputedCursor),
         new MoveCursorRight(inputedCursor),
         new MoveCursorUp(inputedCursor),
         new StartGame(gameStartState)
     };
 }