Exemplo n.º 1
0
	def get_vertices (self, BIH):
		"""
			PRIVATE: get_vertices
			---------------------
			fills self.board_vertices, self.image_vertices 
		"""
		self.board_vertices	= algebraic_notation_to_board_coords (self.an)
		self.image_vertices	= [board_to_image_coords (BIH, bv) for bv in self.board_vertices]
Exemplo n.º 2
0
    def get_vertices(self, BIH):
        """
			PRIVATE: get_vertices
			---------------------
			fills self.board_vertices, self.image_vertices 
		"""
        self.board_vertices = algebraic_notation_to_board_coords(self.an)
        self.image_vertices = [
            board_to_image_coords(BIH, bv) for bv in self.board_vertices
        ]
Exemplo n.º 3
0
    def get_colors(self, algebraic_notation):
        """
			Function: get_square_color
			--------------------------
			given a square's algebraic notation, this returns its binary color
			Note: 0 -> white, 1 -> colored
		"""
        tl = algebraic_notation_to_board_coords(algebraic_notation)[0]
        if (tl[0] + tl[1]) % 2 == 1:
            self.color = 1
            self.draw_color = (255, 50, 50)
        else:
            self.color = 0
            self.draw_color = (0, 0, 200)
Exemplo n.º 4
0
	def get_colors (self, algebraic_notation):
		"""
			Function: get_square_color
			--------------------------
			given a square's algebraic notation, this returns its binary color
			Note: 0 -> white, 1 -> colored
		"""
		tl = algebraic_notation_to_board_coords (algebraic_notation)[0]
		if (tl[0] + tl[1]) % 2 == 1:
			self.color = 1
			self.draw_color = (255, 50, 50)
		else:
			self.color = 0
			self.draw_color = (0, 0, 200)