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


Python Formation.is_staff_in_formation方法代码示例

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


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

示例1: StaffWorkingChecker

# 需要导入模块: from core.formation import Formation [as 别名]
# 或者: from core.formation.Formation import is_staff_in_formation [as 别名]
class StaffWorkingChecker(object):
    def __init__(self, server_id, char_id):
        from core.formation import Formation
        from core.plunder import Plunder
        from core.inspire import Inspire
        from core.championship import Championship

        self.server_id = server_id
        self.char_id = char_id

        self.formation = Formation(server_id, char_id)

        p = Plunder(server_id, char_id)
        self.plunder_formation_1 = p.get_way_object(1)
        self.plunder_formation_2 = p.get_way_object(2)
        self.plunder_formation_3 = p.get_way_object(3)

        c = Championship(server_id, char_id)
        self.championship_formation_1 = c.get_way_object(1)
        self.championship_formation_2 = c.get_way_object(2)
        self.championship_formation_3 = c.get_way_object(3)

        self.inspire = Inspire(server_id, char_id)

    def is_not_working(self, staff_id, raise_exception=True):
        if self.formation.is_staff_in_formation(staff_id):
            if raise_exception:
                raise GameException(ConfigErrorMessage.get_error_id("STAFF_IN_FORMATION"))

            return False

        if self.plunder_formation_1.is_staff_in_formation(staff_id):
            if raise_exception:
                raise GameException(ConfigErrorMessage.get_error_id("STAFF_IN_PLUNDER_FORMATION"))

            return False

        if self.plunder_formation_2.is_staff_in_formation(staff_id):
            if raise_exception:
                raise GameException(ConfigErrorMessage.get_error_id("STAFF_IN_PLUNDER_FORMATION"))

            return False
        if self.plunder_formation_3.is_staff_in_formation(staff_id):
            if raise_exception:
                raise GameException(ConfigErrorMessage.get_error_id("STAFF_IN_PLUNDER_FORMATION"))

            return False

        if self.championship_formation_1.is_staff_in_formation(staff_id):
            if raise_exception:
                raise GameException(ConfigErrorMessage.get_error_id("STAFF_IN_CHAMPIONSHIP_FORMATION"))

            return False

        if self.championship_formation_2.is_staff_in_formation(staff_id):
            if raise_exception:
                raise GameException(ConfigErrorMessage.get_error_id("STAFF_IN_CHAMPIONSHIP_FORMATION"))

            return False

        if self.championship_formation_3.is_staff_in_formation(staff_id):
            if raise_exception:
                raise GameException(ConfigErrorMessage.get_error_id("STAFF_IN_CHAMPIONSHIP_FORMATION"))

            return False

        if self.inspire.is_staff_in(staff_id):
            if raise_exception:
                raise GameException(ConfigErrorMessage.get_error_id("INSPIRE_STAFF_IN"))

            return False

        return True
开发者ID:yueyoum,项目名称:dianjing,代码行数:75,代码来源:checker.py


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