Class: ClumsyPlayer
Instance Attribute Summary
Attributes inherited from Player
#found_treasures, #hash, #health
Instance Method Summary collapse
Methods inherited from Player
#<=>, #each_found_treasure, from_csv, #initialize, #name, #name=, #points, #score, #to_csv, #to_s
Methods included from Playable
Constructor Details
This class inherits a constructor from Player
Instance Method Details
#found_treasure(treasure) ⇒ Object
3 4 5 6 |
# File 'lib/clumsy_player.rb', line 3 def found_treasure(treasure) @found_treasures[treasure.name] += Integer(treasure.point/2.0) puts "#{@name} found a treasure #{treasure.name} of worth #{treasure.point/2}" end |