-- 18-04-2002 A V Peterson class CARD_PLAYER -- player in a card game creation make feature {ANY} identity : STRING -- player's name hand : OPT_CARD_HAND -- cards held score : REAL -- amount won make(s : STRING) is -- create a player with identity s, initial score 0, empty hand do identity := s score := 0.0 !!hand.make end -- make get_card(c : CARD) is -- Add card c to hand local do hand.add_card(c) end -- add_card update_score(by_amount : REAL) is -- Add by_amount to score; by_amount may be positive or negative do score := score + by_amount end -- update_score display is -- Display player's identity, score, and current hand do io.put_string(identity); io.put_string(" has score ") io.put_real_format(score, 2); io.put_new_line io.put_string(" Hand: ") hand.display -- io.put_new_line end -- display end -- class CARD_PLAYER