本文整理汇总了Python中view.View.introduction_message方法的典型用法代码示例。如果您正苦于以下问题:Python View.introduction_message方法的具体用法?Python View.introduction_message怎么用?Python View.introduction_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类view.View
的用法示例。
在下文中一共展示了View.introduction_message方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import introduction_message [as 别名]
class Game:
def __init__(self):
self.adventure.index = 0
self.adventure = []
self.player = None
self.view= View()
def begin(self):
self.player = self.view.input_player_name()
def create_player(self):
name = self.view.input_player_name()
job = self.view.input_player_job()
return Player(name, job)
def play(self):
self.view.introduction_message()
while self.adventure_index<len(self.adventure):
if self.adventure[self.adventure_index].start(self.player):
self.mission_index += 1
self.view.passed_adventure_message()
else:
self.view.failed_mission_message()
break
def load_adventure(self, adventure):
self.adventure = passed_adventure_messageself.adventure_index = 0
示例2: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import introduction_message [as 别名]
class Game:
def __init__(self):
self.mission_index = 0
self.missions = []
self.player = None
self.view = View()
def start(self):
self.player = self.create_player()
def create_player(self):
name = self.view.input_player_name()
race = self.view.input_player_race()
return Player(name, race)
def play(self):
self.view.introduction_message()
while self.mission_index < len(self.missions):
if self.missions[self.mission_index].start(self.player):
self.mission_index += 1
self.view.passed_mission_message()
else:
self.view.failed_mission_message()
break
def load_missions(self, missions):
self.missions = missions
self.mission_index = 0