class TetriminoBox(object): def __init__(self, Pos, Size, Surface): self.pos = Pos self._tetrimino = None self.surface = Surface self.rect = pygame.Rect(Pos.tuple(), Size.tuple()) pygame.draw.rect(self.surface, UiConfig.tetriminoBox['BORDER_COLOR'], \ self.rect, UiConfig.tetriminoBox['BORDER_WIDTH']) @property def tetrimino(self): return self._tetrimino @tetrimino.setter def tetrimino(self, tetrimino): if self._tetrimino: self._tetrimino.clear() pos = Pos(self.pos.x + 50, self.pos.y) self._tetrimino = Tetrimino(tetrimino.shape, tetrimino.color, \ surface = tetrimino.surface, pos = pos, \ grid = tetrimino.grid) self._tetrimino.draw()