本文整理汇总了Python中Deck.Deck.findCardByName方法的典型用法代码示例。如果您正苦于以下问题:Python Deck.findCardByName方法的具体用法?Python Deck.findCardByName怎么用?Python Deck.findCardByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Deck.Deck
的用法示例。
在下文中一共展示了Deck.findCardByName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DeckBuilder
# 需要导入模块: from Deck import Deck [as 别名]
# 或者: from Deck.Deck import findCardByName [as 别名]
#.........这里部分代码省略.........
f.write(card.to_xml())
f.write("</cards>\n")
f.close()
self.on_escape(dialog)
dialog = kytten.FileSaveDialog( # by default, path is current working dir
extensions=['.xml'],
window=self, batch=self.batch,
anchor=kytten.ANCHOR_CENTER,
theme=self.theme2, on_escape=self.on_escape, on_select=on_select)
return dialog
def create_load_dialog(self):
dialog = None
def on_select(filename):
print "File load: %s" % filename
self.newdeck.populate(filename)
self.on_escape(dialog)
dialog = kytten.FileLoadDialog( # by default, path is current working dir
extensions=['.xml'],
window=self, batch=self.batch,
anchor=kytten.ANCHOR_CENTER,
theme=self.theme2, on_escape=self.on_escape, on_select=on_select)
def create_new_runner_deck_dialog(self):
def on_select_base(choice):
if DEBUG: print "Selected: %s" % choice
self.selectedCard = None
self.selectedCard = self.baseDeck.findCardByName(choice)
def on_add():
if self.selectedCard != None:
#print "Adding getting called?"
card = self.baseDeck.findCardByCID(self.selectedCard.cid)
self.newdeck.deck.append(card)
#self.selectedCard = None
def on_remove():
if self.selectedCard != None:
card = self.newdeck.findCardByCID(self.selectedCard.cid)
#print "Removing", card.name
self.newdeck.removeCardByCid(card.cid)
self.selectedCard = None
dialog = kytten.Dialog(
kytten.Frame(
kytten.VerticalLayout([
kytten.Label("Select a Card:"),
kytten.Dropdown(self.runnerbaselist, on_select=on_select_base),
kytten.Button("Add Selected Card to Deck", on_click=on_add),
kytten.Button("Remove Selected From the Deck", on_click=on_remove)
]),
),
window=self, batch=self.batch,
anchor=kytten.ANCHOR_CENTER,
theme=self.theme2, on_escape=self.on_escape)
return dialog
def create_new_corp_deck_dialog(self):
def on_select_base(choice):