本文整理汇总了Python中validator.Validator.validate_move方法的典型用法代码示例。如果您正苦于以下问题:Python Validator.validate_move方法的具体用法?Python Validator.validate_move怎么用?Python Validator.validate_move使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类validator.Validator
的用法示例。
在下文中一共展示了Validator.validate_move方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: move
# 需要导入模块: from validator import Validator [as 别名]
# 或者: from validator.Validator import validate_move [as 别名]
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)
示例2: move_current_figure
# 需要导入模块: from validator import Validator [as 别名]
# 或者: from validator.Validator import validate_move [as 别名]
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)