Exemplo n.º 1
0
        public Map(int x, int y)
        {
            init();
            layout = new Tile[x][];

            this.x = x;
            this.y = y;

            for (int i = 0; i < x; i++)
            {
                layout[i] = new Tile[y];
            }
        }
Exemplo n.º 2
0
        public Map(int mapSize)
        {
            init();
            layout = new Tile[mapSize][];

            x = mapSize;
            y = mapSize;

            for (int i = 0; i < mapSize; i++)
            {
                layout[i] = new Tile[mapSize];
            }
        }
Exemplo n.º 3
0
        public Map()
        {
            init();

            int x, y;
            x = rand.Next(20, 46);
            y = rand.Next(x-5, x+5);
            currentFloor = maxFloorReached;
            this.x = x;
            this.y = y;

            layout = new Tile[x][];

            for (int i = 0; i < x; i++)
            {
                layout[i] = new Tile[y];
            }
        }
Exemplo n.º 4
0
 public Map(Tile[][] layout)
 {
     this.layout = layout;
 }
Exemplo n.º 5
0
        public Map(int minX, int maxX, int minY, int maxY)
        {
            init();

            int x, y;
            x = rand.Next(minX, maxX);
            y = rand.Next(minY, maxY);

            this.x = x;
            this.y = y;

            layout = new Tile[x][];

            for (int i = 0; i < x; i++)
            {
                layout[i] = new Tile[y];
            }
        }
Exemplo n.º 6
0
 public void populate()
 {
     for (int i = 0; i < x; i++)
     {
         for (int j = 0; j < y; j++)
         {
             layout[i][j] = new Tile();
             layout[i][j].type = TileType.closed;
             layout[i][j].visible = false;
             layout[i][j].DataContext = layout[i][j];
             layout[i][j].SetBinding(Tile.BackgroundProperty, tileImageBinding);
         }
     }
     //generateTestMap();
     generateRandomMap();
 }