本文整理汇总了Python中UI.list_options方法的典型用法代码示例。如果您正苦于以下问题:Python UI.list_options方法的具体用法?Python UI.list_options怎么用?Python UI.list_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UI
的用法示例。
在下文中一共展示了UI.list_options方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: assign_job
# 需要导入模块: import UI [as 别名]
# 或者: from UI import list_options [as 别名]
def assign_job(s):
mate = UI.pick_list_crew(s.crew)
if mate == -1:
return
colorful_jobs = map(UI.color_code, Jobs)
for quest in quest_list:
colorful_jobs.append(quest.description+" "+str(quest.quest_id))
job = UI.list_options(colorful_jobs, UI.inline_print(s.crew[mate]))
if job < len(Jobs):
s.crew[mate].job = Jobs[job]
else:
index = job - len(Jobs)
s.crew[mate].job = quest_list[index].description+" "+str(quest_list[index].quest_id)
示例2: decision_loop
# 需要导入模块: import UI [as 别名]
# 或者: from UI import list_options [as 别名]
def decision_loop(s):
main_loop = ["Inspect Crew", "Choose Research", "Assign Job", "Sterilize", "Euthanize", "End Turn"]
quest_status = ""
for quest in quest_list:
quest_status+="\n"+quest.description+", projected work: "+str(quest.count_work(s))+"/"+str(quest.cost)
answer = UI.list_options(main_loop, header=str(UI.get_stats(s)+quest_status))
if answer == 0:
inspect_crew(s)
elif answer == 1:
choose_research(s)
elif answer == 2:
assign_job(s)
elif answer == 3:
sterilize(s)
elif answer == 4:
euthanize(s)
elif answer == 5:
end_turn(s)
UI.acknowledge()
示例3: choose_research
# 需要导入模块: import UI [as 别名]
# 或者: from UI import list_options [as 别名]
def choose_research(s):
answer = UI.list_options(Research)
s.priority = answer