/// <summary> /// </summary> public void CreateMap(string map, int x, int y) { TilesArray = new Tile[x / 5, y / 5]; HeightOfMap = x; LengthOfMap = y; int z = 0; int a = 0; for (int i = 0; i < x - 5; i = i + 5) { for (int j = 0; j < y - 5; j = j + 5) { if (checkRackList(i, j)) { TilesArray[a, z] = new Tile(new Point(i / 5, j / 5), new Point(i, j)); } else { TilesArray[a, z] = new TileRack(new Point(i / 5, j / 5), new Point(i, j)); } z++; if (z == y - 1) { z = 0; break; } } z = 0; a++; if (a == x - 1) { a = 0; break; } } }
/// <summary> /// </summary> public void CreateMap(string map, int x, int y) { TilesArray = new Tile[x, y]; HeightOfMap = x; LengthOfMap = y; for (int i = 0; i < x; i++) { for (int j = 0; j < y; j++) { if (checkRackList(i, j)) { TilesArray[i, j] = new Tile(new Point(i, j)); } else { TilesArray[i, j] = new TileRack(new Point(i, j)); } } } }