本文整理汇总了Python中core.formation.Formation.find_socket_by_horse方法的典型用法代码示例。如果您正苦于以下问题:Python Formation.find_socket_by_horse方法的具体用法?Python Formation.find_socket_by_horse怎么用?Python Formation.find_socket_by_horse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.formation.Formation
的用法示例。
在下文中一共展示了Formation.find_socket_by_horse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: send_update_notify
# 需要导入模块: from core.formation import Formation [as 别名]
# 或者: from core.formation.Formation import find_socket_by_horse [as 别名]
def send_update_notify(self, _id, h):
hobj = OneHorse(int(_id), h.oid, h.attack, h.defense, h.hp)
msg = HorsesUpdateNotify()
msg.horse.MergeFrom(hobj.make_msg())
publish_to_char(self.char_id, pack_msg(msg))
f = Formation(self.char_id)
socket = f.find_socket_by_horse(int(_id))
if socket:
socket_changed_signal.send(
sender=None,
socket_obj=socket
)
示例2: check_sell
# 需要导入模块: from core.formation import Formation [as 别名]
# 或者: from core.formation.Formation import find_socket_by_horse [as 别名]
def check_sell(self, horse_id):
if not self.has_horse(horse_id):
raise SanguoException(
errormsg.HORSE_NOT_EXIST,
self.char_id,
"Horse Check Sell",
"horse {0} not exist".format(horse_id)
)
f = Formation(self.char_id)
if f.find_socket_by_horse(horse_id):
raise SanguoException(
errormsg.HORSE_CAN_NOT_SELL_IN_FORMATION,
self.char_id,
"Horse Check Sell",
"horse {0} in formation, can not sell".format(horse_id)
)