Class: ClumsyPlayer

Inherits:
Player show all
Defined in:
lib/clumsy_player.rb

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

#blam, #strong?, #w00t

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