Ejemplo n.º 1
0
 public Board2DCreator(Board2DManagerUI board2DManagerUI, Board2DManager board2DManager, int rowsHeight, int columnsWidht)
 {
     this.board2DManagerUI = board2DManagerUI;
     this.board2DManager   = board2DManager;
     _columns  = columnsWidht;
     _rows     = rowsHeight;
     GridArray = board2DManager.GridArray;
 }
        public Board2DManager(Board2DManagerUI board2DManagerUI, int rowsHeight, int columnsWidht)
        {
            this.board2DManagerUI = board2DManagerUI;
            occupierPositions     = new Dictionary <IOcuppy, Position>();
            // a la cantidad de columnas que tenga nuestro grid le vamos a agregar dos de cada lado
            // entonces si es de 5 filas por 7 columnas va a quedar de 5 filas por 11 columnas
            // le sumamos 4 para el espacio de la base del jugado 1 y del jugador 2
            this.columnsWidht = columnsWidht + 4;
            this.rowsHeight   = rowsHeight;

            tileSize        = 4;
            originPosition  = board2DManagerUI.LoadSizeAndGetOriginPosition(this.rowsHeight, this.columnsWidht);
            GridArray       = new Tile[this.columnsWidht, this.rowsHeight];
            ocuppiersByTile = new IOcuppy[this.columnsWidht, this.rowsHeight];
            board2DCreator  = new Board2DCreator(board2DManagerUI, this, this.rowsHeight, this.columnsWidht);
        }