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


Python Character.__subclasses__方法代码示例

本文整理汇总了Python中core.Character.__subclasses__方法的典型用法代码示例。如果您正苦于以下问题:Python Character.__subclasses__方法的具体用法?Python Character.__subclasses__怎么用?Python Character.__subclasses__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在core.Character的用法示例。


在下文中一共展示了Character.__subclasses__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: rchop

# 需要导入模块: from core import Character [as 别名]
# 或者: from core.Character import __subclasses__ [as 别名]
from os import path, makedirs, listdir, chdir, system
from operator import itemgetter
from core import Character, rpgbs_init
from all_characters import *


def rchop(thestring, ending):
    if thestring.endswith(ending):
        return thestring[: -len(ending)]
    return thestring


app_lib = path.dirname(path.realpath(__file__))

characters = [Character()]
for character in Character.__subclasses__():
    eval("characters.append(" + character.__name__ + "())")
    subclasses = character.__subclasses__()
    for subclass in subclasses:
        eval("characters.append(" + subclass.__name__ + "())")
character_names = []
for character in characters:
    character_names.append(character.name)

# moves = sorted(get_attacks().items())

markdown_doc = {
    "documentation": path.join(app_lib, "documentation"),
    "characters": path.join(app_lib, "documentation", "md", "characters"),
    "attacks": path.join(app_lib, "documentation", "md", "moves"),
    "elements": path.join(app_lib, "documentation", "md", "elements"),
开发者ID:foxhead128,项目名称:rpg-battle-system,代码行数:33,代码来源:build_documentation.py


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