Example #1
0
 /// <summary>
 /// Constructor with 4 parameters
 /// </summary>
 /// <param name="generator">Parameter of type IPlayFieldGenerator</param>
 /// <param name="playerPosition">Parameter of type IPosition</param>
 /// <param name="rows">Parameter of type int</param>
 /// <param name="colums">Parameter of type int</param>
 public PlayField(
     IPlayFieldGenerator generator,
     IPosition playerPosition,
     int rows   = Constants.StandardGameLabyrinthRows,
     int colums = Constants.StandardGameLabyrinthCols)
 {
     this.playFieldGenerator = generator;
     this.NumberOfRows       = rows;
     this.NumberOfCols       = colums;
     this.PlayerPosition     = playerPosition;
 }
 /// <summary>
 /// Constructor with 4 parameters
 /// </summary>
 /// <param name="generator">Parameter of type IPlayFieldGenerator</param>
 /// <param name="playerPosition">Parameter of type IPosition</param>
 /// <param name="rows">Parameter of type int</param>
 /// <param name="colums">Parameter of type int</param>
 public PlayField(
     IPlayFieldGenerator generator,
     IPosition playerPosition,
     int rows = Constants.StandardGameLabyrinthRows,
     int colums = Constants.StandardGameLabyrinthCols)
 {
     this.playFieldGenerator = generator;
     this.NumberOfRows = rows;
     this.NumberOfCols = colums;
     this.PlayerPosition = playerPosition;
 }
        public void ClassInitialize()
        {
            playerPosition = new Position(3, 3);
            generator = new StandardPlayFieldGenerator(playerPosition, 9, 9);
            playField = new PlayField(generator, playerPosition, 9, 9);

            IInfoRenderer infoPanel = new InfoPanel();
            IPlayFieldRenderer playFieldPanel = new PlayFieldPanel();
            ILadderRenderer topScoresPanel = new TopScoresPanel();
            output = new ConsoleRender(infoPanel, playFieldPanel, topScoresPanel);

            memory = new MementoCaretaker(new List<IMemento>());

            ladder = ScoreLadder.Instance;

            player = new Player("test", new Cell(playerPosition));

            context = new CommandContext(playField, output, memory, ladder, player);
        }
Example #4
0
        public void ClassInitialize()
        {
            playerPosition = new Position(3, 3);
            generator      = new StandardPlayFieldGenerator(playerPosition, 9, 9);
            playField      = new PlayField(generator, playerPosition, 9, 9);

            IInfoRenderer      infoPanel      = new InfoPanel();
            IPlayFieldRenderer playFieldPanel = new PlayFieldPanel();
            ILadderRenderer    topScoresPanel = new TopScoresPanel();

            output = new ConsoleRender(infoPanel, playFieldPanel, topScoresPanel);

            memory = new MementoCaretaker(new List <IMemento>());

            ladder = ScoreLadder.Instance;

            player = new Player("test", new Cell(playerPosition));

            context = new CommandContext(playField, output, memory, ladder, player);
        }