def move(self, a, b, c, d): if Validator.validate_move(copy.deepcopy(self.last_move), copy.deepcopy(self.board), a, b, c, d, self.ui_mode): self.move_figure(a, b, c, d) #remove current figure on (c,d) position if (c, d) in self.displayed_figures: self.remove_figure(self.displayed_figures[(c, d)]) self.displayed_figures[(c, d)] = self.displayed_figures[(a, b)] self.displayed_figures[(a, b)] = None self.images[(c, d)] = self.images[(a, b)] self.images[(a, b)] = None self.remove_figure(self.displayed_figures[(c, d)]) self.add_figure(self.displayed_figures[(c, d)], self.images[(c, d)], c, d)
def move_current_figure(self, a, b, c, d): if Validator.validate_move(copy.deepcopy(self.last_move), copy.deepcopy(self.board), a, b, c, d, self.ui_mode): self.move_figure(a, b, c, d)