本文整理汇总了Python中die.Die.get_score方法的典型用法代码示例。如果您正苦于以下问题:Python Die.get_score方法的具体用法?Python Die.get_score怎么用?Python Die.get_score使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类die.Die
的用法示例。
在下文中一共展示了Die.get_score方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: LuckyPython
# 需要导入模块: from die import Die [as 别名]
# 或者: from die.Die import get_score [as 别名]
class LuckyPython(object):
def __init__(self, conf={}):
conf = self.get_conf_values()
self.die = Die(no_of_faces=conf['no_of_faces_of_die'])
self.board = Board(no_of_rows=conf['no_of_rows'],
no_of_columns=conf['no_of_columns'],
snakes_conf=conf['snakes'],
ladders_conf=conf['ladders'],
die=self.die)
def get_board(self):
return self.board.get_board()
def get_changed_player(self):
return self.board.get_active_player()
def get_score(self):
score = self.die.get_score()
return score
def add_player(self, object):
return self.board.add_player(object)
def set_board_status(self, object):
if object['status'] == 'start':
self.board.msg = 'Starting the game'
self.board.status = 'P' #start play
def set_score(self, score_object):
return self.board.set_score(score_object)
def get_turn(self):
return self.board.get_turn()
def get_conf_values(self):
""" get from user """ #FIXME
conf_dict = {'no_of_columns': 10,
'no_of_rows': 10,
'snakes': ((20, 10), (40, 6), (66, 33), (98, 18)),
'ladders': ((5, 14), (32, 62), (46, 58), (60, 84)),
'no_of_faces_of_die': 6}
return conf_dict