当前位置: 首页>>代码示例>>Python>>正文


Python UI.list_options方法代码示例

本文整理汇总了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)
开发者ID:RarefactionQ,项目名称:Genesis,代码行数:15,代码来源:Genesis.py

示例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()
开发者ID:RarefactionQ,项目名称:Genesis,代码行数:21,代码来源:Genesis.py

示例3: choose_research

# 需要导入模块: import UI [as 别名]
# 或者: from UI import list_options [as 别名]
def choose_research(s):
    answer = UI.list_options(Research)
    s.priority = answer
开发者ID:RarefactionQ,项目名称:Genesis,代码行数:5,代码来源:Genesis.py


注:本文中的UI.list_options方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。