本文整理匯總了Python中core.formation.Formation.get_leader_oid方法的典型用法代碼示例。如果您正苦於以下問題:Python Formation.get_leader_oid方法的具體用法?Python Formation.get_leader_oid怎麽用?Python Formation.get_leader_oid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類core.formation.Formation
的用法示例。
在下文中一共展示了Formation.get_leader_oid方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: create_character_infomation_message
# 需要導入模塊: from core.formation import Formation [as 別名]
# 或者: from core.formation.Formation import get_leader_oid [as 別名]
def create_character_infomation_message(char_id):
from core.character import Char
from core.formation import Formation
from core.hero import char_heros_dict
msg = CharacterInfomation()
char = Char(char_id)
heros = char_heros_dict(char_id)
f = Formation(char_id)
msg.id = char.mc.id
msg.name = char.mc.name
msg.level = char.mc.level
msg.vip = char.mc.vip
msg.power = char.power
msg.leader = f.get_leader_oid()
for hid in f.in_formation_hero_ids():
msg_hero = msg.formation.add()
if hid == 0:
msg_hero.id = 0
msg_hero.oid = 0
msg_hero.step = 0
else:
h = heros[hid]
msg_hero.id = h.id
msg_hero.oid = h.oid
msg_hero.step = h.step
return msg