Ejemplo n.º 1
0
	def builGraphBoard(self):
		COLUMNA = 0
		FILA = 0
		nfilas = 2*self.Row+1
		nColumnas = 2*self.Column+1
		for i in range(nfilas):
			if i%2==0:
				auxHorizontal=[]
				for j in range(nColumnas):
					if j%2==0: #dot
						dot=GraphicPoint(self)
						dot.setMinimumHeight(30)
						dot.setMinimumWidth(30)
						dot.move(COLUMNA,FILA)
						COLUMNA = COLUMNA + 30
					else: #horizontal Edge
						auxDod=Dod(i//2,j//2)
						gEdge=GraphicEdge("H",auxDod,self.observer,self)
						#gEdge=QPushButton("H",self.contendorBoard)
						gEdge.setMinimumHeight(30)
						gEdge.setMinimumWidth(60)
						gEdge.move(COLUMNA,FILA)
						COLUMNA = COLUMNA + 60
						auxHorizontal.append(gEdge)
				FILA = FILA + 30
				COLUMNA = 0
				self.GrapicHorizontalEdges.append(auxHorizontal)
			else:
				auxVertical=[]
				auxBoxes=[]
				for j in range(nColumnas):
					if j%2==0: #verticar Edge
						auxDod=Dod(i//2,j//2)
						gEdge=GraphicEdge("V",auxDod,self.observer,self)
						#gEdge=QPushButton("V",self.contendorBoard)
						gEdge.setMinimumHeight(60)
						gEdge.setMinimumWidth(30)
						gEdge.move(COLUMNA,FILA)
						COLUMNA = COLUMNA + 30
						auxVertical.append(gEdge)
					else: #box
						gBox=GraphicBox(self)
						#gBox=QPushButton("B",self.contendorBoard)
						gBox.setMinimumHeight(60)
						gBox.setMinimumWidth(60)
						gBox.move(COLUMNA,FILA)
						COLUMNA = COLUMNA + 60
						auxBoxes.append(gBox)
				FILA = FILA + 60
				COLUMNA = 0
				self.GraphicVerticalEdges.append(auxVertical)
				self.GraphicBoxesMatrix.append(auxBoxes)
Ejemplo n.º 2
0
	def builGraphBoard(self):
		COLUMNA = 0
		FILA = 0
		nfilas = 2*self.Row+1
		nColumnas = 2*self.Column+1
		for i in range(nfilas):
			if i%2==0:
				auxHorizontal=[]
				for j in range(nColumnas):
					if j%2==0: #dot
						dot=GraphicPoint(self)
						dot.setMinimumHeight(30)
						dot.setMinimumWidth(30)
						dot.move(COLUMNA,FILA)
						COLUMNA = COLUMNA + 30
					else: #horizontal Edge
						if self.hayLineaHorizontal(i//2,j//2):
							gEdge=Lineas("H",self)
							gEdge.setMinimumHeight(30)
							gEdge.setMinimumWidth(60)
							gEdge.move(COLUMNA,FILA)
						COLUMNA = COLUMNA + 60
				FILA = FILA + 30
				COLUMNA = 0
			else:
				for j in range(nColumnas):
					if j%2==0: #verticar Edge
						if self.hayLineaVertical(i//2,j//2):
							gEdge=Lineas("V",self)
							#gEdge=QPushButton("V",self.contendorBoard)
							gEdge.setMinimumHeight(60)
							gEdge.setMinimumWidth(30)
							gEdge.move(COLUMNA,FILA)
						COLUMNA = COLUMNA + 30
					else: #box
						gBox=GraphicBox(self)
						#gBox=QPushButton("B",self.contendorBoard)
						gBox.setMinimumHeight(60)
						gBox.setMinimumWidth(60)
						gBox.move(COLUMNA,FILA)
						COLUMNA = COLUMNA + 60
				FILA = FILA + 60
				COLUMNA = 0
Ejemplo n.º 3
0
 def builGraphBoard(self):
     COLUMNA = 0
     FILA = 0
     nfilas = 2 * self.Row + 1
     nColumnas = 2 * self.Column + 1
     for i in range(nfilas):
         if i % 2 == 0:
             auxHorizontal = []
             for j in range(nColumnas):
                 if j % 2 == 0:  #dot
                     dot = GraphicPoint(self)
                     dot.setMinimumHeight(30)
                     dot.setMinimumWidth(30)
                     dot.move(COLUMNA, FILA)
                     COLUMNA = COLUMNA + 30
                 else:  #horizontal Edge
                     if self.hayLineaHorizontal(i // 2, j // 2):
                         gEdge = Lineas("H", self)
                         gEdge.setMinimumHeight(30)
                         gEdge.setMinimumWidth(60)
                         gEdge.move(COLUMNA, FILA)
                     COLUMNA = COLUMNA + 60
             FILA = FILA + 30
             COLUMNA = 0
         else:
             for j in range(nColumnas):
                 if j % 2 == 0:  #verticar Edge
                     if self.hayLineaVertical(i // 2, j // 2):
                         gEdge = Lineas("V", self)
                         #gEdge=QPushButton("V",self.contendorBoard)
                         gEdge.setMinimumHeight(60)
                         gEdge.setMinimumWidth(30)
                         gEdge.move(COLUMNA, FILA)
                     COLUMNA = COLUMNA + 30
                 else:  #box
                     gBox = GraphicBox(self)
                     #gBox=QPushButton("B",self.contendorBoard)
                     gBox.setMinimumHeight(60)
                     gBox.setMinimumWidth(60)
                     gBox.move(COLUMNA, FILA)
                     COLUMNA = COLUMNA + 60
             FILA = FILA + 60
             COLUMNA = 0