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


Python Cell.__init__方法代码示例

本文整理汇总了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
开发者ID:fhorinek,项目名称:pi8bit,代码行数:9,代码来源:module.py

示例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
     
开发者ID:saltire,项目名称:roverchip,代码行数:8,代码来源:fire.py

示例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
开发者ID:saltire,项目名称:roverchip,代码行数:11,代码来源:water.py

示例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
开发者ID:saltire,项目名称:roverchip,代码行数:11,代码来源:chipdoor.py

示例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
开发者ID:saltire,项目名称:roverchip,代码行数:13,代码来源:ice.py

示例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
开发者ID:saltire,项目名称:roverchip,代码行数:13,代码来源:toggle.py

示例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
开发者ID:saltire,项目名称:roverchip,代码行数:13,代码来源:door.py

示例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"
开发者ID:caja-matematica,项目名称:pyTopTools,代码行数:42,代码来源:background_noise.py

示例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
开发者ID:saltire,项目名称:roverchip,代码行数:7,代码来源:grate.py

示例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
     
开发者ID:saltire,项目名称:roverchip,代码行数:6,代码来源:exit.py

示例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, '%')
开发者ID:TheRealest,项目名称:impulse,代码行数:4,代码来源:alien.py

示例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
开发者ID:saltire,项目名称:roverchip,代码行数:8,代码来源:conveyor.py

示例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)
开发者ID:jon2718,项目名称:ipycool_2.0,代码行数:7,代码来源:hard_edge_transport.py

示例14: __init__

# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import __init__ [as 别名]
 def __init__(self, level, pos):
     Cell.__init__(self, level, pos)
开发者ID:saltire,项目名称:roverchip,代码行数:4,代码来源:floor.py

示例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
开发者ID:saltire,项目名称:roverchip,代码行数:8,代码来源:button.py


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