# Copyright 2006 Michael Lewis # Distributed under the terms of the GNU General Public License v2 require "Hand" class PlayerHand < Hand attr_reader :splits, :bet def copy( o ) @locked = o.locked? @splits = o.splits @bet = o.bet @doubled = o.doubled? @over = false super end def initialize( bet = 1.0 ) dirtythis @locked = false @splits = 0 @bet = bet @over = false @doubled = false end #Mark this hand as being split (again) def split @splits += 1 end #Has this hand been locked? def locked? @locked end def doubled? @doubled end #Make sure the player subtracts the bet from their money def double @bet *= 2 lock @doubled = true end #mark this hand as being locked def lock @locked = true end def over @over = true @bet = nil end def over? @over end end