<s> class Rect ( object ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , x , y , width , height ) : <EOL> '''<STR_LIT>''' <EOL> self . _x , self . _y = x , y <EOL> self . _width , self . _height = width , height <EOL> def set_x ( self , value ) : self . _x = value <EOL> x = property ( lambda self : self . _x , set_x ) <EOL> def set_y ( self , value ) : self . _y = value <EOL> y = property ( lambda self : self . _y , set_y ) <EOL> def set_width ( self , value ) : self . _width = value <EOL> width = property ( lambda self : self . _width , set_width ) <EOL> def set_height ( self , value ) : self . _height = value <EOL> height = property ( lambda self : self . _height , set_height ) <EOL> def set_pos ( self , value ) : self . _x , self . _y = value <EOL> pos = property ( lambda self : ( self . _x , self . _y ) , set_pos ) <EOL> def set_size ( self , value ) : self . _width , self . _height = value <EOL> size = property ( lambda self : ( self . _width , self . _height ) , set_size ) <EOL> def contains ( self , x , y ) : <EOL> '''<STR_LIT>''' <EOL> if x < self . _x or x > self . _x + self . _width : return False <EOL> if y < self . _y or y > self . _y + self . _height : return False <EOL> return True <EOL> def intersects ( self , other ) : <EOL> '''<STR_LIT>''' <EOL> if self . _x + self . _width < other . x : return False <EOL> if other . x + other . width < self . _x : return False <EOL> if self . _y + self . _height < other . y : return False <EOL> if other . y + other . height < self . _y : return False <EOL> return True <EOL> def get_top ( self ) : return self . y + self . height <EOL> def set_top ( self , y ) : self . y = y - self . height <EOL> top = property ( get_top , set_top ) <EOL> def get_bottom ( self ) : return self . y <EOL> def set_bottom ( self , y ) : self . y = y <EOL> bottom = property ( get_bottom , set_bottom ) <EOL> def get_left ( self ) : return self . x <EOL> def set_left ( self , x ) : self . x = x <EOL> left = property ( get_left , set_left ) <EOL> def get_right ( self ) : return self . x + self . width <EOL> def set_right ( self , x ) : self . x = x - self . width <EOL> right = property ( get_right , set_right ) <EOL> def get_center ( self ) : <EOL> return ( self . x + self . width / <NUM_LIT:2> , self . y + self . height / <NUM_LIT:2> ) <EOL> def set_center ( self , center ) : <EOL> x , y = center <EOL> self . pos = ( x - self . width / <NUM_LIT:2> , y - self . height / <NUM_LIT:2> ) <EOL> center = property ( get_center , set_center ) <EOL> def get_midtop ( self ) : <EOL> return ( self . x + self . width / <NUM_LIT:2> , self . y + self . height ) <EOL> def set_midtop ( self , midtop ) : <EOL> x , y = midtop <EOL> self . pos = ( x - self . width / <NUM_LIT:2> , y - self . height ) <EOL> midtop = property ( get_midtop , set_midtop ) <EOL> def get_midbottom ( self ) : <EOL> return ( self . x + self . width / <NUM_LIT:2> , self . y ) <EOL> def set_midbottom ( self , midbottom ) : <EOL> x , y = midbottom <EOL> self . pos = ( x - self . width / <NUM_LIT:2> , y ) <EOL> midbottom = property ( get_midbottom , set_midbottom ) <EOL> def get_midleft ( self ) : <EOL> return ( self . x , self . y + self . height / <NUM_LIT:2> ) <EOL> def set_midleft ( self , midleft ) : <EOL> x , y = midleft <EOL> self . pos = ( x , y - self . height / <NUM_LIT:2> ) <EOL> midleft = property ( get_midleft , set_midleft ) <EOL> def get_midright ( self ) : <EOL> return ( self . x + self . width , self . y + self . height / <NUM_LIT:2> ) <EOL> def set_midright ( self , midright ) : <EOL> x , y = midright <EOL> self . pos = ( x - self . width , y - self . height / <NUM_LIT:2> ) <EOL> midright = property ( get_midright , set_midright ) <EOL> def get_topleft ( self ) : <EOL> return ( self . x , self . y + self . height ) <EOL> def set_topleft ( self , pos ) : <EOL> x , y = pos <EOL> self . pos = ( x , y - self . height ) <EOL> topleft = property ( get_topleft , set_topleft ) <EOL> def get_topright ( self ) : <EOL> return ( self . x + self . width , self . y + self . height ) <EOL> def set_topright ( self , pos ) : <EOL> x , y = pos <EOL> self . pos = ( x - self . width , y - self . height ) <EOL> topright = property ( get_topright , set_topright ) <EOL> def get_bottomright ( self ) : <EOL> return ( self . x + self . width , self . y ) <EOL> def set_bottomright ( self , pos ) : <EOL> x , y = pos <EOL> self . pos = ( x - self . width , y ) <EOL> bottomright = property ( get_bottomright , set_bottomright ) <EOL> def get_bottomleft ( self ) : <EOL> return ( self . x , self . y ) <EOL> def set_bottomleft ( self , pos ) : <EOL> self . x , self . y = pos <EOL> bottomleft = property ( get_bottomleft , set_bottomleft ) </s>
