Ejemplo n.º 1
0
 def open_door(self, tile):
     if not tile.openable:
         raise TypeError('tile cannot be opened.'.format(tile))
     tiletype = TileType.get_door_type(tile.tiletype.direction, False, True, False)
     tiletype = TileType(tile.tiletype.name.replace('closed', 'open'))
     tile.tiletype = tiletype
     return True
Ejemplo n.º 2
0
 def fix_door(self, tile):
     if not tile.fixable:
         raise TypeError('tile cannot be fixed.'.format(tile))
     tiletype = TileType.get_door_type(tile.tiletype.direction, False, True, False)
     tile.tiletype = tiletype
     return True
Ejemplo n.º 3
0
 def break_door(self, tile):
     if not tile.breakable:
         raise TypeError('tile cannot be broken.'.format(tile))
     tiletype = TileType.get_door_type(tile.tiletype.direction, True, True, False)
     tile.tiletype = tiletype
     return True
Ejemplo n.º 4
0
 def unlock_door(self, tile):
     if not tile.unlockable:
         raise TypeError('tile cannot be unlocked.'.format(tile))
     tiletype = TileType.get_door_type(tile.tiletype.direction, False, False, False)
     tile.tiletype = tiletype
     return True
Ejemplo n.º 5
0
 def close_door(self, tile):
     if not tile.closable:
         raise TypeError('tile cannot be closed.'.format(tile))
     tiletype = TileType.get_door_type(tile.tiletype.direction, False, False, False)
     tile.tiletype = tiletype
     return True