本文整理匯總了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)
)