當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。