当前位置: 首页>>代码示例>>Python>>正文


Python Deck.removeCardByCid方法代码示例

本文整理汇总了Python中Deck.Deck.removeCardByCid方法的典型用法代码示例。如果您正苦于以下问题:Python Deck.removeCardByCid方法的具体用法?Python Deck.removeCardByCid怎么用?Python Deck.removeCardByCid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Deck.Deck的用法示例。


在下文中一共展示了Deck.removeCardByCid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: DeckBuilder

# 需要导入模块: from Deck import Deck [as 别名]
# 或者: from Deck.Deck import removeCardByCid [as 别名]

#.........这里部分代码省略.........
        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):
            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:
开发者ID:mcgillij,项目名称:REZD,代码行数:70,代码来源:DeckBuilder.py


注:本文中的Deck.Deck.removeCardByCid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。