多层迷宫生成中的maze_def.pymaze_def.py 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061#!/usr/bin/python3# -*- coding: utf-8 -*-# create by 火苗999℃# 多层迷宫 #标记 # 墙NOWALL = 0x0e # 无墙WALL = 0x01 # 有墙WALL_NO_VISIT = 0x01 # 没访问过的墙WALL_VISIT = 0x03 # 访问过的墙STEEL = 0X05 # 不能打通的墙# 格子CELL = 0x10 # 单元格CELL_NO_VISIT = 0x10 # 没访问过的格子CELL_VISIT = 0x30 # 访问过的格子CELL_VISIT_FLAG = 0X20 # 访问过标记STAIRS_U = 0x40 # 楼梯上STAIRS_D = 0x80 # 楼梯下STAIRS_UD = 0xC0 # 楼梯上下CELL_EXT_FLAG = 0X100 # 扩建标记CELL_EXT = 0X110 # 扩建的没访问过的房间# 方向LR = 1 # 左右FB = 2 # 前后UD = 3 # 上下LEFT = 'L'RIGHT = 'R'FORWARD = 'F'BACKWARD='B'UP = 'U'DOWN = 'D'class Grid: def __new__(cls, *args, **kwargs): return super().__new__(cls) def __init__(self, x, y, z): self.x = x self.y = y self.z = z self.u = 0 self.d = 0 self.l = 0 self.r = 0 self.f = 0 self.b = 0 def __str__(self): return "x={},y={},z={}".format(self.name, self.age, self.sex) def __del__(self): return