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


Python AnchorLayout.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from kivy.uix.anchorlayout import AnchorLayout [as 别名]
# 或者: from kivy.uix.anchorlayout.AnchorLayout import __init__ [as 别名]
    def __init__(self, *pars, **kpars):
        AnchorLayout.__init__(self, *pars, **kpars)
        self.cur_dir = dirname(abspath('file'))
        config = Configuration()
        config.purgelines()
        config.initialize()

        # do not use '-' or other chars in the name!
        self.username = ''

        self.turnables = config.getParam('turnable')
        self.cards_unturnable = bool(int(config.getParam('cards_unturnable')))

        # enables the automatic player agent, playing as NK as default. 
        self.rp = None  # Rule Parser
        self.auto_player = bool(int(config.getParam('auto_player')))
        if self.auto_player:
            self.rp = RuleParser()
            self.rp.load_rules()

        self.format = config.getParam('format')
        self.help_file = config.getParam('help_file')
        self.shoe_file = config.getParam('shoe_file')

        self.srv = config.getParam('server')
        self.srv_port = config.getParam('server_port')

        if self.format == 'circular':
            self.turnable = dict(zip(TTTGame.CIRCULAR_CARD_LAYOUT, [bool(int(x)) for x in self.turnables.split(',')]))
        else:
            self.turnable = dict(zip(TTTGame.LINEAR_CARD_LAYOUT, [bool(int(x)) for x in self.turnables.split(',')]))

        self.timer_start = int(config.getParam('timer_start'))

        # load default shoe_file:
        self.shoe_config = Configuration(config_file=self.shoe_file)
        self.shoe_config.purgelines()

        # self.turn = ''  # current player turn
        self.current_target_card = ''  # the target card stated in the shoe_file ("2H" usually)

        print self.shoe_config.content

        self.hands = []  # store all hands
        # file names are in the form: output-<dmY>-<HM>.txt
        # Here we just create a reference. The actual obj is made when the login popup is dismissed
        self.fout_handle = None
        self.fout_time_handle = None

        self.timeHistory = []  # list holding the strings: <move> <time>\n
        self.stopwatch = StopWatch()

        self.nk_history_q = deque([], 2)  # nk history of the last 2 hands. Required for automatic agent
        self.ck_history_q = deque([], 2)  # ck history of the last 2 hands. Required for automatic agent
开发者ID:jpg75,项目名称:TTT-kivy,代码行数:56,代码来源:tttgame.py


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