<s> """<STR_LIT>""" <EOL> from random import Random <EOL> from pyherc . aspects import log_debug <EOL> from pyherc . generators . level . room . squareroom import SquareRoomGenerator <EOL> from pyherc . generators . level . partitioners import section_floor , section_wall <EOL> class PillarRoomGenerator ( ) : <EOL> """<STR_LIT>""" <EOL> @ log_debug <EOL> def __init__ ( self , floor_tile , corridor_tile , empty_tile , pillar_tile , <EOL> level_types ) : <EOL> """<STR_LIT>""" <EOL> self . square_generator = SquareRoomGenerator ( floor_tile , <EOL> empty_tile , <EOL> corridor_tile , <EOL> level_types ) <EOL> self . floor_tile = floor_tile <EOL> self . corridor_tile = corridor_tile <EOL> self . empty_tile = empty_tile <EOL> self . level_types = level_types <EOL> self . pillar_tile = pillar_tile <EOL> self . rng = Random ( ) <EOL> def __call__ ( self , section ) : <EOL> """<STR_LIT>""" <EOL> self . generate_room ( section ) <EOL> @ log_debug <EOL> def generate_room ( self , section ) : <EOL> """<STR_LIT>""" <EOL> self . square_generator . generate_room ( section ) <EOL> offset = [ ( <NUM_LIT:1> , <NUM_LIT:1> ) , ( - <NUM_LIT:1> , <NUM_LIT:1> ) , ( - <NUM_LIT:1> , - <NUM_LIT:1> ) , ( <NUM_LIT:1> , - <NUM_LIT:1> ) ] <EOL> for index , corner in enumerate ( self . square_generator . room_corners ) : <EOL> self . add_pillar ( section , corner , offset [ index ] ) <EOL> @ log_debug <EOL> def add_pillar ( self , section , corner , pillar ) : <EOL> """<STR_LIT>""" <EOL> location = ( corner [ <NUM_LIT:0> ] + pillar [ <NUM_LIT:0> ] , <EOL> corner [ <NUM_LIT:1> ] + pillar [ <NUM_LIT:1> ] ) <EOL> if section_wall ( section , location ) == self . empty_tile : <EOL> section_wall ( section , <EOL> location , <EOL> self . pillar_tile , <EOL> None ) <EOL> section_floor ( section , <EOL> location , <EOL> None , <EOL> None ) </s>
