Exemplo n.º 1
0
    def __init__(
        self,
        color=color.red,
        opacity=0,
        length=9,
        width=9,
        height=9,
        pos=(0, 0, 0),
        northWall=None,
        southWall=None,
        westWall=None,
        eastWall=None,
        northCell=None,
        southCell=None,
        westCell=None,
        eastCell=None,
        iscorner=False,
        mazePos=[],
    ):

        box.__init__(self)  # super constructor

        self.color = color
        self.opacity = opacity
        self.length = length
        self.width = width
        self.height = height
        self.pos = pos

        self.mazePos = mazePos

        # The Walls of the cell (up, down, left, right)
        self.northWall = northWall
        self.southWall = southWall
        self.westWall = westWall
        self.eastWall = eastWall

        # Open Paths
        self.northOpen = False
        self.southOpen = False
        self.westOpen = False
        self.eastOpen = False

        self.northCell = northCell  # Pointer to cell directly above
        self.southCell = southCell  # Pointer to cell directly below
        self.westCell = westCell  # Pointer to cell directly left
        self.eastCell = eastCell  # Pointer to cell directly right

        self.openPaths = []

        self.iscorner = iscorner

        self.visited = False
        self.pivot = False
Exemplo n.º 2
0
    def __init__(self, color=color.white, material=materials.wood,
                 length=1, width=10, height=10, visible=True,
                 pos=(0,0,0)):

        box.__init__(self) # super constructor

        self.color    = color
        self.material = material
        self.length   = length
        self.width    = width
        self.height   = height
        self.visible  = visible
        self.pos      = pos
Exemplo n.º 3
0
	def __init__(self, length=1, height=1, width=1, pos=(0,0,0), color=color.white, material=None, opacity=1.0,
					visible=True, active=False):
		box.__init__(self) # call super constructor
		
		self.length = length
		self.height = height
		self.width = width
		self.pos = pos
		self.color = color
		self.material = material
		self.opacity = opacity
		self.visible = visible
		self.active = active
		self.id = Cell.__count
		self.age = 0
		Cell.__count += 1

		## Cell Links
		# Each cell has 26 adjacent cells or boundaries, one for each direction in 3D space
		self.link_u   = None 	# Up               (+y)
		self.link_d   = None 	# Down             (-y)
		self.link_l   = None 	# Left             (-x)
		self.link_r   = None 	# Right            (+x)
		self.link_f   = None 	# Front            (+z)
		self.link_b   = None 	# Back             (-z)
		self.link_ul  = None 	# Up-Left          (-x, +y)
		self.link_ur  = None 	# Up-Right         (+x, +y)
		self.link_dl  = None 	# Down-Left        (-x, -y)
		self.link_dr  = None 	# Down-Right       (+x, -y)
		self.link_fu  = None 	# Front-Up         (+y, +z)
		self.link_fd  = None 	# Front-Down       (-y, +z)
		self.link_fl  = None 	# Front-Left       (-x, +z)
		self.link_fr  = None 	# Front-Right      (+x, +z)
		self.link_bu  = None 	# Back-Up          (+y, -z)
		self.link_bd  = None 	# Back-Down        (-y, -z)
		self.link_bl  = None 	# Back-Left        (-x, -z)
		self.link_br  = None 	# Back-Right       (+x, -z)
		self.link_ful = None 	# Front-Up-Left    (-x, +y, +z)
		self.link_fur = None 	# Front-Up-Right   (+x, +y, +z)
		self.link_fdl = None 	# Front-Down-Left  (-x, -y, +z)
		self.link_fdr = None 	# Front-Down-Right (+x, -y, +z)
		self.link_bul = None 	# Back-Up-Left     (-x, +y, -z)
		self.link_bur = None 	# Back-Up-Right    (+x, +y, -z)
		self.link_bdl = None 	# Back-Down-Left   (-x, -y, -z)
		self.link_bdr = None 	# Back-Down-Right  (+x, -y, -z)