本文整理汇总了Python中cell.Cell.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Cell.__init__方法的具体用法?Python Cell.__init__怎么用?Python Cell.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cell.Cell
的用法示例。
在下文中一共展示了Cell.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import __init__ [as 别名]
def __init__(self, parent):
Cell.__init__(self, parent)
Controller.__init__(self, self.parent.canvas, parent)
self.offset_x = 0
self.offset_y = 0
self.update_request = False
self.old_zoom = False
示例2: __init__
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import __init__ [as 别名]
def __init__(self, level, pos):
Cell.__init__(self, level, pos)
self.tile = 2, 0
self.player_can_enter = False
self.robot_can_enter = True
示例3: __init__
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import __init__ [as 别名]
def __init__(self, level, pos, flow_dir=None):
Cell.__init__(self, level, pos)
self.tile = (3, 0) if flow_dir is None else (4, 0)
self.rotate = 0 if flow_dir is None else flow_dir
self.player_can_enter = False
self.robot_can_enter = False
self.flow_dir = flow_dir
示例4: __init__
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import __init__ [as 别名]
def __init__(self, level, pos, facing):
Cell.__init__(self, level, pos)
self.tile = 7, 3 + (facing % 2)
self.player_can_enter = False
self.robot_can_enter = False
self.object_can_enter = False
self.floor_tile = 0, 0
示例5: __init__
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import __init__ [as 别名]
def __init__(self, level, pos, facing=None):
Cell.__init__(self, level, pos)
self.tile = 9, 0
self.facing = facing
self.robot_can_enter = False
self.corner_tile = 10, 0
# diagonal dir the corner is facing, clockwise from northeast (optional)
self.facing = facing
示例6: __init__
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import __init__ [as 别名]
def __init__(self, level, pos, state):
Cell.__init__(self, level, pos)
self.tile = 11, 0
self.player_can_enter = not state
self.robot_can_enter = not state
self.object_can_enter = not state
self.state = bool(state)
self.off_tile = 0, 0
self.on_tile = 1, 0
示例7: __init__
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import __init__ [as 别名]
def __init__(self, level, pos, facing, colour):
Cell.__init__(self, level, pos)
self.tile = 5, 2 + colour
self.rotate = facing
self.player_can_enter = False
self.robot_can_enter = False
self.object_can_enter = False
self.floor_tile = 0, 0
self.colour = colour
示例8: __init__
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import __init__ [as 别名]
def __init__( self, fname, bndy, skiprows=0, shape=(203,198), verbose=False ):
"""
Load a complete, concatenated cell text file.
fname : path to file.
skiprows : skip the first 'skiprows'.
shape : shape for resizing each frame. default=(203,198)
square : dimension for reshaping boundary to and cell frames to a
square matrix. necessary for lining them up, since even though
boundary is centered correctly over cell, this only occurs when
shapes of matrices _do not_ line up.
"""
Cell.__init__( self, fname, bndy, skiprows, shape, verbose )
# self.fname = fname
# self.shape = shape
if shape[0] > shape[1]:
self.square = shape[1]
else:
self.square = shape[0]
self.verbose = verbose
# #self.all_frames = np.loadtxt( fname, skiprows=skiprows, dtype=np.uint )
# if self.verbose:
# print "Loaded frames"
self.frames = []
for frame in self.all_frames:
frame.resize( shape )
self.frames.append( frame[:self.square,:self.square] )
# B = np.loadtxt( bndy )# dtype=np.uint )
# B.resize( (shape[1],shape[0]) )
# boundary init'd in Cell
self.boundary = self.boundary[:self.square,:self.square]
if self.verbose:
print "Done initializing frames and boundary"
示例9: __init__
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import __init__ [as 别名]
def __init__(self, level, pos):
Cell.__init__(self, level, pos)
self.tile = 5, 0
self.robot_can_enter = False
示例10: __init__
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import __init__ [as 别名]
def __init__(self, level, pos):
Cell.__init__(self, level, pos)
self.tile = 6, 0
示例11: __init__
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import __init__ [as 别名]
def __init__(self, ship):
Cell.__init__(self, ship, (180, 255, 180), None, '%')
示例12: __init__
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import __init__ [as 别名]
def __init__(self, level, pos, flow_dir):
Cell.__init__(self, level, pos)
self.tile = 7, 0
self.rotate = flow_dir
self.robot_can_enter = False
示例13: __init__
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import __init__ [as 别名]
def __init__(self, **kwargs):
if ICoolObject.check_command_params_init(self, HardEdgeTransport.command_params_ext, **kwargs) is False:
sys.exit(0)
he_sol = Sol(model='edge', ent_def=0, ex_def=0, foc_flag=0, bs=self.bs)
Cell.__init__(self, ncells=1, flip=False, field=he_sol)
示例14: __init__
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import __init__ [as 别名]
def __init__(self, level, pos):
Cell.__init__(self, level, pos)
示例15: __init__
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import __init__ [as 别名]
def __init__(self, level, pos, colour):
Cell.__init__(self, level, pos)
self.tile = 9, 2 + colour
self.colour = colour