lib/goby/entity/entity.rb
def add_loot(gold, treasures)
      type("Loot: ")
      if ((gold.positive?) || (treasures && treasures.any?))
        print "\n"
        if gold.positive?
          type("* #{gold} gold\n")
          add_gold(gold)
        end
        if treasures && treasures.any?
          treasures.each do |treasure|
            unless treasure.nil?
              type("* #{treasure.name}\n")
              add_item(treasure)
            end
          end
        end
        print "\n"
      else
        type("nothing!\n\n")
      end
    end
# Adds the specified gold and treasures to the inventory.
#
# @param [Integer] gold the amount of gold.
# @param [[Item]] treasures the list of treasures.
Adds the specified gold and treasures to the inventory.
Adds the specified gold and treasures to the inventory .
def add_loot(gold, treasures)
      type("Loot: ")
      if ((gold.positive?) || (treasures && treasures.any?))
        print "\n"
        if gold.positive?
          type("* #{gold} gold\n")
          add_gold(gold)
        end
        if treasures && treasures.any?
          treasures.each do |treasure|
            unless treasure.nil?
              type("* #{treasure.name}\n")
              add_item(treasure)
            end
          end
        end
        print "\n"
      else
        type("nothing!\n\n")
      end
    end
def add_loot ( gold , treasures ) type ( "Loot: " ) if ( ( gold . positive? ) || ( treasures && treasures . any? ) ) print "\n" if gold . positive? type ( "* #{gold} gold\n" ) add_gold ( gold ) end if treasures && treasures . any? treasures . each do | treasure | unless treasure . nil? type ( "* #{treasure.name}\n" ) add_item ( treasure ) end end end print "\n" else type ( "nothing!\n\n" ) end end
Adds the specified gold and treasures to the inventory.
Adds the specified gold and treasures to the inventory .
gold
treasures
gold the amount of gold.
gold the amount of gold .
]
treasures the list of treasures.
treasures the list of treasures .