mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 16:49:11 +00:00
21 lines
418 B
Ruby
21 lines
418 B
Ruby
require 'java'
|
|
|
|
java_import 'org.apollo.cache.def.ItemDefinition'
|
|
|
|
java_import 'org.apollo.game.model.Item'
|
|
|
|
# An Item in a Shop.
|
|
class ShopItem
|
|
attr_reader :amount, :cost, :id, :name
|
|
|
|
# Creates the ShopItem.
|
|
def initialize(id, amount, cost = nil)
|
|
definition = ItemDefinition.lookup(id)
|
|
@id = id
|
|
@amount = amount
|
|
@cost = cost.nil? ? definition.value : cost
|
|
@name = definition.name
|
|
end
|
|
|
|
end
|