本文整理汇总了Python中game_state.GameState.progress方法的典型用法代码示例。如果您正苦于以下问题:Python GameState.progress方法的具体用法?Python GameState.progress怎么用?Python GameState.progress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类game_state.GameState
的用法示例。
在下文中一共展示了GameState.progress方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Service
# 需要导入模块: from game_state import GameState [as 别名]
# 或者: from game_state.GameState import progress [as 别名]
class Service(object):
"""
Handles the game logic.
"""
def __init__(self):
self.state = None
self.tick = 0
def new_game(self):
self.state = GameState()
def move(self, character_id, coordinates):
result = self.state.move_character(character_id, coordinates)
return result
def character_location(self, character_id):
return self.state.character_location(character_id)
def interact(self):
pass
def inc_tick(self):
self.state.progress()
self.tick += 1
def dispatch_command(self, command_obj):
if command_obj.id == CommandIds.MOVE:
result = self.move(command_obj.character_id, command_obj.coordinates)
return result
elif command_id == CommandIds.INTERACT:
pass
else:
pass