本文整理汇总了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