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


Python Board.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
 def __init__(self, target, flash, interface, transport="cmsis_dap"):
     """
     Init the board
     """
     Board.__init__(self, target, flash, interface, transport)
     self.unique_id = ""
     self.target_type = ""
开发者ID:sanyaade-embedded-systems,项目名称:mbed,代码行数:9,代码来源:mbed_board.py

示例2: __init__

# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
 def __init__(self):
     Board.__init__(self)
     Actions.__init__(self)
     Rules.__init__(self)
     self.players = {}
     self.turn = 0
     self.game_over = True
开发者ID:ncdesouza,项目名称:GameServer,代码行数:9,代码来源:game.py

示例3: __init__

# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
    def __init__(self, l, w, a, b, c, d, name):
        '''(Player) -> NoneType
        Stores all of the instance variables and method calls needed for the
        the human player.
        '''
        Board.__init__(self, l, w, a, b, c, d, name)
        # This retrieves each of the attribute values from the board class
        self.l = l
        self.w = w
        self.num_battleships = a
        self.num_cruisers = b
        self.num_frigates = c
        self.num_minesweepers = d
        self.name = name

        # A list of the boat's coordinates
        self.coordinates = []

        # The coordinates for the random pick (meant for the random pick for
        # the computer class
        self.coordlist = []

        # a list of all of the coordinates the player has hit
        self.hitlist = []

        # a list of where the opposing player has attacked, regardless of a hit
        # or a miss
        self.attack = []

        # A list containing two seperate images, the first being the player's
        # board, and the second being the opponents board
        self.boards = []

        # A list of the opponents coordinates for the ships
        self.opp_list = []
开发者ID:entiri,项目名称:Battleship,代码行数:37,代码来源:playerclass.py

示例4: __init__

# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
 def __init__(self, nr_of_rectangles):
     self.image_e = load("e.png")
     self.image_x = load("x.png")
     self.image_o = load("o.png") #TODO add the o image
     dimensions = Rectangle(0, 0, self.image_x.get_width(),
                                  self.image_x.get_height())
     self.players_turn = 0
     Board.__init__(self, nr_of_rectangles, dimensions)
开发者ID:LajaviKrelac,项目名称:GGS,代码行数:10,代码来源:tictactoeboard.py

示例5: __init__

# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
    def __init__(self, shapes, statsclass=ShapeStats):
        self.shapes = shapes
##      self.shapesdict = dict([ (num, [ (r, c) 
##                                       for r in range(9)
##                                       for c in range(9)
##                                       if self.shapes[r][c] == num ])
##                               for num
##                               in range(9) ])
##      for k, v in self.shapesdict.items():
##          print k, v        
        
        Board.__init__(self, statsclass)
开发者ID:szopenfx,项目名称:code,代码行数:14,代码来源:shape.py

示例6: __init__

# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
    def __init__(self, size=8):
        random.seed(SEED)
        print "SEED IS", SEED
        self._placed = set()

        vals = range(size)
        random.shuffle(vals)
        for i in xrange(size):
            self.place_piece((i, vals[i]))


        self.__size = size
        Board.__init__(self, size)
开发者ID:okayzed,项目名称:queens-repair,代码行数:15,代码来源:repair.py

示例7: __init__

# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
 def __init__(self, rows_definition, catalyst = []):
     """
     rows_definition -- a list of tuples in the form (offset, number of cells)
     catalyst -- a list of two coords tuples that are "catalyst" for the tile:
     in base configuration the second is forced to be empty. The peg in the catalizer 
     position is the only survivor after the tile has been applied
     emptyStart -- a boolean stating whether this tile has to be bound to the empty or 
     catalyst cell or not.   
     """
     Board.__init__(self, rows_definition)
     self[catalyst[1][0]][catalyst[1][1]].pick()
     self.catalyst = catalyst
     self.start = None
开发者ID:ilmirons,项目名称:apsa,代码行数:15,代码来源:tile.py

示例8: __init__

# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
 def __init__(self, player):
     self.exposedMeldDistance = 0.15
     self.concealedMeldDistance = 0.0
     self.lowerY = 1.0
     self.player = player
     Board.__init__(self, 15.6, 2.0, Internal.field.tileset)
     self.isHandBoard = True
     self.tileDragEnabled = False
     self.setParentItem(player.front)
     self.setAcceptDrops(True)
     self.__moveHelper = None
     self.__sourceView = None
     self.rearrangeMelds = Preferences.rearrangeMelds
     self.showShadows = Preferences.showShadows
开发者ID:ospalh,项目名称:kajongg-fork,代码行数:16,代码来源:handboard.py

示例9: __init__

# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
 def __init__(self, player):
     assert player
     self._player = weakref.ref(player)
     self.exposedMeldDistance = 0.15
     self.concealedMeldDistance = 0.0
     self.lowerY = 1.0
     Board.__init__(self, 15.6, 2.0, Tileset.activeTileset())
     self.isHandBoard = True
     self.tileDragEnabled = False
     self.setParentItem(player.front)
     self.setPosition()
     self.setAcceptDrops(True)
     Internal.Preferences.addWatch(
         'rearrangeMelds', self.rearrangeMeldsChanged)
     Internal.Preferences.addWatch(
         'showShadows', self.showShadowsChanged)
开发者ID:KDE,项目名称:kajongg,代码行数:18,代码来源:handboard.py

示例10: __init__

# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
    def __init__(self, cellsize=3, board=None, filename=None):
        """Form a board with history.

        If board is not None, the numbers are loaded from the board.
        If filename is not None, the numbers are loaded from a filename file.
        If board and filename are None a void board is created, with the size
        specified by cellsize.

        Keyword arguments:
        cellsize -- integer of the cell side lenght, default 3 for a 9x9
                    board (cellsize must be > 1)
                 -- or a tuple/list of 2 integers for a H*W grid on W*H grids
        board -- source board
        filename -- the file name (default None)

        """
        Board.__init__(self, cellsize, board, filename)
        self.forget()
开发者ID:ternus,项目名称:arcnet,代码行数:20,代码来源:history.py

示例11: __init__

# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
 def __init__(self, game):
     self.screen = pygame.display.set_mode((100 * 8, 300))
     Board.__init__(self)
     Hud.__init__(self, game)
开发者ID:ncdesouza,项目名称:GameServer,代码行数:6,代码来源:kalahgui.py

示例12: __init__

# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
 def __init__(self, size=10):
     Board.__init__(self, size)
开发者ID:jorgeramirez,项目名称:step,代码行数:4,代码来源:guiboard.py

示例13: __init__

# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
	def __init__(self, size, moves, one_by_one=False):
		Board.__init__(self, size, moves, one_by_one)
开发者ID:patrickszmucer,项目名称:squares,代码行数:4,代码来源:UIboard.py

示例14: __init__

# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
 def __init__(self, tileset, boardRotation, length):
     Board.__init__(self, length, 1, tileset, boardRotation=boardRotation)
     self.length = length
开发者ID:KDE,项目名称:kajongg,代码行数:5,代码来源:uiwall.py

示例15: __init__

# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
 def __init__(self, statsclass=DiagStats):
     Board.__init__(self, statsclass)
开发者ID:szopenfx,项目名称:code,代码行数:4,代码来源:diagonal.py


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