本文整理汇总了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 = ""
示例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
示例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 = []
示例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)
示例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)
示例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)
示例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
示例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
示例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)
示例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()
示例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)
示例12: __init__
# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
def __init__(self, size=10):
Board.__init__(self, size)
示例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)
示例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
示例15: __init__
# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import __init__ [as 别名]
def __init__(self, statsclass=DiagStats):
Board.__init__(self, statsclass)