#NEWLINE# def load_deck( filename ) : #NEWLINE# #INDENT# cards = [ ] #NEWLINE# character_class = CHARACTER_CLASS . MAGE #NEWLINE# with open ( filename , 'r' ) as deck_file : #NEWLINE# #INDENT# contents = deck_file . read ( ) #NEWLINE# items = contents . splitlines ( ) #NEWLINE# for line in items [ 0 : ] : #NEWLINE# #INDENT# parts = line . split ( ' ' , 1 ) #NEWLINE# count = int ( items [ 0 ] ) #NEWLINE# for i in range ( 0 , count ) : #NEWLINE# #INDENT# card = card_lookup ( parts [ 1 ] ) #NEWLINE# if ( card . character_class != CHARACTER_CLASS . ALL ) : #NEWLINE# #INDENT# character_class = card . character_class #NEWLINE# #UNINDENT# cards . append ( card ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( len ( cards ) > 30 ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# return Deck ( cards , hero_for_class ( character_class ) )