Next / Previous / Contents / TCC Help System / NM Tech homepage

15. class Wall: One wall in the maze

mazeratty
# - - - - -   c l a s s   W a l l

class Wall(object):
    '''Represents one wall, removed or not.

      Exports:
        Wall(wallKey)
          [ wallKey is a wall-key ->
              return a new, solid Wall instance representing that key ]
        .wallKey:  [ as passed to constructor ]
        .solid:  [ True iff this wall has not been removed; read/write ]
    '''
    __slots__  =  ('wallKey', 'solid')

    def __init__(self, wallKey):
        '''Constructor.
        '''
        self.wallKey = wallKey
        self.solid = True